Merge lp:goobi-presentation/1.1 into lp:~slub.team/goobi-presentation/old-bzr-trunk
- 1.1
- Merge into old-bzr-trunk
Proposed by
Sebastian Meyer
Status: | Merged |
---|---|
Merged at revision: | 86 |
Proposed branch: | lp:goobi-presentation/1.1 |
Merge into: | lp:~slub.team/goobi-presentation/old-bzr-trunk |
Diff against target: |
6190 lines (+1826/-1558) (has conflicts) 35 files modified
dlf/common/class.tx_dlf_document.php (+427/-367) dlf/common/class.tx_dlf_helper.php (+189/-137) dlf/common/class.tx_dlf_indexing.php (+138/-157) dlf/common/class.tx_dlf_list.php (+51/-15) dlf/common/class.tx_dlf_mods.php (+0/-12) dlf/common/class.tx_dlf_module.php (+12/-14) dlf/common/class.tx_dlf_plugin.php (+22/-10) dlf/common/class.tx_dlf_solr.php (+14/-3) dlf/ext_autoload.php (+30/-30) dlf/ext_emconf.php (+33/-0) dlf/ext_tables.php (+146/-145) dlf/ext_tables.sql (+2/-1) dlf/ext_tables_static+adt.sql (+1/-2) dlf/hooks/class.tx_dlf_em.php (+166/-166) dlf/hooks/class.tx_dlf_hacks.php (+21/-21) dlf/hooks/class.tx_dlf_tceforms.php (+24/-24) dlf/hooks/class.tx_dlf_tcemain.php (+50/-58) dlf/locallang.xml (+0/-2) dlf/modules/indexing/index.php (+2/-2) dlf/modules/newclient/index.php (+1/-0) dlf/modules/newclient/metadata.inc.php (+18/-3) dlf/plugins/collection/class.tx_dlf_collection.php (+19/-15) dlf/plugins/feeds/class.tx_dlf_feeds.php (+6/-6) dlf/plugins/listview/class.tx_dlf_listview.php (+100/-93) dlf/plugins/listview/locallang.xml (+2/-0) dlf/plugins/metadata/class.tx_dlf_metadata.php (+91/-87) dlf/plugins/navigation/class.tx_dlf_navigation.php (+2/-2) dlf/plugins/oai/class.tx_dlf_oai.php (+124/-91) dlf/plugins/pageview/class.tx_dlf_pageview.php (+33/-26) dlf/plugins/search/class.tx_dlf_search.php (+39/-30) dlf/plugins/search/locallang.xml (+2/-2) dlf/plugins/statistics/class.tx_dlf_statistics.php (+5/-1) dlf/plugins/toc/class.tx_dlf_toc.php (+23/-19) dlf/plugins/toolbox/class.tx_dlf_toolbox.php (+8/-8) dlf/tca.php (+25/-9) Text conflict in dlf/ext_emconf.php |
To merge this branch: | bzr merge lp:goobi-presentation/1.1 |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sebastian Meyer | Approve | ||
Review via email: mp+120060@code.launchpad.net |
Commit message
Description of the change
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-08-09 10:31:57 +0000 | |||
3 | +++ dlf/common/class.tx_dlf_document.php 2012-08-17 07:00:27 +0000 | |||
4 | @@ -35,7 +35,7 @@ | |||
5 | 35 | * @subpackage tx_dlf | 35 | * @subpackage tx_dlf |
6 | 36 | * @access public | 36 | * @access public |
7 | 37 | */ | 37 | */ |
9 | 38 | class tx_dlf_document { | 38 | final class tx_dlf_document { |
10 | 39 | 39 | ||
11 | 40 | /** | 40 | /** |
12 | 41 | * This holds the whole XML file as string for serialization purposes | 41 | * This holds the whole XML file as string for serialization purposes |
13 | @@ -87,15 +87,23 @@ | |||
14 | 87 | * @access protected | 87 | * @access protected |
15 | 88 | */ | 88 | */ |
16 | 89 | protected $formats = array ( | 89 | protected $formats = array ( |
26 | 90 | 'OTHER' => array ( | 90 | 'METS' => array ( |
27 | 91 | 'DVRIGHTS' => array ( | 91 | 'rootElement' => 'mets', |
28 | 92 | 'rootElement' => 'rights', | 92 | 'namespaceURI' => 'http://www.loc.gov/METS/', |
29 | 93 | 'namespaceURI' => 'http://dfg-viewer.de/', | 93 | ), |
30 | 94 | ), | 94 | // This one can become a problem, because MODS uses its own custom XLINK schema. |
31 | 95 | 'DVLINKS' => array ( | 95 | // @see http://comments.gmane.org/gmane.comp.text.mods/1126 |
32 | 96 | 'rootElement' => 'links', | 96 | 'XLINK' => array ( |
33 | 97 | 'namespaceURI' => 'http://dfg-viewer.de/', | 97 | 'rootElement' => 'xlink', |
34 | 98 | ) | 98 | 'namespaceURI' => 'http://www.w3.org/1999/xlink', |
35 | 99 | ), | ||
36 | 100 | 'DVRIGHTS' => array ( | ||
37 | 101 | 'rootElement' => 'rights', | ||
38 | 102 | 'namespaceURI' => 'http://dfg-viewer.de/', | ||
39 | 103 | ), | ||
40 | 104 | 'DVLINKS' => array ( | ||
41 | 105 | 'rootElement' => 'links', | ||
42 | 106 | 'namespaceURI' => 'http://dfg-viewer.de/', | ||
43 | 99 | ) | 107 | ) |
44 | 100 | ); | 108 | ); |
45 | 101 | 109 | ||
46 | @@ -300,13 +308,17 @@ | |||
47 | 300 | */ | 308 | */ |
48 | 301 | public function getFileLocation($id) { | 309 | public function getFileLocation($id) { |
49 | 302 | 310 | ||
51 | 303 | if (($_location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]'))) { | 311 | if (($location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]'))) { |
52 | 304 | 312 | ||
54 | 305 | return (string) $_location[0]->attributes('http://www.w3.org/1999/xlink')->href; | 313 | return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href; |
55 | 306 | 314 | ||
56 | 307 | } else { | 315 | } else { |
57 | 308 | 316 | ||
59 | 309 | trigger_error('There is no file node with @ID '.$id, E_USER_WARNING); | 317 | if (TYPO3_DLOG) { |
60 | 318 | |||
61 | 319 | t3lib_div::devLog('[tx_dlf_document->getFileLocation('.$id.')] There is no file node with @ID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
62 | 320 | |||
63 | 321 | } | ||
64 | 310 | 322 | ||
65 | 311 | return ''; | 323 | return ''; |
66 | 312 | 324 | ||
67 | @@ -325,9 +337,9 @@ | |||
68 | 325 | 337 | ||
69 | 326 | if (!$this->hookObjectsLoaded && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/common/class.tx_dlf_document.php']['hookClass'])) { | 338 | if (!$this->hookObjectsLoaded && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/common/class.tx_dlf_document.php']['hookClass'])) { |
70 | 327 | 339 | ||
72 | 328 | foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/common/class.tx_dlf_document.php']['hookClass'] as $_classRef) { | 340 | foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/common/class.tx_dlf_document.php']['hookClass'] as $classRef) { |
73 | 329 | 341 | ||
75 | 330 | $this->hookObjects[] = t3lib_div::getUserObj($_classRef); | 342 | $this->hookObjects[] = t3lib_div::getUserObj($classRef); |
76 | 331 | 343 | ||
77 | 332 | } | 344 | } |
78 | 333 | 345 | ||
79 | @@ -393,10 +405,10 @@ | |||
80 | 393 | self::$registry[$instance->uid] = $instance; | 405 | self::$registry[$instance->uid] = $instance; |
81 | 394 | 406 | ||
82 | 395 | // Load extension configuration | 407 | // Load extension configuration |
84 | 396 | $_extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']); | 408 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']); |
85 | 397 | 409 | ||
86 | 398 | // Save document to session if caching is enabled. | 410 | // Save document to session if caching is enabled. |
88 | 399 | if (!empty($_extConf['caching'])) { | 411 | if (!empty($extConf['caching'])) { |
89 | 400 | 412 | ||
90 | 401 | tx_dlf_helper::saveToSession(self::$registry, get_class($instance)); | 413 | tx_dlf_helper::saveToSession(self::$registry, get_class($instance)); |
91 | 402 | 414 | ||
92 | @@ -412,6 +424,62 @@ | |||
93 | 412 | /** | 424 | /** |
94 | 413 | * This gets details about a logical structure element | 425 | * This gets details about a logical structure element |
95 | 414 | * | 426 | * |
96 | 427 | * @access public | ||
97 | 428 | * | ||
98 | 429 | * @param string $id: The @ID attribute of the logical structure node | ||
99 | 430 | * @param boolean $recursive: Whether to include the child elements | ||
100 | 431 | * | ||
101 | 432 | * @return array Array of the element's id, label, type and physical page indexes/mptr link | ||
102 | 433 | */ | ||
103 | 434 | public function getLogicalStructure($id, $recursive = FALSE) { | ||
104 | 435 | |||
105 | 436 | $details = array (); | ||
106 | 437 | |||
107 | 438 | // Is the requested logical unit already loaded? | ||
108 | 439 | if (!$recursive && !empty($this->logicalUnits[$id])) { | ||
109 | 440 | |||
110 | 441 | // Yes. Return it. | ||
111 | 442 | return $this->logicalUnits[$id]; | ||
112 | 443 | |||
113 | 444 | } elseif (!empty($id)) { | ||
114 | 445 | |||
115 | 446 | // Get specified logical unit. | ||
116 | 447 | $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]'); | ||
117 | 448 | |||
118 | 449 | } else { | ||
119 | 450 | |||
120 | 451 | // Get all logical units at top level. | ||
121 | 452 | $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div'); | ||
122 | 453 | |||
123 | 454 | } | ||
124 | 455 | |||
125 | 456 | if (!empty($divs)) { | ||
126 | 457 | |||
127 | 458 | if (!$recursive) { | ||
128 | 459 | |||
129 | 460 | // Get the details for the first xpath hit. | ||
130 | 461 | $details = $this->getLogicalStructureInfo($divs[0]); | ||
131 | 462 | |||
132 | 463 | } else { | ||
133 | 464 | |||
134 | 465 | // Walk the logical structure recursively and fill the whole table of contents. | ||
135 | 466 | foreach ($divs as $div) { | ||
136 | 467 | |||
137 | 468 | $this->tableOfContents[] = $this->getLogicalStructureInfo($div, TRUE); | ||
138 | 469 | |||
139 | 470 | } | ||
140 | 471 | |||
141 | 472 | } | ||
142 | 473 | |||
143 | 474 | } | ||
144 | 475 | |||
145 | 476 | return $details; | ||
146 | 477 | |||
147 | 478 | } | ||
148 | 479 | |||
149 | 480 | /** | ||
150 | 481 | * This gets details about a logical structure element | ||
151 | 482 | * | ||
152 | 415 | * @access protected | 483 | * @access protected |
153 | 416 | * | 484 | * |
154 | 417 | * @param SimpleXMLElement $structure: The logical structure node | 485 | * @param SimpleXMLElement $structure: The logical structure node |
155 | @@ -439,6 +507,7 @@ | |||
156 | 439 | 507 | ||
157 | 440 | $details['volume'] = ''; | 508 | $details['volume'] = ''; |
158 | 441 | 509 | ||
159 | 510 | // Set volume information only if no label is set and this is the toplevel structure element. | ||
160 | 442 | if (empty($details['label']) && $details['id'] == $this->_getToplevelId()) { | 511 | if (empty($details['label']) && $details['id'] == $this->_getToplevelId()) { |
161 | 443 | 512 | ||
162 | 444 | $metadata = $this->getMetadata($details['id']); | 513 | $metadata = $this->getMetadata($details['id']); |
163 | @@ -455,11 +524,14 @@ | |||
164 | 455 | 524 | ||
165 | 456 | $details['type'] = $attributes['TYPE']; | 525 | $details['type'] = $attributes['TYPE']; |
166 | 457 | 526 | ||
167 | 527 | // Load smLinks. | ||
168 | 528 | $this->_getSmLinks(); | ||
169 | 529 | |||
170 | 458 | // Get the physical page or external file this structure element is pointing at. | 530 | // Get the physical page or external file this structure element is pointing at. |
171 | 459 | $details['points'] = ''; | 531 | $details['points'] = ''; |
172 | 460 | 532 | ||
173 | 461 | // Is there a mptr node? | 533 | // Is there a mptr node? |
175 | 462 | if (!empty($structure->children('http://www.loc.gov/METS/')->mptr)) { | 534 | if (count($structure->children('http://www.loc.gov/METS/')->mptr)) { |
176 | 463 | 535 | ||
177 | 464 | // Yes. Get the file reference. | 536 | // Yes. Get the file reference. |
178 | 465 | $details['points'] = (string) $structure->children('http://www.loc.gov/METS/')->mptr[0]->attributes('http://www.w3.org/1999/xlink')->href; | 537 | $details['points'] = (string) $structure->children('http://www.loc.gov/METS/')->mptr[0]->attributes('http://www.w3.org/1999/xlink')->href; |
179 | @@ -472,7 +544,7 @@ | |||
180 | 472 | // Get page number of the first page related to this structure element. | 544 | // Get page number of the first page related to this structure element. |
181 | 473 | $details['pagination'] = $this->physicalPagesInfo[$id]['label']; | 545 | $details['pagination'] = $this->physicalPagesInfo[$id]['label']; |
182 | 474 | 546 | ||
184 | 475 | // Is this the toplevel structure? | 547 | // Is this the toplevel structure element? |
185 | 476 | } elseif ($details['id'] == $this->_getToplevelId()) { | 548 | } elseif ($details['id'] == $this->_getToplevelId()) { |
186 | 477 | 549 | ||
187 | 478 | // Yes. Point to itself. | 550 | // Yes. Point to itself. |
188 | @@ -484,14 +556,14 @@ | |||
189 | 484 | $this->logicalUnits[$details['id']] = $details; | 556 | $this->logicalUnits[$details['id']] = $details; |
190 | 485 | 557 | ||
191 | 486 | // Walk the structure recursively? And are there any children of the current element? | 558 | // Walk the structure recursively? And are there any children of the current element? |
193 | 487 | if ($recursive && !empty($structure->children('http://www.loc.gov/METS/')->div)) { | 559 | if ($recursive && count($structure->children('http://www.loc.gov/METS/')->div)) { |
194 | 488 | 560 | ||
195 | 489 | $details['children'] = array (); | 561 | $details['children'] = array (); |
196 | 490 | 562 | ||
197 | 491 | foreach ($structure->children('http://www.loc.gov/METS/')->div as $child) { | 563 | foreach ($structure->children('http://www.loc.gov/METS/')->div as $child) { |
198 | 492 | 564 | ||
199 | 493 | // Repeat for all children. | 565 | // Repeat for all children. |
201 | 494 | $details['children'][] = $this->getLogicalStructureInfo($child, $recursive); | 566 | $details['children'][] = $this->getLogicalStructureInfo($child, TRUE); |
202 | 495 | 567 | ||
203 | 496 | } | 568 | } |
204 | 497 | 569 | ||
205 | @@ -502,64 +574,6 @@ | |||
206 | 502 | } | 574 | } |
207 | 503 | 575 | ||
208 | 504 | /** | 576 | /** |
209 | 505 | * This gets details about a logical structure element | ||
210 | 506 | * | ||
211 | 507 | * @access public | ||
212 | 508 | * | ||
213 | 509 | * @param string $id: The @ID attribute of the logical structure node | ||
214 | 510 | * @param boolean $recursive: Whether to include the child elements | ||
215 | 511 | * | ||
216 | 512 | * @return array Array of the element's id, label, type and physical page indexes/mptr link | ||
217 | 513 | */ | ||
218 | 514 | public function getLogicalStructure($id = '', $recursive = FALSE) { | ||
219 | 515 | |||
220 | 516 | // Is the requested logical unit already loaded? | ||
221 | 517 | if (!$recursive && !empty($id) && !empty($this->logicalUnits[$id])) { | ||
222 | 518 | |||
223 | 519 | // Yes. Return it. | ||
224 | 520 | return $this->logicalUnits[$id]; | ||
225 | 521 | |||
226 | 522 | } elseif (!empty($id)) { | ||
227 | 523 | |||
228 | 524 | // Get specified logical unit. | ||
229 | 525 | $div = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]'); | ||
230 | 526 | |||
231 | 527 | } elseif ($recursive) { | ||
232 | 528 | |||
233 | 529 | // Get all logical units at top level. | ||
234 | 530 | $div = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div'); | ||
235 | 531 | |||
236 | 532 | } | ||
237 | 533 | |||
238 | 534 | if (!empty($div)) { | ||
239 | 535 | |||
240 | 536 | // Load smLinks. | ||
241 | 537 | $this->_getSmLinks(); | ||
242 | 538 | |||
243 | 539 | foreach ($div as $structure) { | ||
244 | 540 | |||
245 | 541 | // Get logical unit's details. | ||
246 | 542 | $this->tableOfContents[] = $this->getLogicalStructureInfo($structure, $recursive); | ||
247 | 543 | |||
248 | 544 | } | ||
249 | 545 | |||
250 | 546 | } | ||
251 | 547 | |||
252 | 548 | if (!empty($this->logicalUnits[$id])) { | ||
253 | 549 | |||
254 | 550 | return $this->logicalUnits[$id]; | ||
255 | 551 | |||
256 | 552 | } else { | ||
257 | 553 | |||
258 | 554 | // trigger_error('There is no logical structure node with @ID '.$id, E_USER_WARNING); | ||
259 | 555 | |||
260 | 556 | return array (); | ||
261 | 557 | |||
262 | 558 | } | ||
263 | 559 | |||
264 | 560 | } | ||
265 | 561 | |||
266 | 562 | /** | ||
267 | 563 | * This extracts all the metadata for a logical structure node | 577 | * This extracts all the metadata for a logical structure node |
268 | 564 | * | 578 | * |
269 | 565 | * @access public | 579 | * @access public |
270 | @@ -572,6 +586,9 @@ | |||
271 | 572 | */ | 586 | */ |
272 | 573 | public function getMetadata($id, $cPid = 0) { | 587 | public function getMetadata($id, $cPid = 0) { |
273 | 574 | 588 | ||
274 | 589 | // Save parameter for logging purposes. | ||
275 | 590 | $_cPid = $cPid; | ||
276 | 591 | |||
277 | 575 | // Make sure $cPid is a non-negative integer. | 592 | // Make sure $cPid is a non-negative integer. |
278 | 576 | $cPid = max(intval($cPid), 0); | 593 | $cPid = max(intval($cPid), 0); |
279 | 577 | 594 | ||
280 | @@ -583,7 +600,11 @@ | |||
281 | 583 | 600 | ||
282 | 584 | } elseif (!$cPid) { | 601 | } elseif (!$cPid) { |
283 | 585 | 602 | ||
285 | 586 | trigger_error('Invalid PID ('.$cPid.') for metadata definitions', E_USER_WARNING); | 603 | if (TYPO3_DLOG) { |
286 | 604 | |||
287 | 605 | t3lib_div::devLog('[tx_dlf_document->getMetadata('.$id.', '.$_cPid.')] Invalid PID "'.$cPid.'" for metadata definitions', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
288 | 606 | |||
289 | 607 | } | ||
290 | 587 | 608 | ||
291 | 588 | return array (); | 609 | return array (); |
292 | 589 | 610 | ||
293 | @@ -597,7 +618,7 @@ | |||
294 | 597 | } | 618 | } |
295 | 598 | 619 | ||
296 | 599 | // Initialize metadata array with empty values. | 620 | // Initialize metadata array with empty values. |
298 | 600 | $_metadata = array ( | 621 | $metadata = array ( |
299 | 601 | 'title' => array (), | 622 | 'title' => array (), |
300 | 602 | 'title_sorting' => array (), | 623 | 'title_sorting' => array (), |
301 | 603 | 'author' => array (), | 624 | 'author' => array (), |
302 | @@ -619,17 +640,17 @@ | |||
303 | 619 | // Get the logical structure node's DMDID. | 640 | // Get the logical structure node's DMDID. |
304 | 620 | if (!empty($this->logicalUnits[$id])) { | 641 | if (!empty($this->logicalUnits[$id])) { |
305 | 621 | 642 | ||
307 | 622 | $_dmdId = $this->logicalUnits[$id]['dmdId']; | 643 | $dmdId = $this->logicalUnits[$id]['dmdId']; |
308 | 623 | 644 | ||
309 | 624 | } else { | 645 | } else { |
310 | 625 | 646 | ||
312 | 626 | $_dmdId = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@DMDID'); | 647 | $dmdId = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@DMDID'); |
313 | 627 | 648 | ||
315 | 628 | $_dmdId = (string) $_dmdId[0]; | 649 | $dmdId = (string) $dmdId[0]; |
316 | 629 | 650 | ||
317 | 630 | } | 651 | } |
318 | 631 | 652 | ||
320 | 632 | if (!empty($_dmdId)) { | 653 | if (!empty($dmdId)) { |
321 | 633 | 654 | ||
322 | 634 | // Load available metadata formats and dmdSecs. | 655 | // Load available metadata formats and dmdSecs. |
323 | 635 | $this->loadFormats(); | 656 | $this->loadFormats(); |
324 | @@ -637,30 +658,34 @@ | |||
325 | 637 | $this->_getDmdSec(); | 658 | $this->_getDmdSec(); |
326 | 638 | 659 | ||
327 | 639 | // Is this metadata format supported? | 660 | // Is this metadata format supported? |
335 | 640 | if (!empty($this->formats[$this->dmdSec[$_dmdId]['type']]['class'])) { | 661 | if (!empty($this->formats[$this->dmdSec[$dmdId]['type']]['class'])) { |
336 | 641 | 662 | ||
337 | 642 | $_class = $this->formats[$this->dmdSec[$_dmdId]['type']]['class']; | 663 | $class = $this->formats[$this->dmdSec[$dmdId]['type']]['class']; |
331 | 643 | |||
332 | 644 | } elseif (!empty($this->formats['OTHER'][$this->dmdSec[$_dmdId]['type']]['class'])) { | ||
333 | 645 | |||
334 | 646 | $_class = $this->formats['OTHER'][$this->dmdSec[$_dmdId]['type']]['class']; | ||
338 | 647 | 664 | ||
339 | 648 | } else { | 665 | } else { |
340 | 649 | 666 | ||
342 | 650 | trigger_error('Unsupported metadata format or dmdSec with @ID '.$_dmdId.' not found', E_USER_WARNING); | 667 | if (TYPO3_DLOG) { |
343 | 668 | |||
344 | 669 | t3lib_div::devLog('[tx_dlf_document->getMetadata('.$id.', '.$_cPid.')] Unsupported metadata format "'.$this->dmdSec[$dmdId]['type'].'" in dmdSec with @ID "'.$dmdId.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
345 | 670 | |||
346 | 671 | } | ||
347 | 651 | 672 | ||
348 | 652 | return array (); | 673 | return array (); |
349 | 653 | 674 | ||
350 | 654 | } | 675 | } |
351 | 655 | 676 | ||
352 | 656 | // Get the metadata from class. | 677 | // Get the metadata from class. |
354 | 657 | if (class_exists($_class) && ($obj = t3lib_div::makeInstance($_class)) instanceof tx_dlf_format) { | 678 | if (class_exists($class) && ($obj = t3lib_div::makeInstance($class)) instanceof tx_dlf_format) { |
355 | 658 | 679 | ||
357 | 659 | $obj->extractMetadata($this->dmdSec[$_dmdId]['xml'], $_metadata); | 680 | $obj->extractMetadata($this->dmdSec[$dmdId]['xml'], $metadata); |
358 | 660 | 681 | ||
359 | 661 | } else { | 682 | } else { |
360 | 662 | 683 | ||
362 | 663 | trigger_error('Invalid class/method '.$_class.'->extractMetadata()', E_USER_ERROR); | 684 | if (TYPO3_DLOG) { |
363 | 685 | |||
364 | 686 | t3lib_div::devLog('[tx_dlf_document->getMetadata('.$id.', '.$_cPid.')] Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->dmdSec[$dmdId]['type'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
365 | 687 | |||
366 | 688 | } | ||
367 | 664 | 689 | ||
368 | 665 | return array (); | 690 | return array (); |
369 | 666 | 691 | ||
370 | @@ -669,84 +694,84 @@ | |||
371 | 669 | // Get the structure's type. | 694 | // Get the structure's type. |
372 | 670 | if (!empty($this->logicalUnits[$id])) { | 695 | if (!empty($this->logicalUnits[$id])) { |
373 | 671 | 696 | ||
375 | 672 | $_metadata['type'] = array ($this->logicalUnits[$id]['type']); | 697 | $metadata['type'] = array ($this->logicalUnits[$id]['type']); |
376 | 673 | 698 | ||
377 | 674 | } else { | 699 | } else { |
378 | 675 | 700 | ||
380 | 676 | $_struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE'); | 701 | $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE'); |
381 | 677 | 702 | ||
383 | 678 | $_metadata['type'] = array ((string) $_struct[0]); | 703 | $metadata['type'] = array ((string) $struct[0]); |
384 | 679 | 704 | ||
385 | 680 | } | 705 | } |
386 | 681 | 706 | ||
387 | 682 | // Get the additional metadata from database. | 707 | // Get the additional metadata from database. |
389 | 683 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 708 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
390 | 684 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.xpath AS xpath,tx_dlf_metadata.xpath_sorting AS xpath_sorting,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.default_value AS default_value', | 709 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.xpath AS xpath,tx_dlf_metadata.xpath_sorting AS xpath_sorting,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.default_value AS default_value', |
391 | 685 | 'tx_dlf_metadata,tx_dlf_formats', | 710 | 'tx_dlf_metadata,tx_dlf_formats', |
393 | 686 | 'tx_dlf_metadata.pid='.$cPid.' AND ((tx_dlf_metadata.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->dmdSec[$_dmdId]['type'], 'tx_dlf_formats').') OR tx_dlf_metadata.encoded=0)'.tx_dlf_helper::whereClause('tx_dlf_metadata', TRUE).tx_dlf_helper::whereClause('tx_dlf_formats'), | 711 | 'tx_dlf_metadata.pid='.$cPid.' AND ((tx_dlf_metadata.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->dmdSec[$dmdId]['type'], 'tx_dlf_formats').') OR tx_dlf_metadata.encoded=0)'.tx_dlf_helper::whereClause('tx_dlf_metadata', TRUE).tx_dlf_helper::whereClause('tx_dlf_formats'), |
394 | 687 | '', | 712 | '', |
395 | 688 | '', | 713 | '', |
396 | 689 | '' | 714 | '' |
397 | 690 | ); | 715 | ); |
398 | 691 | 716 | ||
399 | 692 | // We need a DOMDocument here, because SimpleXML doesn't support XPath functions properly. | 717 | // We need a DOMDocument here, because SimpleXML doesn't support XPath functions properly. |
405 | 693 | $_domNode = dom_import_simplexml($this->dmdSec[$_dmdId]['xml']); | 718 | $domNode = dom_import_simplexml($this->dmdSec[$dmdId]['xml']); |
406 | 694 | 719 | ||
407 | 695 | $_domXPath = new DOMXPath($_domNode->ownerDocument); | 720 | $domXPath = new DOMXPath($domNode->ownerDocument); |
408 | 696 | 721 | ||
409 | 697 | $this->registerNamespaces($_domXPath); | 722 | $this->registerNamespaces($domXPath); |
410 | 698 | 723 | ||
411 | 699 | // OK, now make the XPath queries. | 724 | // OK, now make the XPath queries. |
413 | 700 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { | 725 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
414 | 701 | 726 | ||
415 | 702 | // Set metadata field's value(s). | 727 | // Set metadata field's value(s). |
425 | 703 | if ($resArray['xpath'] && ($_values = $_domXPath->evaluate($resArray['xpath'], $_domNode))) { | 728 | if ($resArray['xpath'] && ($values = $domXPath->evaluate($resArray['xpath'], $domNode))) { |
426 | 704 | 729 | ||
427 | 705 | if ($_values instanceof DOMNodeList && $_values->length > 0) { | 730 | if ($values instanceof DOMNodeList && $values->length > 0) { |
428 | 706 | 731 | ||
429 | 707 | $_metadata[$resArray['index_name']] = array (); | 732 | $metadata[$resArray['index_name']] = array (); |
430 | 708 | 733 | ||
431 | 709 | foreach ($_values as $_value) { | 734 | foreach ($values as $value) { |
432 | 710 | 735 | ||
433 | 711 | $_metadata[$resArray['index_name']][] = trim((string) $_value->nodeValue); | 736 | $metadata[$resArray['index_name']][] = trim((string) $value->nodeValue); |
434 | 712 | 737 | ||
435 | 713 | } | 738 | } |
436 | 714 | 739 | ||
438 | 715 | } elseif (!($_values instanceof DOMNodeList)) { | 740 | } elseif (!($values instanceof DOMNodeList)) { |
439 | 716 | 741 | ||
441 | 717 | $_metadata[$resArray['index_name']] = array (trim((string) $_values)); | 742 | $metadata[$resArray['index_name']] = array (trim((string) $values)); |
442 | 718 | 743 | ||
443 | 719 | } | 744 | } |
444 | 720 | 745 | ||
445 | 721 | } | 746 | } |
446 | 722 | 747 | ||
447 | 723 | // Set default value if applicable. | 748 | // Set default value if applicable. |
449 | 724 | if (empty($_metadata[$resArray['index_name']][0]) && $resArray['default_value']) { | 749 | if (empty($metadata[$resArray['index_name']][0]) && $resArray['default_value']) { |
450 | 725 | 750 | ||
452 | 726 | $_metadata[$resArray['index_name']] = array ($resArray['default_value']); | 751 | $metadata[$resArray['index_name']] = array ($resArray['default_value']); |
453 | 727 | 752 | ||
454 | 728 | } | 753 | } |
455 | 729 | 754 | ||
456 | 730 | // Set sorting value if applicable. | 755 | // Set sorting value if applicable. |
468 | 731 | if (!empty($_metadata[$resArray['index_name']]) && $resArray['is_sortable']) { | 756 | if (!empty($metadata[$resArray['index_name']]) && $resArray['is_sortable']) { |
469 | 732 | 757 | ||
470 | 733 | if ($resArray['xpath_sorting'] && ($_values = $_domXPath->evaluate($resArray['xpath_sorting'], $_domNode))) { | 758 | if ($resArray['xpath_sorting'] && ($values = $domXPath->evaluate($resArray['xpath_sorting'], $domNode))) { |
471 | 734 | 759 | ||
472 | 735 | if ($_values instanceof DOMNodeList && $_values->length > 0) { | 760 | if ($values instanceof DOMNodeList && $values->length > 0) { |
473 | 736 | 761 | ||
474 | 737 | $_metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $_values->item(0)->nodeValue); | 762 | $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values->item(0)->nodeValue); |
475 | 738 | 763 | ||
476 | 739 | } elseif (!($_values instanceof DOMNodeList)) { | 764 | } elseif (!($values instanceof DOMNodeList)) { |
477 | 740 | 765 | ||
478 | 741 | $_metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $_values); | 766 | $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values); |
479 | 742 | 767 | ||
480 | 743 | } | 768 | } |
481 | 744 | 769 | ||
482 | 745 | } | 770 | } |
483 | 746 | 771 | ||
485 | 747 | if (empty($_metadata[$resArray['index_name'].'_sorting'][0])) { | 772 | if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
486 | 748 | 773 | ||
488 | 749 | $_metadata[$resArray['index_name'].'_sorting'][0] = $_metadata[$resArray['index_name']][0]; | 774 | $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
489 | 750 | 775 | ||
490 | 751 | } | 776 | } |
491 | 752 | 777 | ||
492 | @@ -755,11 +780,11 @@ | |||
493 | 755 | } | 780 | } |
494 | 756 | 781 | ||
495 | 757 | // Set title to empty string if not present. | 782 | // Set title to empty string if not present. |
501 | 758 | if (empty($_metadata['title'][0])) { | 783 | if (empty($metadata['title'][0])) { |
502 | 759 | 784 | ||
503 | 760 | $_metadata['title'][0] = ''; | 785 | $metadata['title'][0] = ''; |
504 | 761 | 786 | ||
505 | 762 | $_metadata['title_sorting'][0] = ''; | 787 | $metadata['title_sorting'][0] = ''; |
506 | 763 | 788 | ||
507 | 764 | } | 789 | } |
508 | 765 | 790 | ||
509 | @@ -770,7 +795,7 @@ | |||
510 | 770 | 795 | ||
511 | 771 | } | 796 | } |
512 | 772 | 797 | ||
514 | 773 | return $_metadata; | 798 | return $metadata; |
515 | 774 | 799 | ||
516 | 775 | } | 800 | } |
517 | 776 | 801 | ||
518 | @@ -786,6 +811,9 @@ | |||
519 | 786 | */ | 811 | */ |
520 | 787 | public static function getTitle($uid, $recursive = FALSE) { | 812 | public static function getTitle($uid, $recursive = FALSE) { |
521 | 788 | 813 | ||
522 | 814 | // Save parameter for logging purposes. | ||
523 | 815 | $_uid = $uid; | ||
524 | 816 | |||
525 | 789 | $title = ''; | 817 | $title = ''; |
526 | 790 | 818 | ||
527 | 791 | // Sanitize input. | 819 | // Sanitize input. |
528 | @@ -816,13 +844,21 @@ | |||
529 | 816 | 844 | ||
530 | 817 | } else { | 845 | } else { |
531 | 818 | 846 | ||
533 | 819 | trigger_error('No document with UID '.$uid.' found', E_USER_WARNING); | 847 | if (TYPO3_DLOG) { |
534 | 848 | |||
535 | 849 | t3lib_div::devLog('[tx_dlf_document->getTitle('.$_uid.', ['.($recursive ? 'TRUE' : 'FALSE').'])] No document with UID "'.$uid.'" found or document not accessible', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
536 | 850 | |||
537 | 851 | } | ||
538 | 820 | 852 | ||
539 | 821 | } | 853 | } |
540 | 822 | 854 | ||
541 | 823 | } else { | 855 | } else { |
542 | 824 | 856 | ||
544 | 825 | trigger_error('No UID given for document', E_USER_ERROR); | 857 | if (TYPO3_DLOG) { |
545 | 858 | |||
546 | 859 | t3lib_div::devLog('[tx_dlf_document->getTitle('.$_uid.', ['.($recursive ? 'TRUE' : 'FALSE').'])] Invalid UID "'.$uid.'" for document', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
547 | 860 | |||
548 | 861 | } | ||
549 | 826 | 862 | ||
550 | 827 | } | 863 | } |
551 | 828 | 864 | ||
552 | @@ -865,11 +901,11 @@ | |||
553 | 865 | // Get METS node from XML file. | 901 | // Get METS node from XML file. |
554 | 866 | $this->registerNamespaces($this->xml); | 902 | $this->registerNamespaces($this->xml); |
555 | 867 | 903 | ||
561 | 868 | $_mets = $this->xml->xpath('//mets:mets'); | 904 | $mets = $this->xml->xpath('//mets:mets'); |
562 | 869 | 905 | ||
563 | 870 | if ($_mets) { | 906 | if ($mets) { |
564 | 871 | 907 | ||
565 | 872 | $this->mets = $_mets[0]; | 908 | $this->mets = $mets[0]; |
566 | 873 | 909 | ||
567 | 874 | // Register namespaces. | 910 | // Register namespaces. |
568 | 875 | $this->registerNamespaces($this->mets); | 911 | $this->registerNamespaces($this->mets); |
569 | @@ -879,7 +915,11 @@ | |||
570 | 879 | 915 | ||
571 | 880 | } else { | 916 | } else { |
572 | 881 | 917 | ||
574 | 882 | trigger_error('No valid METS part found in document with UID '.$this->uid, E_USER_ERROR); | 918 | if (TYPO3_DLOG) { |
575 | 919 | |||
576 | 920 | t3lib_div::devLog('[tx_dlf_document->init()] No METS part found in document with UID "'.$this->uid.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
577 | 921 | |||
578 | 922 | } | ||
579 | 883 | 923 | ||
580 | 884 | } | 924 | } |
581 | 885 | 925 | ||
582 | @@ -904,39 +944,48 @@ | |||
583 | 904 | || version_compare(phpversion(), '5.3.3', '<')) { | 944 | || version_compare(phpversion(), '5.3.3', '<')) { |
584 | 905 | 945 | ||
585 | 906 | // Load extension configuration | 946 | // Load extension configuration |
587 | 907 | $_extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']); | 947 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']); |
588 | 908 | 948 | ||
589 | 909 | // Set user-agent to identify self when fetching XML data. | 949 | // Set user-agent to identify self when fetching XML data. |
591 | 910 | if (!empty($_extConf['useragent'])) { | 950 | if (!empty($extConf['useragent'])) { |
592 | 911 | 951 | ||
594 | 912 | @ini_set('user_agent', $_extConf['useragent']); | 952 | @ini_set('user_agent', $extConf['useragent']); |
595 | 913 | 953 | ||
596 | 914 | } | 954 | } |
597 | 915 | 955 | ||
609 | 916 | // Load XML from file... | 956 | // Turn off libxml's error logging. |
610 | 917 | $_libxmlErrors = libxml_use_internal_errors(TRUE); | 957 | $libxmlErrors = libxml_use_internal_errors(TRUE); |
611 | 918 | 958 | ||
612 | 919 | $_xml = @simplexml_load_file($location); | 959 | // Load XML from file. |
613 | 920 | 960 | $xml = @simplexml_load_file($location); | |
614 | 921 | libxml_use_internal_errors($_libxmlErrors); | 961 | |
615 | 922 | 962 | // Reset libxml's error logging. | |
616 | 923 | // ...and set some basic properties. | 963 | libxml_use_internal_errors($libxmlErrors); |
617 | 924 | if ($_xml !== FALSE) { | 964 | |
618 | 925 | 965 | // Set some basic properties. | |
619 | 926 | $this->xml = $_xml; | 966 | if ($xml !== FALSE) { |
620 | 967 | |||
621 | 968 | $this->xml = $xml; | ||
622 | 927 | 969 | ||
623 | 928 | return TRUE; | 970 | return TRUE; |
624 | 929 | 971 | ||
625 | 930 | } else { | 972 | } else { |
626 | 931 | 973 | ||
629 | 932 | trigger_error('Could not load XML file from '.$location, E_USER_ERROR); | 974 | if (TYPO3_DLOG) { |
630 | 933 | // TODO: libxml_get_errors() || libxml_get_last_error() || libxml_clear_errors() | 975 | |
631 | 976 | t3lib_div::devLog('[tx_dlf_document->load('.$location.')] Could not load XML file from "'.$location.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
632 | 977 | |||
633 | 978 | } | ||
634 | 934 | 979 | ||
635 | 935 | } | 980 | } |
636 | 936 | 981 | ||
637 | 937 | } else { | 982 | } else { |
638 | 938 | 983 | ||
640 | 939 | trigger_error('File location "'.$location.'" is not a valid URL', E_USER_ERROR); | 984 | if (TYPO3_DLOG) { |
641 | 985 | |||
642 | 986 | t3lib_div::devLog('[tx_dlf_document->load('.$location.')] Invalid file location "'.$location.'" for document loading', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
643 | 987 | |||
644 | 988 | } | ||
645 | 940 | 989 | ||
646 | 941 | } | 990 | } |
647 | 942 | 991 | ||
648 | @@ -956,8 +1005,8 @@ | |||
649 | 956 | if (!$this->formatsLoaded) { | 1005 | if (!$this->formatsLoaded) { |
650 | 957 | 1006 | ||
651 | 958 | // Get available data formats from database. | 1007 | // Get available data formats from database. |
654 | 959 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 1008 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
655 | 960 | 'tx_dlf_formats.type AS type,tx_dlf_formats.other_type AS other_type,tx_dlf_formats.root AS root,tx_dlf_formats.namespace AS namespace,tx_dlf_formats.class AS class', | 1009 | 'tx_dlf_formats.type AS type,tx_dlf_formats.root AS root,tx_dlf_formats.namespace AS namespace,tx_dlf_formats.class AS class', |
656 | 961 | 'tx_dlf_formats', | 1010 | 'tx_dlf_formats', |
657 | 962 | 'tx_dlf_formats.pid=0'.tx_dlf_helper::whereClause('tx_dlf_formats'), | 1011 | 'tx_dlf_formats.pid=0'.tx_dlf_helper::whereClause('tx_dlf_formats'), |
658 | 963 | '', | 1012 | '', |
659 | @@ -965,27 +1014,14 @@ | |||
660 | 965 | '' | 1014 | '' |
661 | 966 | ); | 1015 | ); |
662 | 967 | 1016 | ||
684 | 968 | while ($_resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { | 1017 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
685 | 969 | 1018 | ||
686 | 970 | if (!$_resArray['other_type']) { | 1019 | // Update format registry. |
687 | 971 | 1020 | $this->formats[$resArray['type']] = array ( | |
688 | 972 | // Update format registry. | 1021 | 'rootElement' => $resArray['root'], |
689 | 973 | $this->formats[$_resArray['type']] = array ( | 1022 | 'namespaceURI' => $resArray['namespace'], |
690 | 974 | 'rootElement' => $_resArray['root'], | 1023 | 'class' => $resArray['class'] |
691 | 975 | 'namespaceURI' => $_resArray['namespace'], | 1024 | ); |
671 | 976 | 'class' => $_resArray['class'] | ||
672 | 977 | ); | ||
673 | 978 | |||
674 | 979 | } else { | ||
675 | 980 | |||
676 | 981 | // Update format registry. | ||
677 | 982 | $this->formats['OTHER'][$_resArray['type']] = array ( | ||
678 | 983 | 'rootElement' => $_resArray['root'], | ||
679 | 984 | 'namespaceURI' => $_resArray['namespace'], | ||
680 | 985 | 'class' => $_resArray['class'] | ||
681 | 986 | ); | ||
682 | 987 | |||
683 | 988 | } | ||
692 | 989 | 1025 | ||
693 | 990 | } | 1026 | } |
694 | 991 | 1027 | ||
695 | @@ -1011,43 +1047,28 @@ | |||
696 | 1011 | // Do we have a SimpleXMLElement or DOMXPath object? | 1047 | // Do we have a SimpleXMLElement or DOMXPath object? |
697 | 1012 | if ($obj instanceof SimpleXMLElement) { | 1048 | if ($obj instanceof SimpleXMLElement) { |
698 | 1013 | 1049 | ||
700 | 1014 | $_method = 'registerXPathNamespace'; | 1050 | $method = 'registerXPathNamespace'; |
701 | 1015 | 1051 | ||
702 | 1016 | } elseif ($obj instanceof DOMXPath) { | 1052 | } elseif ($obj instanceof DOMXPath) { |
703 | 1017 | 1053 | ||
705 | 1018 | $_method = 'registerNamespace'; | 1054 | $method = 'registerNamespace'; |
706 | 1019 | 1055 | ||
707 | 1020 | } else { | 1056 | } else { |
708 | 1021 | 1057 | ||
710 | 1022 | trigger_error('No SimpleXMLElement or DOMXPath object given', E_USER_WARNING); | 1058 | if (TYPO3_DLOG) { |
711 | 1059 | |||
712 | 1060 | t3lib_div::devLog('[tx_dlf_document->registerNamespaces(['.get_class($obj).'])] Given object is neither a SimpleXMLElement nor a DOMXPath instance', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
713 | 1061 | |||
714 | 1062 | } | ||
715 | 1023 | 1063 | ||
716 | 1024 | return; | 1064 | return; |
717 | 1025 | 1065 | ||
718 | 1026 | } | 1066 | } |
719 | 1027 | 1067 | ||
720 | 1028 | // Register mandatory METS' and XLINK's namespaces. | ||
721 | 1029 | $obj->$_method('mets', 'http://www.loc.gov/METS/'); | ||
722 | 1030 | |||
723 | 1031 | // This one can become a problem, because MODS uses its own custom XLINK schema. | ||
724 | 1032 | // @see http://comments.gmane.org/gmane.comp.text.mods/1126 | ||
725 | 1033 | $obj->$_method('xlink', 'http://www.w3.org/1999/xlink'); | ||
726 | 1034 | |||
727 | 1035 | // Register metadata format's namespaces. | 1068 | // Register metadata format's namespaces. |
728 | 1036 | foreach ($this->formats as $enc => $conf) { | 1069 | foreach ($this->formats as $enc => $conf) { |
729 | 1037 | 1070 | ||
743 | 1038 | if ($enc != 'OTHER') { | 1071 | $obj->$method(strtolower($enc), $conf['namespaceURI']); |
731 | 1039 | |||
732 | 1040 | $obj->$_method(strtolower($enc), $conf['namespaceURI']); | ||
733 | 1041 | |||
734 | 1042 | } else { | ||
735 | 1043 | |||
736 | 1044 | foreach ($conf as $otherEnc => $otherConf) { | ||
737 | 1045 | |||
738 | 1046 | $obj->$_method(strtolower($otherEnc), $otherConf['namespaceURI']); | ||
739 | 1047 | |||
740 | 1048 | } | ||
741 | 1049 | |||
742 | 1050 | } | ||
744 | 1051 | 1072 | ||
745 | 1052 | } | 1073 | } |
746 | 1053 | 1074 | ||
747 | @@ -1065,9 +1086,18 @@ | |||
748 | 1065 | */ | 1086 | */ |
749 | 1066 | public function save($pid = 0, $core = 0) { | 1087 | public function save($pid = 0, $core = 0) { |
750 | 1067 | 1088 | ||
751 | 1089 | // Save parameters for logging purposes. | ||
752 | 1090 | $_pid = $pid; | ||
753 | 1091 | |||
754 | 1092 | $_core = $core; | ||
755 | 1093 | |||
756 | 1068 | if (TYPO3_MODE !== 'BE') { | 1094 | if (TYPO3_MODE !== 'BE') { |
757 | 1069 | 1095 | ||
759 | 1070 | trigger_error('Saving documents is only allowed in the backend!', E_USER_ERROR); | 1096 | if (TYPO3_DLOG) { |
760 | 1097 | |||
761 | 1098 | t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] Saving a document is only allowed in the backend', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
762 | 1099 | |||
763 | 1100 | } | ||
764 | 1071 | 1101 | ||
765 | 1072 | return FALSE; | 1102 | return FALSE; |
766 | 1073 | 1103 | ||
767 | @@ -1087,7 +1117,11 @@ | |||
768 | 1087 | 1117 | ||
769 | 1088 | } elseif (!$pid) { | 1118 | } elseif (!$pid) { |
770 | 1089 | 1119 | ||
772 | 1090 | trigger_error('Invalid PID ('.$pid.') given to save document', E_USER_WARNING); | 1120 | if (TYPO3_DLOG) { |
773 | 1121 | |||
774 | 1122 | t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] Invalid PID "'.$pid.'" for document saving', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
775 | 1123 | |||
776 | 1124 | } | ||
777 | 1091 | 1125 | ||
778 | 1092 | return FALSE; | 1126 | return FALSE; |
779 | 1093 | 1127 | ||
780 | @@ -1118,7 +1152,11 @@ | |||
781 | 1118 | // Check for record identifier. | 1152 | // Check for record identifier. |
782 | 1119 | if (empty($metadata['record_id'][0])) { | 1153 | if (empty($metadata['record_id'][0])) { |
783 | 1120 | 1154 | ||
785 | 1121 | trigger_error('No record identifier found to avoid duplication', E_USER_WARNING); | 1155 | if (TYPO3_DLOG) { |
786 | 1156 | |||
787 | 1157 | t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] No record identifier found to avoid duplication', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
788 | 1158 | |||
789 | 1159 | } | ||
790 | 1122 | 1160 | ||
791 | 1123 | return FALSE; | 1161 | return FALSE; |
792 | 1124 | 1162 | ||
793 | @@ -1142,7 +1180,11 @@ | |||
794 | 1142 | 1180 | ||
795 | 1143 | } else { | 1181 | } else { |
796 | 1144 | 1182 | ||
798 | 1145 | trigger_error('Could not identify structure type', E_USER_ERROR); | 1183 | if (TYPO3_DLOG) { |
799 | 1184 | |||
800 | 1185 | t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] Could not identify document/structure type', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
801 | 1186 | |||
802 | 1187 | } | ||
803 | 1146 | 1188 | ||
804 | 1147 | return FALSE; | 1189 | return FALSE; |
805 | 1148 | 1190 | ||
806 | @@ -1166,23 +1208,23 @@ | |||
807 | 1166 | 1208 | ||
808 | 1167 | $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); | 1209 | $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
809 | 1168 | 1210 | ||
811 | 1169 | $_collUid[$resArray['index_name']] = $resArray['uid']; | 1211 | $collUid[$resArray['index_name']] = $resArray['uid']; |
812 | 1170 | 1212 | ||
813 | 1171 | } | 1213 | } |
814 | 1172 | 1214 | ||
815 | 1173 | foreach ($metadata['collection'] as $collection) { | 1215 | foreach ($metadata['collection'] as $collection) { |
816 | 1174 | 1216 | ||
818 | 1175 | if (!empty($_collUid[$collection])) { | 1217 | if (!empty($collUid[$collection])) { |
819 | 1176 | 1218 | ||
820 | 1177 | // Add existing collection's UID. | 1219 | // Add existing collection's UID. |
822 | 1178 | $collections[] = $_collUid[$collection]; | 1220 | $collections[] = $collUid[$collection]; |
823 | 1179 | 1221 | ||
824 | 1180 | } else { | 1222 | } else { |
825 | 1181 | 1223 | ||
826 | 1182 | // Insert new collection. | 1224 | // Insert new collection. |
828 | 1183 | $_collNewUid = uniqid('NEW'); | 1225 | $collNewUid = uniqid('NEW'); |
829 | 1184 | 1226 | ||
831 | 1185 | $_collData['tx_dlf_collections'][$_collNewUid] = array ( | 1227 | $collData['tx_dlf_collections'][$collNewUid] = array ( |
832 | 1186 | 'pid' => $pid, | 1228 | 'pid' => $pid, |
833 | 1187 | 'label' => $collection, | 1229 | 'label' => $collection, |
834 | 1188 | 'index_name' => $collection, | 1230 | 'index_name' => $collection, |
835 | @@ -1193,23 +1235,23 @@ | |||
836 | 1193 | 'status' => 0, | 1235 | 'status' => 0, |
837 | 1194 | ); | 1236 | ); |
838 | 1195 | 1237 | ||
840 | 1196 | $_substUid = tx_dlf_helper::processDB($_collData); | 1238 | $substUid = tx_dlf_helper::processDB($collData); |
841 | 1197 | 1239 | ||
842 | 1198 | // Prevent double insertion. | 1240 | // Prevent double insertion. |
844 | 1199 | unset ($_collData); | 1241 | unset ($collData); |
845 | 1200 | 1242 | ||
846 | 1201 | // Add new collection's UID. | 1243 | // Add new collection's UID. |
848 | 1202 | $collections[] = $_substUid[$_collNewUid]; | 1244 | $collections[] = $substUid[$collNewUid]; |
849 | 1203 | 1245 | ||
851 | 1204 | $_message = t3lib_div::makeInstance( | 1246 | $message = t3lib_div::makeInstance( |
852 | 1205 | 't3lib_FlashMessage', | 1247 | 't3lib_FlashMessage', |
854 | 1206 | htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.newCollection'), $collection, $_substUid[$_collNewUid])), | 1248 | htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.newCollection'), $collection, $substUid[$collNewUid])), |
855 | 1207 | $GLOBALS['LANG']->getLL('flash.attention', TRUE), | 1249 | $GLOBALS['LANG']->getLL('flash.attention', TRUE), |
856 | 1208 | t3lib_FlashMessage::INFO, | 1250 | t3lib_FlashMessage::INFO, |
857 | 1209 | TRUE | 1251 | TRUE |
858 | 1210 | ); | 1252 | ); |
859 | 1211 | 1253 | ||
861 | 1212 | t3lib_FlashMessageQueue::addMessage($_message); | 1254 | t3lib_FlashMessageQueue::addMessage($message); |
862 | 1213 | 1255 | ||
863 | 1214 | } | 1256 | } |
864 | 1215 | 1257 | ||
865 | @@ -1254,9 +1296,9 @@ | |||
866 | 1254 | } else { | 1296 | } else { |
867 | 1255 | 1297 | ||
868 | 1256 | // Insert new library. | 1298 | // Insert new library. |
870 | 1257 | $_libNewUid = uniqid('NEW'); | 1299 | $libNewUid = uniqid('NEW'); |
871 | 1258 | 1300 | ||
873 | 1259 | $_libData['tx_dlf_libraries'][$_libNewUid] = array ( | 1301 | $libData['tx_dlf_libraries'][$libNewUid] = array ( |
874 | 1260 | 'pid' => $pid, | 1302 | 'pid' => $pid, |
875 | 1261 | 'label' => $metadata['owner'][0], | 1303 | 'label' => $metadata['owner'][0], |
876 | 1262 | 'index_name' => $metadata['owner'][0], | 1304 | 'index_name' => $metadata['owner'][0], |
877 | @@ -1271,20 +1313,20 @@ | |||
878 | 1271 | 'union_base' => '', | 1313 | 'union_base' => '', |
879 | 1272 | ); | 1314 | ); |
880 | 1273 | 1315 | ||
882 | 1274 | $_substUid = tx_dlf_helper::processDB($_libData); | 1316 | $substUid = tx_dlf_helper::processDB($libData); |
883 | 1275 | 1317 | ||
884 | 1276 | // Add new library's UID. | 1318 | // Add new library's UID. |
886 | 1277 | $owner = $_substUid[$_libNewUid]; | 1319 | $owner = $substUid[$libNewUid]; |
887 | 1278 | 1320 | ||
889 | 1279 | $_message = t3lib_div::makeInstance( | 1321 | $message = t3lib_div::makeInstance( |
890 | 1280 | 't3lib_FlashMessage', | 1322 | 't3lib_FlashMessage', |
892 | 1281 | htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.newLibrary'), $metadata['owner'][0], $_substUid[$_libNewUid])), | 1323 | htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.newLibrary'), $metadata['owner'][0], $substUid[$libNewUid])), |
893 | 1282 | $GLOBALS['LANG']->getLL('flash.attention', TRUE), | 1324 | $GLOBALS['LANG']->getLL('flash.attention', TRUE), |
894 | 1283 | t3lib_FlashMessage::INFO, | 1325 | t3lib_FlashMessage::INFO, |
895 | 1284 | TRUE | 1326 | TRUE |
896 | 1285 | ); | 1327 | ); |
897 | 1286 | 1328 | ||
899 | 1287 | t3lib_FlashMessageQueue::addMessage($_message); | 1329 | t3lib_FlashMessageQueue::addMessage($message); |
900 | 1288 | 1330 | ||
901 | 1289 | } | 1331 | } |
902 | 1290 | 1332 | ||
903 | @@ -1401,7 +1443,11 @@ | |||
904 | 1401 | 1443 | ||
905 | 1402 | } else { | 1444 | } else { |
906 | 1403 | 1445 | ||
908 | 1404 | trigger_error('Invalid UID for Solr core ('.$core.') given to index document', E_USER_NOTICE); | 1446 | if (TYPO3_DLOG) { |
909 | 1447 | |||
910 | 1448 | t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] Invalid UID "'.$core.'" for Solr core', $this->extKey, SYSLOG_SEVERITY_NOTICE); | ||
911 | 1449 | |||
912 | 1450 | } | ||
913 | 1405 | 1451 | ||
914 | 1406 | } | 1452 | } |
915 | 1407 | 1453 | ||
916 | @@ -1437,49 +1483,39 @@ | |||
917 | 1437 | $this->loadFormats(); | 1483 | $this->loadFormats(); |
918 | 1438 | 1484 | ||
919 | 1439 | // Get dmdSec nodes from METS. | 1485 | // Get dmdSec nodes from METS. |
963 | 1440 | $_dmdIds = $this->mets->xpath('./mets:dmdSec/@ID'); | 1486 | $dmdIds = $this->mets->xpath('./mets:dmdSec/@ID'); |
964 | 1441 | 1487 | ||
965 | 1442 | foreach ($_dmdIds as $_dmdId) { | 1488 | foreach ($dmdIds as $dmdId) { |
966 | 1443 | 1489 | ||
967 | 1444 | $_type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $_dmdId.'"]/mets:mdWrap/@MDTYPE'); | 1490 | if ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) { |
968 | 1445 | 1491 | ||
969 | 1446 | if ($_type && !empty($this->formats[(string) $_type[0]]) && $_type[0] != 'OTHER') { | 1492 | if (!empty($this->formats[(string) $type[0]])) { |
970 | 1447 | 1493 | ||
971 | 1448 | $_type = (string) $_type[0]; | 1494 | $type = (string) $type[0]; |
972 | 1449 | 1495 | ||
973 | 1450 | $_xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $_dmdId.'"]/mets:mdWrap[@MDTYPE="'.$_type.'"]/mets:xmlData/'.strtolower($_type).':'.$this->formats[$_type]['rootElement']); | 1496 | $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
974 | 1451 | 1497 | ||
975 | 1452 | if ($_xml) { | 1498 | } |
976 | 1453 | 1499 | ||
977 | 1454 | $this->dmdSec[(string) $_dmdId]['type'] = $_type; | 1500 | } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) { |
978 | 1455 | 1501 | ||
979 | 1456 | $this->dmdSec[(string) $_dmdId]['xml'] = $_xml[0]; | 1502 | if (!empty($this->formats[(string) $type[0]])) { |
980 | 1457 | 1503 | ||
981 | 1458 | $this->registerNamespaces($this->dmdSec[(string) $_dmdId]['xml']); | 1504 | $type = (string) $type[0]; |
982 | 1459 | 1505 | ||
983 | 1460 | } | 1506 | $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']); |
984 | 1461 | 1507 | ||
985 | 1462 | } elseif ($_type && $_type[0] == 'OTHER') { | 1508 | } |
986 | 1463 | 1509 | ||
987 | 1464 | $_otherType = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $_dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE'); | 1510 | } |
988 | 1465 | 1511 | ||
989 | 1466 | if ($_otherType && !empty($this->formats['OTHER'][(string) $_otherType[0]])) { | 1512 | if ($xml) { |
990 | 1467 | 1513 | ||
991 | 1468 | $_otherType = (string) $_otherType[0]; | 1514 | $this->dmdSec[(string) $dmdId]['type'] = $type; |
992 | 1469 | 1515 | ||
993 | 1470 | $_xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $_dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$_otherType.'"]/mets:xmlData/'.strtolower($_otherType).':'.$this->formats['OTHER'][$_otherType]['rootElement']); | 1516 | $this->dmdSec[(string) $dmdId]['xml'] = $xml[0]; |
994 | 1471 | 1517 | ||
995 | 1472 | if ($_xml) { | 1518 | $this->registerNamespaces($this->dmdSec[(string) $dmdId]['xml']); |
953 | 1473 | |||
954 | 1474 | $this->dmdSec[(string) $_dmdId]['type'] = $_otherType; | ||
955 | 1475 | |||
956 | 1476 | $this->dmdSec[(string) $_dmdId]['xml'] = $_xml[0]; | ||
957 | 1477 | |||
958 | 1478 | $this->registerNamespaces($this->dmdSec[(string) $_dmdId]['xml']); | ||
959 | 1479 | |||
960 | 1480 | } | ||
961 | 1481 | |||
962 | 1482 | } | ||
996 | 1483 | 1519 | ||
997 | 1484 | } | 1520 | } |
998 | 1485 | 1521 | ||
999 | @@ -1507,7 +1543,11 @@ | |||
1000 | 1507 | 1543 | ||
1001 | 1508 | if (!$cPid) { | 1544 | if (!$cPid) { |
1002 | 1509 | 1545 | ||
1004 | 1510 | trigger_error('No PID for metadata definitions found', E_USER_ERROR); | 1546 | if (TYPO3_DLOG) { |
1005 | 1547 | |||
1006 | 1548 | t3lib_div::devLog('[tx_dlf_document->getMetadataArray()] Invalid PID "'.$cPid.'" for metadata definitions', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1007 | 1549 | |||
1008 | 1550 | } | ||
1009 | 1511 | 1551 | ||
1010 | 1512 | return array (); | 1552 | return array (); |
1011 | 1513 | 1553 | ||
1012 | @@ -1516,11 +1556,11 @@ | |||
1013 | 1516 | if (!$this->metadataArrayLoaded || $this->metadataArray[0] != $cPid) { | 1556 | if (!$this->metadataArrayLoaded || $this->metadataArray[0] != $cPid) { |
1014 | 1517 | 1557 | ||
1015 | 1518 | // Get all logical structure nodes with metadata | 1558 | // Get all logical structure nodes with metadata |
1021 | 1519 | if (($_ids = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]/@ID'))) { | 1559 | if (($ids = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]/@ID'))) { |
1022 | 1520 | 1560 | ||
1023 | 1521 | foreach ($_ids as $_id) { | 1561 | foreach ($ids as $id) { |
1024 | 1522 | 1562 | ||
1025 | 1523 | $this->metadataArray[(string) $_id] = $this->getMetadata((string) $_id, $cPid); | 1563 | $this->metadataArray[(string) $id] = $this->getMetadata((string) $id, $cPid); |
1026 | 1524 | 1564 | ||
1027 | 1525 | } | 1565 | } |
1028 | 1526 | 1566 | ||
1029 | @@ -1591,26 +1631,26 @@ | |||
1030 | 1591 | if (!$this->physicalPagesLoaded) { | 1631 | if (!$this->physicalPagesLoaded) { |
1031 | 1592 | 1632 | ||
1032 | 1593 | // Does the document have a structMap node of type "PHYSICAL"? | 1633 | // Does the document have a structMap node of type "PHYSICAL"? |
1034 | 1594 | $_pageNodes = $this->mets->xpath('./mets:structMap[@TYPE="PHYSICAL"]/mets:div[@TYPE="physSequence"]/mets:div[@TYPE="page"]'); | 1634 | $pageNodes = $this->mets->xpath('./mets:structMap[@TYPE="PHYSICAL"]/mets:div[@TYPE="physSequence"]/mets:div[@TYPE="page"]'); |
1035 | 1595 | 1635 | ||
1037 | 1596 | if ($_pageNodes) { | 1636 | if ($pageNodes) { |
1038 | 1597 | 1637 | ||
1039 | 1598 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]); | 1638 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]); |
1040 | 1599 | 1639 | ||
1042 | 1600 | $_useGrps = t3lib_div::trimExplode(',', $extConf['fileGrps']); | 1640 | $useGrps = t3lib_div::trimExplode(',', $extConf['fileGrps']); |
1043 | 1601 | 1641 | ||
1044 | 1602 | // Yes. Get concordance of @FILEID and @USE attributes. | 1642 | // Yes. Get concordance of @FILEID and @USE attributes. |
1056 | 1603 | $_fileUse = array (); | 1643 | $fileUse = array (); |
1057 | 1604 | 1644 | ||
1058 | 1605 | $_fileGrps = $this->mets->xpath('./mets:fileSec/mets:fileGrp'); | 1645 | $fileGrps = $this->mets->xpath('./mets:fileSec/mets:fileGrp'); |
1059 | 1606 | 1646 | ||
1060 | 1607 | foreach ($_fileGrps as $_fileGrp) { | 1647 | foreach ($fileGrps as $fileGrp) { |
1061 | 1608 | 1648 | ||
1062 | 1609 | if (in_array((string) $_fileGrp['USE'], $_useGrps)) { | 1649 | if (in_array((string) $fileGrp['USE'], $useGrps)) { |
1063 | 1610 | 1650 | ||
1064 | 1611 | foreach ($_fileGrp->children('http://www.loc.gov/METS/')->file as $_file) { | 1651 | foreach ($fileGrp->children('http://www.loc.gov/METS/')->file as $file) { |
1065 | 1612 | 1652 | ||
1066 | 1613 | $_fileUse[(string) $_file->attributes()->ID] = (string) $_fileGrp['USE']; | 1653 | $fileUse[(string) $file->attributes()->ID] = (string) $fileGrp['USE']; |
1067 | 1614 | 1654 | ||
1068 | 1615 | } | 1655 | } |
1069 | 1616 | 1656 | ||
1070 | @@ -1619,46 +1659,46 @@ | |||
1071 | 1619 | } | 1659 | } |
1072 | 1620 | 1660 | ||
1073 | 1621 | // Get the physical sequence's metadata. | 1661 | // Get the physical sequence's metadata. |
1083 | 1622 | $_physNode = $this->mets->xpath('./mets:structMap[@TYPE="PHYSICAL"]/mets:div[@TYPE="physSequence"]'); | 1662 | $physNode = $this->mets->xpath('./mets:structMap[@TYPE="PHYSICAL"]/mets:div[@TYPE="physSequence"]'); |
1084 | 1623 | 1663 | ||
1085 | 1624 | $_physSeq[0] = (string) $_physNode[0]['ID']; | 1664 | $physSeq[0] = (string) $physNode[0]['ID']; |
1086 | 1625 | 1665 | ||
1087 | 1626 | $this->physicalPagesInfo[$_physSeq[0]]['dmdId'] = (isset($_physNode[0]['DMDID']) ? (string) $_physNode[0]['DMDID'] : ''); | 1666 | $this->physicalPagesInfo[$physSeq[0]]['dmdId'] = (isset($physNode[0]['DMDID']) ? (string) $physNode[0]['DMDID'] : ''); |
1088 | 1627 | 1667 | ||
1089 | 1628 | $this->physicalPagesInfo[$_physSeq[0]]['label'] = (isset($_physNode[0]['ORDERLABEL']) ? (string) $_physNode[0]['ORDERLABEL'] : ''); | 1668 | $this->physicalPagesInfo[$physSeq[0]]['label'] = (isset($physNode[0]['ORDERLABEL']) ? (string) $physNode[0]['ORDERLABEL'] : ''); |
1090 | 1629 | 1669 | ||
1091 | 1630 | $this->physicalPagesInfo[$_physSeq[0]]['type'] = (string) $_physNode[0]['TYPE']; | 1670 | $this->physicalPagesInfo[$physSeq[0]]['type'] = (string) $physNode[0]['TYPE']; |
1092 | 1631 | 1671 | ||
1093 | 1632 | // Get the file representations from fileSec node. | 1672 | // Get the file representations from fileSec node. |
1095 | 1633 | foreach ($_physNode[0]->children('http://www.loc.gov/METS/')->fptr as $_fptr) { | 1673 | foreach ($physNode[0]->children('http://www.loc.gov/METS/')->fptr as $fptr) { |
1096 | 1634 | 1674 | ||
1097 | 1635 | // Check if file has valid @USE attribute. | 1675 | // Check if file has valid @USE attribute. |
1099 | 1636 | if (!empty($_fileUse[(string) $_fptr->attributes()->FILEID])) { | 1676 | if (!empty($fileUse[(string) $fptr->attributes()->FILEID])) { |
1100 | 1637 | 1677 | ||
1102 | 1638 | $this->physicalPagesInfo[$_physSeq[0]]['files'][strtolower($_fileUse[(string) $_fptr->attributes()->FILEID])] = (string) $_fptr->attributes()->FILEID; | 1678 | $this->physicalPagesInfo[$physSeq[0]]['files'][strtolower($fileUse[(string) $fptr->attributes()->FILEID])] = (string) $fptr->attributes()->FILEID; |
1103 | 1639 | 1679 | ||
1104 | 1640 | } | 1680 | } |
1105 | 1641 | 1681 | ||
1106 | 1642 | } | 1682 | } |
1107 | 1643 | 1683 | ||
1108 | 1644 | // Build the physical pages' array from the physical structMap node. | 1684 | // Build the physical pages' array from the physical structMap node. |
1118 | 1645 | foreach ($_pageNodes as $_pageNode) { | 1685 | foreach ($pageNodes as $pageNode) { |
1119 | 1646 | 1686 | ||
1120 | 1647 | $_pages[(int) $_pageNode['ORDER']] = (string) $_pageNode['ID']; | 1687 | $pages[(int) $pageNode['ORDER']] = (string) $pageNode['ID']; |
1121 | 1648 | 1688 | ||
1122 | 1649 | $this->physicalPagesInfo[$_pages[(int) $_pageNode['ORDER']]]['dmdId'] = (isset($_pageNode['DMDID']) ? (string) $_pageNode['DMDID'] : ''); | 1689 | $this->physicalPagesInfo[$pages[(int) $pageNode['ORDER']]]['dmdId'] = (isset($pageNode['DMDID']) ? (string) $pageNode['DMDID'] : ''); |
1123 | 1650 | 1690 | ||
1124 | 1651 | $this->physicalPagesInfo[$_pages[(int) $_pageNode['ORDER']]]['label'] = (isset($_pageNode['ORDERLABEL']) ? (string) $_pageNode['ORDERLABEL'] : ''); | 1691 | $this->physicalPagesInfo[$pages[(int) $pageNode['ORDER']]]['label'] = (isset($pageNode['ORDERLABEL']) ? (string) $pageNode['ORDERLABEL'] : ''); |
1125 | 1652 | 1692 | ||
1126 | 1653 | $this->physicalPagesInfo[$_pages[(int) $_pageNode['ORDER']]]['type'] = (string) $_pageNode['TYPE']; | 1693 | $this->physicalPagesInfo[$pages[(int) $pageNode['ORDER']]]['type'] = (string) $pageNode['TYPE']; |
1127 | 1654 | 1694 | ||
1128 | 1655 | // Get the file representations from fileSec node. | 1695 | // Get the file representations from fileSec node. |
1130 | 1656 | foreach ($_pageNode->children('http://www.loc.gov/METS/')->fptr as $_fptr) { | 1696 | foreach ($pageNode->children('http://www.loc.gov/METS/')->fptr as $fptr) { |
1131 | 1657 | 1697 | ||
1132 | 1658 | // Check if file has valid @USE attribute. | 1698 | // Check if file has valid @USE attribute. |
1134 | 1659 | if (!empty($_fileUse[(string) $_fptr->attributes()->FILEID])) { | 1699 | if (!empty($fileUse[(string) $fptr->attributes()->FILEID])) { |
1135 | 1660 | 1700 | ||
1137 | 1661 | $this->physicalPagesInfo[$_pages[(int) $_pageNode['ORDER']]]['files'][strtolower($_fileUse[(string) $_fptr->attributes()->FILEID])] = (string) $_fptr->attributes()->FILEID; | 1701 | $this->physicalPagesInfo[$pages[(int) $pageNode['ORDER']]]['files'][strtolower($fileUse[(string) $fptr->attributes()->FILEID])] = (string) $fptr->attributes()->FILEID; |
1138 | 1662 | 1702 | ||
1139 | 1663 | } | 1703 | } |
1140 | 1664 | 1704 | ||
1141 | @@ -1667,13 +1707,13 @@ | |||
1142 | 1667 | } | 1707 | } |
1143 | 1668 | 1708 | ||
1144 | 1669 | // Sort array by keys (= @ORDER). | 1709 | // Sort array by keys (= @ORDER). |
1146 | 1670 | if (ksort($_pages)) { | 1710 | if (ksort($pages)) { |
1147 | 1671 | 1711 | ||
1148 | 1672 | // Set total number of pages. | 1712 | // Set total number of pages. |
1150 | 1673 | $this->numPages = count($_pages); | 1713 | $this->numPages = count($pages); |
1151 | 1674 | 1714 | ||
1152 | 1675 | // Merge and re-index the array to get nice numeric indexes. | 1715 | // Merge and re-index the array to get nice numeric indexes. |
1154 | 1676 | $this->physicalPages = array_merge($_physSeq, $_pages); | 1716 | $this->physicalPages = array_merge($physSeq, $pages); |
1155 | 1677 | 1717 | ||
1156 | 1678 | } | 1718 | } |
1157 | 1679 | 1719 | ||
1158 | @@ -1905,22 +1945,25 @@ | |||
1159 | 1905 | // Cast to string for safety reasons. | 1945 | // Cast to string for safety reasons. |
1160 | 1906 | $location = (string) $uid; | 1946 | $location = (string) $uid; |
1161 | 1907 | 1947 | ||
1164 | 1908 | // Get record identifier to check with database. | 1948 | // Turn off libxml's error logging. |
1165 | 1909 | $_libxmlErrors = libxml_use_internal_errors(TRUE); | 1949 | $libxmlErrors = libxml_use_internal_errors(TRUE); |
1166 | 1910 | 1950 | ||
1167 | 1951 | // Load XML file. | ||
1168 | 1911 | $xml = @simplexml_load_file($location); | 1952 | $xml = @simplexml_load_file($location); |
1169 | 1912 | 1953 | ||
1171 | 1913 | libxml_use_internal_errors($_libxmlErrors); | 1954 | // Reset libxml's error logging. |
1172 | 1955 | libxml_use_internal_errors($libxmlErrors); | ||
1173 | 1914 | 1956 | ||
1174 | 1915 | if ($xml !== FALSE) { | 1957 | if ($xml !== FALSE) { |
1175 | 1916 | 1958 | ||
1176 | 1917 | $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/'); | 1959 | $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/'); |
1177 | 1918 | 1960 | ||
1183 | 1919 | $_objId = $xml->xpath('//mets:mets'); | 1961 | // Check for @OBJID in order to use it as record identifier. |
1184 | 1920 | 1962 | $objId = $xml->xpath('//mets:mets'); | |
1185 | 1921 | if (!empty($_objId[0]['OBJID'])) { | 1963 | |
1186 | 1922 | 1964 | if (!empty($objId[0]['OBJID'])) { | |
1187 | 1923 | $this->recordid = (string) $_objId[0]['OBJID']; | 1965 | |
1188 | 1966 | $this->recordid = (string) $objId[0]['OBJID']; | ||
1189 | 1924 | 1967 | ||
1190 | 1925 | } | 1968 | } |
1191 | 1926 | 1969 | ||
1192 | @@ -1955,12 +1998,12 @@ | |||
1193 | 1955 | // Check for PID if needed. | 1998 | // Check for PID if needed. |
1194 | 1956 | if ($pid) { | 1999 | if ($pid) { |
1195 | 1957 | 2000 | ||
1197 | 1958 | $whereClause .= ' AND tx_dlf_documents.pid='.$pid; | 2001 | $whereClause .= ' AND tx_dlf_documents.pid='.intval($pid); |
1198 | 1959 | 2002 | ||
1199 | 1960 | } | 2003 | } |
1200 | 1961 | 2004 | ||
1201 | 1962 | // Get document PID and location from database. | 2005 | // Get document PID and location from database. |
1203 | 1963 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 2006 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
1204 | 1964 | 'tx_dlf_documents.uid AS uid,tx_dlf_documents.pid AS pid,tx_dlf_documents.record_id AS record_id,tx_dlf_documents.partof AS partof,tx_dlf_documents.location AS location', | 2007 | 'tx_dlf_documents.uid AS uid,tx_dlf_documents.pid AS pid,tx_dlf_documents.record_id AS record_id,tx_dlf_documents.partof AS partof,tx_dlf_documents.location AS location', |
1205 | 1965 | 'tx_dlf_documents', | 2008 | 'tx_dlf_documents', |
1206 | 1966 | $whereClause, | 2009 | $whereClause, |
1207 | @@ -1969,9 +2012,9 @@ | |||
1208 | 1969 | '1' | 2012 | '1' |
1209 | 1970 | ); | 2013 | ); |
1210 | 1971 | 2014 | ||
1212 | 1972 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) { | 2015 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { |
1213 | 1973 | 2016 | ||
1215 | 1974 | list ($this->uid, $this->pid, $this->recordid, $this->parentid, $location) = $GLOBALS['TYPO3_DB']->sql_fetch_row($_result); | 2017 | list ($this->uid, $this->pid, $this->recordid, $this->parentid, $location) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result); |
1216 | 1975 | 2018 | ||
1217 | 1976 | // Load XML file... | 2019 | // Load XML file... |
1218 | 1977 | if ($this->load($location)) { | 2020 | if ($this->load($location)) { |
1219 | @@ -1995,7 +2038,11 @@ | |||
1220 | 1995 | 2038 | ||
1221 | 1996 | } else { | 2039 | } else { |
1222 | 1997 | 2040 | ||
1224 | 1998 | trigger_error('There is no record with UID '.$uid.' or you are not allowed to access it', E_USER_ERROR); | 2041 | if (TYPO3_DLOG) { |
1225 | 2042 | |||
1226 | 2043 | t3lib_div::devLog('[tx_dlf_document->__construct('.$uid.', '.$pid.')] No document with UID "'.$uid.'" found or document not accessible', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1227 | 2044 | |||
1228 | 2045 | } | ||
1229 | 1999 | 2046 | ||
1230 | 2000 | } | 2047 | } |
1231 | 2001 | 2048 | ||
1232 | @@ -2012,17 +2059,21 @@ | |||
1233 | 2012 | */ | 2059 | */ |
1234 | 2013 | public function __get($var) { | 2060 | public function __get($var) { |
1235 | 2014 | 2061 | ||
1241 | 2015 | $_method = '_get'.ucfirst($var); | 2062 | $method = '_get'.ucfirst($var); |
1242 | 2016 | 2063 | ||
1243 | 2017 | if (!property_exists($this, $var) || !method_exists($this, $_method)) { | 2064 | if (!property_exists($this, $var) || !method_exists($this, $method)) { |
1244 | 2018 | 2065 | ||
1245 | 2019 | trigger_error('There is no get function for property '.$var, E_USER_ERROR); | 2066 | if (TYPO3_DLOG) { |
1246 | 2067 | |||
1247 | 2068 | t3lib_div::devLog('[tx_dlf_document->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1248 | 2069 | |||
1249 | 2070 | } | ||
1250 | 2020 | 2071 | ||
1251 | 2021 | return; | 2072 | return; |
1252 | 2022 | 2073 | ||
1253 | 2023 | } else { | 2074 | } else { |
1254 | 2024 | 2075 | ||
1256 | 2025 | return $this->$_method(); | 2076 | return $this->$method(); |
1257 | 2026 | 2077 | ||
1258 | 2027 | } | 2078 | } |
1259 | 2028 | 2079 | ||
1260 | @@ -2040,15 +2091,19 @@ | |||
1261 | 2040 | */ | 2091 | */ |
1262 | 2041 | public function __set($var, $value) { | 2092 | public function __set($var, $value) { |
1263 | 2042 | 2093 | ||
1269 | 2043 | $_method = '_set'.ucfirst($var); | 2094 | $method = '_set'.ucfirst($var); |
1270 | 2044 | 2095 | ||
1271 | 2045 | if (!property_exists($this, $var) || !method_exists($this, $_method)) { | 2096 | if (!property_exists($this, $var) || !method_exists($this, $method)) { |
1272 | 2046 | 2097 | ||
1273 | 2047 | trigger_error('There is no set function for property '.$var, E_USER_ERROR); | 2098 | if (TYPO3_DLOG) { |
1274 | 2099 | |||
1275 | 2100 | t3lib_div::devLog('[tx_dlf_document->__set('.$var.', '.$value.')] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1276 | 2101 | |||
1277 | 2102 | } | ||
1278 | 2048 | 2103 | ||
1279 | 2049 | } else { | 2104 | } else { |
1280 | 2050 | 2105 | ||
1282 | 2051 | $this->$_method($value); | 2106 | $this->$method($value); |
1283 | 2052 | 2107 | ||
1284 | 2053 | } | 2108 | } |
1285 | 2054 | 2109 | ||
1286 | @@ -2080,13 +2135,13 @@ | |||
1287 | 2080 | */ | 2135 | */ |
1288 | 2081 | public function __toString() { | 2136 | public function __toString() { |
1289 | 2082 | 2137 | ||
1297 | 2083 | $_xml = new DOMDocument('1.0', 'utf-8'); | 2138 | $xml = new DOMDocument('1.0', 'utf-8'); |
1298 | 2084 | 2139 | ||
1299 | 2085 | $_xml->appendChild($_xml->importNode(dom_import_simplexml($this->mets), TRUE)); | 2140 | $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), TRUE)); |
1300 | 2086 | 2141 | ||
1301 | 2087 | $_xml->formatOutput = TRUE; | 2142 | $xml->formatOutput = TRUE; |
1302 | 2088 | 2143 | ||
1303 | 2089 | return $_xml->saveXML(); | 2144 | return $xml->saveXML(); |
1304 | 2090 | 2145 | ||
1305 | 2091 | } | 2146 | } |
1306 | 2092 | 2147 | ||
1307 | @@ -2100,26 +2155,31 @@ | |||
1308 | 2100 | */ | 2155 | */ |
1309 | 2101 | public function __wakeup() { | 2156 | public function __wakeup() { |
1310 | 2102 | 2157 | ||
1319 | 2103 | $_libxmlErrors = libxml_use_internal_errors(TRUE); | 2158 | // Turn off libxml's error logging. |
1320 | 2104 | 2159 | $libxmlErrors = libxml_use_internal_errors(TRUE); | |
1321 | 2105 | // Reload XML from string... | 2160 | |
1322 | 2106 | $_xml = @simplexml_load_string($this->asXML); | 2161 | // Reload XML from string. |
1323 | 2107 | 2162 | $xml = @simplexml_load_string($this->asXML); | |
1324 | 2108 | libxml_use_internal_errors($_libxmlErrors); | 2163 | |
1325 | 2109 | 2164 | // Reset libxml's error logging. | |
1326 | 2110 | if ($_xml !== FALSE) { | 2165 | libxml_use_internal_errors($libxmlErrors); |
1327 | 2166 | |||
1328 | 2167 | if ($xml !== FALSE) { | ||
1329 | 2111 | 2168 | ||
1330 | 2112 | $this->asXML = ''; | 2169 | $this->asXML = ''; |
1331 | 2113 | 2170 | ||
1333 | 2114 | $this->xml = $_xml; | 2171 | $this->xml = $xml; |
1334 | 2115 | 2172 | ||
1336 | 2116 | // ...and rebuild the unserializable properties. | 2173 | // Rebuild the unserializable properties. |
1337 | 2117 | $this->init(); | 2174 | $this->init(); |
1338 | 2118 | 2175 | ||
1339 | 2119 | } else { | 2176 | } else { |
1340 | 2120 | 2177 | ||
1343 | 2121 | trigger_error('Could not reload XML from session', E_USER_ERROR); | 2178 | if (TYPO3_DLOG) { |
1344 | 2122 | // TODO: libxml_get_errors() || libxml_get_last_error() || libxml_clear_errors() | 2179 | |
1345 | 2180 | t3lib_div::devLog('[tx_dlf_document->__wakeup()] Could not load XML after deserialization', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1346 | 2181 | |||
1347 | 2182 | } | ||
1348 | 2123 | 2183 | ||
1349 | 2124 | } | 2184 | } |
1350 | 2125 | 2185 | ||
1351 | 2126 | 2186 | ||
1352 | === modified file 'dlf/common/class.tx_dlf_helper.php' | |||
1353 | --- dlf/common/class.tx_dlf_helper.php 2012-08-06 15:18:18 +0000 | |||
1354 | +++ dlf/common/class.tx_dlf_helper.php 2012-08-17 07:00:27 +0000 | |||
1355 | @@ -231,15 +231,25 @@ | |||
1356 | 231 | // Check for PHP extension "mcrypt". | 231 | // Check for PHP extension "mcrypt". |
1357 | 232 | if (!extension_loaded('mcrypt')) { | 232 | if (!extension_loaded('mcrypt')) { |
1358 | 233 | 233 | ||
1362 | 234 | trigger_error('PHP extension "mcrypt" not available', E_USER_WARNING); | 234 | if (TYPO3_DLOG) { |
1363 | 235 | 235 | ||
1364 | 236 | return NULL; | 236 | t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] PHP extension "mcrypt" not available', $this->extKey, SYSLOG_SEVERITY_WARNING); |
1365 | 237 | |||
1366 | 238 | } | ||
1367 | 239 | |||
1368 | 240 | return; | ||
1369 | 237 | 241 | ||
1370 | 238 | } | 242 | } |
1371 | 239 | 243 | ||
1372 | 240 | if (empty($encrypted) || empty($hash)) { | 244 | if (empty($encrypted) || empty($hash)) { |
1373 | 241 | 245 | ||
1375 | 242 | return NULL; | 246 | if (TYPO3_DLOG) { |
1376 | 247 | |||
1377 | 248 | t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] Invalid parameters given for decryption', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1378 | 249 | |||
1379 | 250 | } | ||
1380 | 251 | |||
1381 | 252 | return; | ||
1382 | 243 | 253 | ||
1383 | 244 | } | 254 | } |
1384 | 245 | 255 | ||
1385 | @@ -253,7 +263,13 @@ | |||
1386 | 253 | 263 | ||
1387 | 254 | if ($hashed !== $hash) { | 264 | if ($hashed !== $hash) { |
1388 | 255 | 265 | ||
1390 | 256 | return NULL; | 266 | if (TYPO3_DLOG) { |
1391 | 267 | |||
1392 | 268 | t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] Invalid hash "'.$hash.'" given for decryption', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1393 | 269 | |||
1394 | 270 | } | ||
1395 | 271 | |||
1396 | 272 | return; | ||
1397 | 257 | 273 | ||
1398 | 258 | } | 274 | } |
1399 | 259 | 275 | ||
1400 | @@ -276,9 +292,13 @@ | |||
1401 | 276 | // Check for PHP extension "mcrypt". | 292 | // Check for PHP extension "mcrypt". |
1402 | 277 | if (!extension_loaded('mcrypt')) { | 293 | if (!extension_loaded('mcrypt')) { |
1403 | 278 | 294 | ||
1407 | 279 | trigger_error('PHP extension "mcrypt" not available', E_USER_WARNING); | 295 | if (TYPO3_DLOG) { |
1408 | 280 | 296 | ||
1409 | 281 | return NULL; | 297 | t3lib_div::devLog('[tx_dlf_helper->encrypt('.$string.')] PHP extension "mcrypt" not available', $this->extKey, SYSLOG_SEVERITY_WARNING); |
1410 | 298 | |||
1411 | 299 | } | ||
1412 | 300 | |||
1413 | 301 | return; | ||
1414 | 282 | 302 | ||
1415 | 283 | } | 303 | } |
1416 | 284 | 304 | ||
1417 | @@ -305,22 +325,50 @@ | |||
1418 | 305 | 325 | ||
1419 | 306 | if (TYPO3_MODE === 'FE') { | 326 | if (TYPO3_MODE === 'FE') { |
1420 | 307 | 327 | ||
1429 | 308 | // TODO: Anpassen! (aus typo3/init.php übernommen) | 328 | // Check for existing backend login. |
1430 | 309 | $userObj = t3lib_div::makeInstance('t3lib_beUserAuth'); | 329 | if ($GLOBALS['TSFE']->beUserLogin > 0 && isset($GLOBALS['BE_USER'])) { |
1431 | 310 | 330 | ||
1432 | 311 | $userObj->start(); | 331 | return $GLOBALS['BE_USER']; |
1433 | 312 | 332 | ||
1434 | 313 | $userObj->backendCheckLogin(); | 333 | } elseif (!isset($_COOKIE['be_typo_user'])) { |
1435 | 314 | 334 | ||
1436 | 315 | return $userObj; | 335 | // Initialize backend session with CLI user's rights. |
1437 | 336 | $userObj = t3lib_div::makeInstance('t3lib_beUserAuth'); | ||
1438 | 337 | |||
1439 | 338 | $userObj->dontSetCookie = TRUE; | ||
1440 | 339 | |||
1441 | 340 | $userObj->start(); | ||
1442 | 341 | |||
1443 | 342 | $userObj->setBeUserByName('_cli_dlf'); | ||
1444 | 343 | |||
1445 | 344 | $userObj->backendCheckLogin(); | ||
1446 | 345 | |||
1447 | 346 | return $userObj; | ||
1448 | 347 | |||
1449 | 348 | } else { | ||
1450 | 349 | |||
1451 | 350 | if (TYPO3_DLOG) { | ||
1452 | 351 | |||
1453 | 352 | t3lib_div::devLog('[tx_dlf_helper->getBeUser()] Could not determine current user\'s login status', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1454 | 353 | |||
1455 | 354 | } | ||
1456 | 355 | |||
1457 | 356 | return; | ||
1458 | 357 | |||
1459 | 358 | } | ||
1460 | 316 | 359 | ||
1461 | 317 | } elseif (TYPO3_MODE === 'BE') { | 360 | } elseif (TYPO3_MODE === 'BE') { |
1462 | 318 | 361 | ||
1463 | 362 | // Return current backend user. | ||
1464 | 319 | return $GLOBALS['BE_USER']; | 363 | return $GLOBALS['BE_USER']; |
1465 | 320 | 364 | ||
1466 | 321 | } else { | 365 | } else { |
1467 | 322 | 366 | ||
1469 | 323 | trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING); | 367 | if (TYPO3_DLOG) { |
1470 | 368 | |||
1471 | 369 | t3lib_div::devLog('[tx_dlf_helper->getBeUser()] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1472 | 370 | |||
1473 | 371 | } | ||
1474 | 324 | 372 | ||
1475 | 325 | return; | 373 | return; |
1476 | 326 | 374 | ||
1477 | @@ -341,11 +389,21 @@ | |||
1478 | 341 | */ | 389 | */ |
1479 | 342 | public static function getIndexName($uid, $table, $pid = -1) { | 390 | public static function getIndexName($uid, $table, $pid = -1) { |
1480 | 343 | 391 | ||
1481 | 392 | // Save parameters for logging purposes. | ||
1482 | 393 | $_uid = $uid; | ||
1483 | 394 | |||
1484 | 395 | $_pid = $pid; | ||
1485 | 396 | |||
1486 | 397 | // Sanitize input. | ||
1487 | 344 | $uid = max(intval($uid), 0); | 398 | $uid = max(intval($uid), 0); |
1488 | 345 | 399 | ||
1489 | 346 | if (!$uid || !in_array($table, array ('tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores'))) { | 400 | if (!$uid || !in_array($table, array ('tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores'))) { |
1490 | 347 | 401 | ||
1492 | 348 | trigger_error('At least one argument is not valid: UID='.$uid.' or TABLE='.$table, E_USER_WARNING); | 402 | if (TYPO3_DLOG) { |
1493 | 403 | |||
1494 | 404 | t3lib_div::devLog('[tx_dlf_helper->getIndexName('.$_uid.', '.$table.', '.$_pid.')] Invalid UID "'.$uid.'" or table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1495 | 405 | |||
1496 | 406 | } | ||
1497 | 349 | 407 | ||
1498 | 350 | return ''; | 408 | return ''; |
1499 | 351 | 409 | ||
1500 | @@ -353,6 +411,7 @@ | |||
1501 | 353 | 411 | ||
1502 | 354 | $where = ''; | 412 | $where = ''; |
1503 | 355 | 413 | ||
1504 | 414 | // Should we check for a specific PID, too? | ||
1505 | 356 | if ($pid !== -1) { | 415 | if ($pid !== -1) { |
1506 | 357 | 416 | ||
1507 | 358 | $pid = max(intval($pid), 0); | 417 | $pid = max(intval($pid), 0); |
1508 | @@ -361,7 +420,8 @@ | |||
1509 | 361 | 420 | ||
1510 | 362 | } | 421 | } |
1511 | 363 | 422 | ||
1513 | 364 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 423 | // Get index_name from database. |
1514 | 424 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | ||
1515 | 365 | $table.'.index_name AS index_name', | 425 | $table.'.index_name AS index_name', |
1516 | 366 | $table, | 426 | $table, |
1517 | 367 | $table.'.uid='.$uid.$where.self::whereClause($table), | 427 | $table.'.uid='.$uid.$where.self::whereClause($table), |
1518 | @@ -370,18 +430,24 @@ | |||
1519 | 370 | '1' | 430 | '1' |
1520 | 371 | ); | 431 | ); |
1521 | 372 | 432 | ||
1523 | 373 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) { | 433 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { |
1524 | 374 | 434 | ||
1526 | 375 | $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result); | 435 | $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
1527 | 376 | 436 | ||
1528 | 377 | return $resArray['index_name']; | 437 | return $resArray['index_name']; |
1529 | 378 | 438 | ||
1530 | 439 | } else { | ||
1531 | 440 | |||
1532 | 441 | if (TYPO3_DLOG) { | ||
1533 | 442 | |||
1534 | 443 | t3lib_div::devLog('[tx_dlf_helper->getIndexName('.$_uid.', '.$table.', '.$_pid.')] No "index_name" with UID "'.$uid.'" and PID "'.$pid.'" found in table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1535 | 444 | |||
1536 | 445 | } | ||
1537 | 446 | |||
1538 | 447 | return ''; | ||
1539 | 448 | |||
1540 | 379 | } | 449 | } |
1541 | 380 | 450 | ||
1542 | 381 | trigger_error('No "index_name" with UID '.$uid.' found for PID '.$pid.' in TABLE '.$table, E_USER_WARNING); | ||
1543 | 382 | |||
1544 | 383 | return ''; | ||
1545 | 384 | |||
1546 | 385 | } | 451 | } |
1547 | 386 | 452 | ||
1548 | 387 | /** | 453 | /** |
1549 | @@ -395,45 +461,52 @@ | |||
1550 | 395 | */ | 461 | */ |
1551 | 396 | public static function getLanguageName($code) { | 462 | public static function getLanguageName($code) { |
1552 | 397 | 463 | ||
1562 | 398 | $_code = strtolower(trim($code)); | 464 | // Analyze code and set appropriate ISO table. |
1563 | 399 | 465 | $isoCode = strtolower(trim($code)); | |
1564 | 400 | if (preg_match('/^[a-z]{3}$/', $_code)) { | 466 | |
1565 | 401 | 467 | if (preg_match('/^[a-z]{3}$/', $isoCode)) { | |
1566 | 402 | $_file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-2b.xml'; | 468 | |
1567 | 403 | 469 | $file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-2b.xml'; | |
1568 | 404 | } elseif (preg_match('/^[a-z]{2}$/', $_code)) { | 470 | |
1569 | 405 | 471 | } elseif (preg_match('/^[a-z]{2}$/', $isoCode)) { | |
1570 | 406 | $_file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-1.xml'; | 472 | |
1571 | 473 | $file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-1.xml'; | ||
1572 | 407 | 474 | ||
1573 | 408 | } else { | 475 | } else { |
1574 | 409 | 476 | ||
1575 | 477 | // No ISO code, return unchanged. | ||
1576 | 410 | return $code; | 478 | return $code; |
1577 | 411 | 479 | ||
1578 | 412 | } | 480 | } |
1579 | 413 | 481 | ||
1580 | 482 | // Load ISO table and get localized full name of language. | ||
1581 | 414 | if (TYPO3_MODE === 'FE') { | 483 | if (TYPO3_MODE === 'FE') { |
1582 | 415 | 484 | ||
1588 | 416 | $iso639 = $GLOBALS['TSFE']->readLLfile($_file); | 485 | $iso639 = $GLOBALS['TSFE']->readLLfile($file); |
1589 | 417 | 486 | ||
1590 | 418 | if (!empty($iso639['default'][$_code])) { | 487 | if (!empty($iso639['default'][$isoCode])) { |
1591 | 419 | 488 | ||
1592 | 420 | $lang = $GLOBALS['TSFE']->getLLL($_code, $iso639); | 489 | $lang = $GLOBALS['TSFE']->getLLL($isoCode, $iso639); |
1593 | 421 | 490 | ||
1594 | 422 | } | 491 | } |
1595 | 423 | 492 | ||
1596 | 424 | } elseif (TYPO3_MODE === 'BE') { | 493 | } elseif (TYPO3_MODE === 'BE') { |
1597 | 425 | 494 | ||
1603 | 426 | $iso639 = $GLOBALS['LANG']->includeLLFile($_file, FALSE, TRUE); | 495 | $iso639 = $GLOBALS['LANG']->includeLLFile($file, FALSE, TRUE); |
1604 | 427 | 496 | ||
1605 | 428 | if (!empty($iso639['default'][$_code])) { | 497 | if (!empty($iso639['default'][$isoCode])) { |
1606 | 429 | 498 | ||
1607 | 430 | $lang = $GLOBALS['LANG']->getLLL($_code, $iso639, FALSE); | 499 | $lang = $GLOBALS['LANG']->getLLL($isoCode, $iso639, FALSE); |
1608 | 431 | 500 | ||
1609 | 432 | } | 501 | } |
1610 | 433 | 502 | ||
1611 | 434 | } else { | 503 | } else { |
1612 | 435 | 504 | ||
1614 | 436 | trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING); | 505 | if (TYPO3_DLOG) { |
1615 | 506 | |||
1616 | 507 | t3lib_div::devLog('[tx_dlf_helper->getLanguageName('.$code.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1617 | 508 | |||
1618 | 509 | } | ||
1619 | 437 | 510 | ||
1620 | 438 | return $code; | 511 | return $code; |
1621 | 439 | 512 | ||
1622 | @@ -445,7 +518,11 @@ | |||
1623 | 445 | 518 | ||
1624 | 446 | } else { | 519 | } else { |
1625 | 447 | 520 | ||
1627 | 448 | trigger_error('Language code "'.$code.'" not found', E_USER_WARNING); | 521 | if (TYPO3_DLOG) { |
1628 | 522 | |||
1629 | 523 | t3lib_div::devLog('[tx_dlf_helper->getLanguageName('.$code.')] Language code "'.$code.'" not found in ISO-639 table', $this->extKey, SYSLOG_SEVERITY_NOTICE); | ||
1630 | 524 | |||
1631 | 525 | } | ||
1632 | 449 | 526 | ||
1633 | 450 | return $code; | 527 | return $code; |
1634 | 451 | 528 | ||
1635 | @@ -466,7 +543,7 @@ | |||
1636 | 466 | */ | 543 | */ |
1637 | 467 | public static function getURN($base, $id) { | 544 | public static function getURN($base, $id) { |
1638 | 468 | 545 | ||
1640 | 469 | $concordance = array( | 546 | $concordance = array ( |
1641 | 470 | '0' => 1, | 547 | '0' => 1, |
1642 | 471 | '1' => 2, | 548 | '1' => 2, |
1643 | 472 | '2' => 3, | 549 | '2' => 3, |
1644 | @@ -511,7 +588,11 @@ | |||
1645 | 511 | 588 | ||
1646 | 512 | if (preg_match('/[^a-z0-9:-]/', $urn)) { | 589 | if (preg_match('/[^a-z0-9:-]/', $urn)) { |
1647 | 513 | 590 | ||
1649 | 514 | trigger_error('Invalid chars in URN', E_USER_WARNING); | 591 | if (TYPO3_DLOG) { |
1650 | 592 | |||
1651 | 593 | t3lib_div::devLog('[tx_dlf_helper->getURN('.$base.', '.$id.')] Invalid chars in given parameters', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1652 | 594 | |||
1653 | 595 | } | ||
1654 | 515 | 596 | ||
1655 | 516 | return ''; | 597 | return ''; |
1656 | 517 | 598 | ||
1657 | @@ -559,23 +640,31 @@ | |||
1658 | 559 | * | 640 | * |
1659 | 560 | * @access public | 641 | * @access public |
1660 | 561 | * | 642 | * |
1662 | 562 | * @param string $key: Session key for retrieval | 643 | * @param string $key: Session data key for retrieval |
1663 | 563 | * | 644 | * |
1664 | 564 | * @return mixed Session value for given key or NULL on failure | 645 | * @return mixed Session value for given key or NULL on failure |
1665 | 565 | */ | 646 | */ |
1666 | 566 | public static function loadFromSession($key) { | 647 | public static function loadFromSession($key) { |
1667 | 567 | 648 | ||
1668 | 649 | // Save parameter for logging purposes. | ||
1669 | 650 | $_key = $key; | ||
1670 | 651 | |||
1671 | 568 | // Cast to string for security reasons. | 652 | // Cast to string for security reasons. |
1672 | 569 | $key = (string) $key; | 653 | $key = (string) $key; |
1673 | 570 | 654 | ||
1674 | 571 | if (!$key) { | 655 | if (!$key) { |
1675 | 572 | 656 | ||
1677 | 573 | trigger_error('No session key given', E_USER_WARNING); | 657 | if (TYPO3_DLOG) { |
1678 | 658 | |||
1679 | 659 | t3lib_div::devLog('[tx_dlf_helper->loadFromSession('.$_key.')] Invalid key "'.$key.'" for session data retrieval', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1680 | 660 | |||
1681 | 661 | } | ||
1682 | 574 | 662 | ||
1683 | 575 | return; | 663 | return; |
1684 | 576 | 664 | ||
1685 | 577 | } | 665 | } |
1686 | 578 | 666 | ||
1687 | 667 | // Get the session data. | ||
1688 | 579 | if (TYPO3_MODE === 'FE') { | 668 | if (TYPO3_MODE === 'FE') { |
1689 | 580 | 669 | ||
1690 | 581 | return $GLOBALS['TSFE']->fe_user->getKey('ses', $key); | 670 | return $GLOBALS['TSFE']->fe_user->getKey('ses', $key); |
1691 | @@ -586,7 +675,11 @@ | |||
1692 | 586 | 675 | ||
1693 | 587 | } else { | 676 | } else { |
1694 | 588 | 677 | ||
1696 | 589 | trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING); | 678 | if (TYPO3_DLOG) { |
1697 | 679 | |||
1698 | 680 | t3lib_div::devLog('[tx_dlf_helper->loadFromSession('.$_key.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1699 | 681 | |||
1700 | 682 | } | ||
1701 | 590 | 683 | ||
1702 | 591 | return; | 684 | return; |
1703 | 592 | 685 | ||
1704 | @@ -647,23 +740,31 @@ | |||
1705 | 647 | * @access public | 740 | * @access public |
1706 | 648 | * | 741 | * |
1707 | 649 | * @param string $value: Value to save | 742 | * @param string $value: Value to save |
1709 | 650 | * @param string $key: Session key for retrieval | 743 | * @param string $key: Session data key for saving |
1710 | 651 | * | 744 | * |
1711 | 652 | * @return boolean TRUE on success, FALSE on failure | 745 | * @return boolean TRUE on success, FALSE on failure |
1712 | 653 | */ | 746 | */ |
1713 | 654 | public static function saveToSession($value, $key) { | 747 | public static function saveToSession($value, $key) { |
1714 | 655 | 748 | ||
1715 | 749 | // Save parameter for logging purposes. | ||
1716 | 750 | $_key = $key; | ||
1717 | 751 | |||
1718 | 656 | // Cast to string for security reasons. | 752 | // Cast to string for security reasons. |
1719 | 657 | $key = (string) $key; | 753 | $key = (string) $key; |
1720 | 658 | 754 | ||
1721 | 659 | if (!$key) { | 755 | if (!$key) { |
1722 | 660 | 756 | ||
1724 | 661 | trigger_error('No session key given', E_USER_WARNING); | 757 | if (TYPO3_DLOG) { |
1725 | 758 | |||
1726 | 759 | t3lib_div::devLog('[tx_dlf_helper->saveToSession('.$value.', '.$_key.')] Invalid key "'.$key.'" for session data saving', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1727 | 760 | |||
1728 | 761 | } | ||
1729 | 662 | 762 | ||
1730 | 663 | return FALSE; | 763 | return FALSE; |
1731 | 664 | 764 | ||
1732 | 665 | } | 765 | } |
1733 | 666 | 766 | ||
1734 | 767 | // Save value in session data. | ||
1735 | 667 | if (TYPO3_MODE === 'FE') { | 768 | if (TYPO3_MODE === 'FE') { |
1736 | 668 | 769 | ||
1737 | 669 | $GLOBALS['TSFE']->fe_user->setKey('ses', $key, $value); | 770 | $GLOBALS['TSFE']->fe_user->setKey('ses', $key, $value); |
1738 | @@ -680,7 +781,11 @@ | |||
1739 | 680 | 781 | ||
1740 | 681 | } else { | 782 | } else { |
1741 | 682 | 783 | ||
1743 | 683 | trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING); | 784 | if (TYPO3_DLOG) { |
1744 | 785 | |||
1745 | 786 | t3lib_div::devLog('[tx_dlf_helper->saveToSession('.$value.', '.$_key.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1746 | 787 | |||
1747 | 788 | } | ||
1748 | 684 | 789 | ||
1749 | 685 | return FALSE; | 790 | return FALSE; |
1750 | 686 | 791 | ||
1751 | @@ -689,82 +794,6 @@ | |||
1752 | 689 | } | 794 | } |
1753 | 690 | 795 | ||
1754 | 691 | /** | 796 | /** |
1755 | 692 | * This validates a METS file against its schemas | ||
1756 | 693 | * TODO: nicht funktionstüchtig! | ||
1757 | 694 | * | ||
1758 | 695 | * @access public | ||
1759 | 696 | * | ||
1760 | 697 | * @param SimpleXMLElement $xml: | ||
1761 | 698 | * | ||
1762 | 699 | * @return void | ||
1763 | 700 | */ | ||
1764 | 701 | public static function schemaValidate(SimpleXMLElement $xml) { | ||
1765 | 702 | |||
1766 | 703 | $_libxmlErrors = libxml_use_internal_errors(TRUE); | ||
1767 | 704 | |||
1768 | 705 | // Get schema locations. | ||
1769 | 706 | $xml->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance'); | ||
1770 | 707 | |||
1771 | 708 | $_schemaLocations = $xml->xpath('//*[@xsi:schemaLocation]'); | ||
1772 | 709 | |||
1773 | 710 | foreach ($_schemaLocations as $_schemaLocation) { | ||
1774 | 711 | |||
1775 | 712 | $_schemas = explode(' ', (string) $_schemaLocation->attributes('http://www.w3.org/2001/XMLSchema-instance')->schemaLocation); | ||
1776 | 713 | |||
1777 | 714 | for ($i = 1, $j = count($_schemas); $i <= $j; $i++) { | ||
1778 | 715 | |||
1779 | 716 | if ($_schemas[$i] == 'http://www.loc.gov/METS/') { | ||
1780 | 717 | |||
1781 | 718 | $schema['mets'] = $_schemas[$i + 1]; | ||
1782 | 719 | |||
1783 | 720 | } elseif ($_schemas[$i] == 'http://www.loc.gov/mods/v3') { | ||
1784 | 721 | |||
1785 | 722 | $schema['mods'] = $_schemas[$i + 1]; | ||
1786 | 723 | |||
1787 | 724 | } | ||
1788 | 725 | |||
1789 | 726 | } | ||
1790 | 727 | |||
1791 | 728 | } | ||
1792 | 729 | // TODO: Error-Handling (keine Schemas gefunden) | ||
1793 | 730 | |||
1794 | 731 | // Validate METS part against schema. | ||
1795 | 732 | $dom = new DOMDocument('1.0', 'UTF-8'); | ||
1796 | 733 | |||
1797 | 734 | $dom->appendChild($dom->importNode(dom_import_simplexml($this->mets), TRUE)); | ||
1798 | 735 | |||
1799 | 736 | $dom->schemaValidate($schema['mets']); | ||
1800 | 737 | |||
1801 | 738 | // TODO: Error-Handling (invalider METS-Part) | ||
1802 | 739 | // libxml_get_last_error() || libxml_get_errors() || libxml_clear_errors() | ||
1803 | 740 | |||
1804 | 741 | // Validate dmdSec parts against schema. | ||
1805 | 742 | foreach ($this->dmdSec as $dmdSec) { | ||
1806 | 743 | |||
1807 | 744 | switch ($dmdSec['type']) { | ||
1808 | 745 | |||
1809 | 746 | case 'MODS': | ||
1810 | 747 | |||
1811 | 748 | $dom = new DOMDocument('1.0', 'UTF-8'); | ||
1812 | 749 | |||
1813 | 750 | $dom->appendChild($dom->importNode(dom_import_simplexml($dmdSec['xml']), TRUE)); | ||
1814 | 751 | |||
1815 | 752 | $dom->schemaValidate($schema['mods']); | ||
1816 | 753 | |||
1817 | 754 | // TODO: Error-Handling (invalider MODS-Part) | ||
1818 | 755 | // libxml_get_last_error() || libxml_get_errors() || libxml_clear_errors() | ||
1819 | 756 | |||
1820 | 757 | break; | ||
1821 | 758 | |||
1822 | 759 | } | ||
1823 | 760 | |||
1824 | 761 | } | ||
1825 | 762 | |||
1826 | 763 | libxml_use_internal_errors($_libxmlErrors); | ||
1827 | 764 | |||
1828 | 765 | } | ||
1829 | 766 | |||
1830 | 767 | /** | ||
1831 | 768 | * This translates an internal "index_name" | 797 | * This translates an internal "index_name" |
1832 | 769 | * | 798 | * |
1833 | 770 | * @access public | 799 | * @access public |
1834 | @@ -777,13 +806,24 @@ | |||
1835 | 777 | */ | 806 | */ |
1836 | 778 | public static function translate($index_name, $table, $pid) { | 807 | public static function translate($index_name, $table, $pid) { |
1837 | 779 | 808 | ||
1838 | 809 | // Save parameters for logging purposes. | ||
1839 | 810 | $_index_name = $index_name; | ||
1840 | 811 | |||
1841 | 812 | $_pid = $pid; | ||
1842 | 813 | |||
1843 | 814 | // Load labels into static variable for future use. | ||
1844 | 780 | static $labels = array (); | 815 | static $labels = array (); |
1845 | 781 | 816 | ||
1846 | 817 | // Sanitize input. | ||
1847 | 782 | $pid = max(intval($pid), 0); | 818 | $pid = max(intval($pid), 0); |
1848 | 783 | 819 | ||
1849 | 784 | if (!$pid) { | 820 | if (!$pid) { |
1850 | 785 | 821 | ||
1852 | 786 | trigger_error('No PID given for translations', E_USER_WARNING); | 822 | if (TYPO3_DLOG) { |
1853 | 823 | |||
1854 | 824 | t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] Invalid PID "'.$pid.'" for translation', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1855 | 825 | |||
1856 | 826 | } | ||
1857 | 787 | 827 | ||
1858 | 788 | return $index_name; | 828 | return $index_name; |
1859 | 789 | 829 | ||
1860 | @@ -811,7 +851,7 @@ | |||
1861 | 811 | } | 851 | } |
1862 | 812 | 852 | ||
1863 | 813 | // Get labels from database. | 853 | // Get labels from database. |
1865 | 814 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 854 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
1866 | 815 | '*', | 855 | '*', |
1867 | 816 | $table, | 856 | $table, |
1868 | 817 | 'pid='.$pid.$additionalWhere.self::whereClause($table), | 857 | 'pid='.$pid.$additionalWhere.self::whereClause($table), |
1869 | @@ -820,9 +860,9 @@ | |||
1870 | 820 | '' | 860 | '' |
1871 | 821 | ); | 861 | ); |
1872 | 822 | 862 | ||
1874 | 823 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) { | 863 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { |
1875 | 824 | 864 | ||
1877 | 825 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { | 865 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
1878 | 826 | 866 | ||
1879 | 827 | // Overlay localized labels if available. | 867 | // Overlay localized labels if available. |
1880 | 828 | if ($GLOBALS['TSFE']->sys_language_content > 0) { | 868 | if ($GLOBALS['TSFE']->sys_language_content > 0) { |
1881 | @@ -841,13 +881,21 @@ | |||
1882 | 841 | 881 | ||
1883 | 842 | } else { | 882 | } else { |
1884 | 843 | 883 | ||
1886 | 844 | trigger_error('There are no entries with PID '.$pid.' in table '.$table.' or you are not allowed to access them', E_USER_ERROR); | 884 | if (TYPO3_DLOG) { |
1887 | 885 | |||
1888 | 886 | t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] No translation with PID "'.$pid.'" available in table "'.$table.'" or translation not accessible', $this->extKey, SYSLOG_SEVERITY_NOTICE); | ||
1889 | 887 | |||
1890 | 888 | } | ||
1891 | 845 | 889 | ||
1892 | 846 | } | 890 | } |
1893 | 847 | 891 | ||
1894 | 848 | } else { | 892 | } else { |
1895 | 849 | 893 | ||
1897 | 850 | trigger_error('The table '.$table.' is not allowed for translation', E_USER_ERROR); | 894 | if (TYPO3_DLOG) { |
1898 | 895 | |||
1899 | 896 | t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] No translations available for table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
1900 | 897 | |||
1901 | 898 | } | ||
1902 | 851 | 899 | ||
1903 | 852 | } | 900 | } |
1904 | 853 | 901 | ||
1905 | @@ -916,7 +964,11 @@ | |||
1906 | 916 | 964 | ||
1907 | 917 | } else { | 965 | } else { |
1908 | 918 | 966 | ||
1910 | 919 | trigger_error('Unexpected TYPO3_MODE', E_USER_ERROR); | 967 | if (TYPO3_DLOG) { |
1911 | 968 | |||
1912 | 969 | t3lib_div::devLog('[tx_dlf_helper->whereClause('.$table.', ['.($showHidden ? 'TRUE' : 'FALSE').'])] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
1913 | 970 | |||
1914 | 971 | } | ||
1915 | 920 | 972 | ||
1916 | 921 | return ' AND 1=-1'; | 973 | return ' AND 1=-1'; |
1917 | 922 | 974 | ||
1918 | 923 | 975 | ||
1919 | === modified file 'dlf/common/class.tx_dlf_indexing.php' | |||
1920 | --- dlf/common/class.tx_dlf_indexing.php 2012-08-09 10:31:57 +0000 | |||
1921 | +++ dlf/common/class.tx_dlf_indexing.php 2012-08-17 07:00:27 +0000 | |||
1922 | @@ -38,15 +38,6 @@ | |||
1923 | 38 | class tx_dlf_indexing { | 38 | class tx_dlf_indexing { |
1924 | 39 | 39 | ||
1925 | 40 | /** | 40 | /** |
1926 | 41 | * Array of autocompletable metadata | ||
1927 | 42 | * @see loadIndexConf() | ||
1928 | 43 | * | ||
1929 | 44 | * @var array | ||
1930 | 45 | * @access protected | ||
1931 | 46 | */ | ||
1932 | 47 | protected static $autocompleted = array (); | ||
1933 | 48 | |||
1934 | 49 | /** | ||
1935 | 50 | * The extension key | 41 | * The extension key |
1936 | 51 | * | 42 | * |
1937 | 52 | * @var string | 43 | * @var string |
1938 | @@ -55,31 +46,21 @@ | |||
1939 | 55 | public static $extKey = 'dlf'; | 46 | public static $extKey = 'dlf'; |
1940 | 56 | 47 | ||
1941 | 57 | /** | 48 | /** |
1967 | 58 | * Array of facets | 49 | * Array of metadata fields' configuration |
1968 | 59 | * @see loadIndexConf() | 50 | * @see loadIndexConf() |
1969 | 60 | * | 51 | * |
1970 | 61 | * @var array | 52 | * @var array |
1971 | 62 | * @access protected | 53 | * @access protected |
1972 | 63 | */ | 54 | */ |
1973 | 64 | protected static $facets = array (); | 55 | protected static $fields = array ( |
1974 | 65 | 56 | 'autocompleted' => array (), | |
1975 | 66 | /** | 57 | 'facets' => array (), |
1976 | 67 | * Array of fields' boost values | 58 | 'sortables' => array (), |
1977 | 68 | * @see loadIndexConf() | 59 | 'indexed' => array (), |
1978 | 69 | * | 60 | 'stored' => array (), |
1979 | 70 | * @var array | 61 | 'tokenized' => array (), |
1980 | 71 | * @access protected | 62 | 'fieldboost' => array () |
1981 | 72 | */ | 63 | ); |
1957 | 73 | protected static $fieldboost = array (); | ||
1958 | 74 | |||
1959 | 75 | /** | ||
1960 | 76 | * Array of indexed metadata | ||
1961 | 77 | * @see loadIndexConf() | ||
1962 | 78 | * | ||
1963 | 79 | * @var array | ||
1964 | 80 | * @access protected | ||
1965 | 81 | */ | ||
1966 | 82 | protected static $indexed = array (); | ||
1982 | 83 | 64 | ||
1983 | 84 | /** | 65 | /** |
1984 | 85 | * List of already processed documents | 66 | * List of already processed documents |
1985 | @@ -98,33 +79,6 @@ | |||
1986 | 98 | protected static $solr; | 79 | protected static $solr; |
1987 | 99 | 80 | ||
1988 | 100 | /** | 81 | /** |
1989 | 101 | * Array of sortable metadata | ||
1990 | 102 | * @see loadIndexConf() | ||
1991 | 103 | * | ||
1992 | 104 | * @var array | ||
1993 | 105 | * @access protected | ||
1994 | 106 | */ | ||
1995 | 107 | protected static $sortables = array (); | ||
1996 | 108 | |||
1997 | 109 | /** | ||
1998 | 110 | * Array of stored metadata | ||
1999 | 111 | * @see loadIndexConf() | ||
2000 | 112 | * | ||
2001 | 113 | * @var array | ||
2002 | 114 | * @access protected | ||
2003 | 115 | */ | ||
2004 | 116 | protected static $stored = array (); | ||
2005 | 117 | |||
2006 | 118 | /** | ||
2007 | 119 | * Array of tokenized metadata | ||
2008 | 120 | * @see loadIndexConf() | ||
2009 | 121 | * | ||
2010 | 122 | * @var array | ||
2011 | 123 | * @access protected | ||
2012 | 124 | */ | ||
2013 | 125 | protected static $tokenized = array (); | ||
2014 | 126 | |||
2015 | 127 | /** | ||
2016 | 128 | * Array of toplevel structure elements | 82 | * Array of toplevel structure elements |
2017 | 129 | * @see loadIndexConf() | 83 | * @see loadIndexConf() |
2018 | 130 | * | 84 | * |
2019 | @@ -164,7 +118,11 @@ | |||
2020 | 164 | 118 | ||
2021 | 165 | } else { | 119 | } else { |
2022 | 166 | 120 | ||
2024 | 167 | trigger_error('Could not load multi-volume work with UID '.$doc->parentid, E_USER_ERROR); | 121 | if (TYPO3_DLOG) { |
2025 | 122 | |||
2026 | 123 | t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not load parent document with UID "'.$doc->parentid.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2027 | 124 | |||
2028 | 125 | } | ||
2029 | 168 | 126 | ||
2030 | 169 | return 1; | 127 | return 1; |
2031 | 170 | 128 | ||
2032 | @@ -195,7 +153,7 @@ | |||
2033 | 195 | self::$solr->commit(); | 153 | self::$solr->commit(); |
2034 | 196 | 154 | ||
2035 | 197 | // Get document title from database. | 155 | // Get document title from database. |
2037 | 198 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 156 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
2038 | 199 | 'tx_dlf_documents.title AS title', | 157 | 'tx_dlf_documents.title AS title', |
2039 | 200 | 'tx_dlf_documents', | 158 | 'tx_dlf_documents', |
2040 | 201 | 'tx_dlf_documents.uid='.intval($doc->uid).tx_dlf_helper::whereClause('tx_dlf_documents'), | 159 | 'tx_dlf_documents.uid='.intval($doc->uid).tx_dlf_helper::whereClause('tx_dlf_documents'), |
2041 | @@ -204,11 +162,11 @@ | |||
2042 | 204 | '1' | 162 | '1' |
2043 | 205 | ); | 163 | ); |
2044 | 206 | 164 | ||
2046 | 207 | $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result); | 165 | $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
2047 | 208 | 166 | ||
2048 | 209 | if (!defined('TYPO3_cliMode')) { | 167 | if (!defined('TYPO3_cliMode')) { |
2049 | 210 | 168 | ||
2051 | 211 | $_message = t3lib_div::makeInstance( | 169 | $message = t3lib_div::makeInstance( |
2052 | 212 | 't3lib_FlashMessage', | 170 | 't3lib_FlashMessage', |
2053 | 213 | htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)), | 171 | htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)), |
2054 | 214 | $GLOBALS['LANG']->getLL('flash.done', TRUE), | 172 | $GLOBALS['LANG']->getLL('flash.done', TRUE), |
2055 | @@ -216,7 +174,7 @@ | |||
2056 | 216 | TRUE | 174 | TRUE |
2057 | 217 | ); | 175 | ); |
2058 | 218 | 176 | ||
2060 | 219 | t3lib_FlashMessageQueue::addMessage($_message); | 177 | t3lib_FlashMessageQueue::addMessage($message); |
2061 | 220 | 178 | ||
2062 | 221 | } | 179 | } |
2063 | 222 | 180 | ||
2064 | @@ -226,7 +184,7 @@ | |||
2065 | 226 | 184 | ||
2066 | 227 | if (!defined('TYPO3_cliMode')) { | 185 | if (!defined('TYPO3_cliMode')) { |
2067 | 228 | 186 | ||
2069 | 229 | $_message = t3lib_div::makeInstance( | 187 | $message = t3lib_div::makeInstance( |
2070 | 230 | 't3lib_FlashMessage', | 188 | 't3lib_FlashMessage', |
2071 | 231 | $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), | 189 | $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
2072 | 232 | $GLOBALS['LANG']->getLL('flash.error', TRUE), | 190 | $GLOBALS['LANG']->getLL('flash.error', TRUE), |
2073 | @@ -234,11 +192,15 @@ | |||
2074 | 234 | TRUE | 192 | TRUE |
2075 | 235 | ); | 193 | ); |
2076 | 236 | 194 | ||
2082 | 237 | t3lib_FlashMessageQueue::addMessage($_message); | 195 | t3lib_FlashMessageQueue::addMessage($message); |
2083 | 238 | 196 | ||
2084 | 239 | } | 197 | } |
2085 | 240 | 198 | ||
2086 | 241 | trigger_error('Apache Solr exception thrown: '.$e->getMessage(), E_USER_ERROR); | 199 | if (TYPO3_DLOG) { |
2087 | 200 | |||
2088 | 201 | t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Apache Solr threw exception: "'.$e->getMessage().'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2089 | 202 | |||
2090 | 203 | } | ||
2091 | 242 | 204 | ||
2092 | 243 | return 1; | 205 | return 1; |
2093 | 244 | 206 | ||
2094 | @@ -248,7 +210,7 @@ | |||
2095 | 248 | 210 | ||
2096 | 249 | if (!defined('TYPO3_cliMode')) { | 211 | if (!defined('TYPO3_cliMode')) { |
2097 | 250 | 212 | ||
2099 | 251 | $_message = t3lib_div::makeInstance( | 213 | $message = t3lib_div::makeInstance( |
2100 | 252 | 't3lib_FlashMessage', | 214 | 't3lib_FlashMessage', |
2101 | 253 | $GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE), | 215 | $GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE), |
2102 | 254 | $GLOBALS['LANG']->getLL('flash.warning', TRUE), | 216 | $GLOBALS['LANG']->getLL('flash.warning', TRUE), |
2103 | @@ -256,11 +218,15 @@ | |||
2104 | 256 | TRUE | 218 | TRUE |
2105 | 257 | ); | 219 | ); |
2106 | 258 | 220 | ||
2112 | 259 | t3lib_FlashMessageQueue::addMessage($_message); | 221 | t3lib_FlashMessageQueue::addMessage($message); |
2113 | 260 | 222 | ||
2114 | 261 | } | 223 | } |
2115 | 262 | 224 | ||
2116 | 263 | trigger_error('Could not connect to Apache Solr server', E_USER_WARNING); | 225 | if (TYPO3_DLOG) { |
2117 | 226 | |||
2118 | 227 | t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not connect to Apache Solr server', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2119 | 228 | |||
2120 | 229 | } | ||
2121 | 264 | 230 | ||
2122 | 265 | return 1; | 231 | return 1; |
2123 | 266 | 232 | ||
2124 | @@ -279,6 +245,9 @@ | |||
2125 | 279 | */ | 245 | */ |
2126 | 280 | public static function delete($uid) { | 246 | public static function delete($uid) { |
2127 | 281 | 247 | ||
2128 | 248 | // Save parameter for logging purposes. | ||
2129 | 249 | $_uid = $uid; | ||
2130 | 250 | |||
2131 | 282 | // Sanitize input. | 251 | // Sanitize input. |
2132 | 283 | $uid = max(intval($uid), 0); | 252 | $uid = max(intval($uid), 0); |
2133 | 284 | 253 | ||
2134 | @@ -310,7 +279,7 @@ | |||
2135 | 310 | 279 | ||
2136 | 311 | if (!defined('TYPO3_cliMode')) { | 280 | if (!defined('TYPO3_cliMode')) { |
2137 | 312 | 281 | ||
2139 | 313 | $_message = t3lib_div::makeInstance( | 282 | $message = t3lib_div::makeInstance( |
2140 | 314 | 't3lib_FlashMessage', | 283 | 't3lib_FlashMessage', |
2141 | 315 | $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), | 284 | $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
2142 | 316 | $GLOBALS['LANG']->getLL('flash.error', TRUE), | 285 | $GLOBALS['LANG']->getLL('flash.error', TRUE), |
2143 | @@ -318,11 +287,15 @@ | |||
2144 | 318 | TRUE | 287 | TRUE |
2145 | 319 | ); | 288 | ); |
2146 | 320 | 289 | ||
2152 | 321 | t3lib_FlashMessageQueue::addMessage($_message); | 290 | t3lib_FlashMessageQueue::addMessage($message); |
2153 | 322 | 291 | ||
2154 | 323 | } | 292 | } |
2155 | 324 | 293 | ||
2156 | 325 | trigger_error('Apache Solr exception thrown: '.$e->getMessage(), E_USER_ERROR); | 294 | if (TYPO3_DLOG) { |
2157 | 295 | |||
2158 | 296 | t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Apache Solr threw exception: "'.$e->getMessage().'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2159 | 297 | |||
2160 | 298 | } | ||
2161 | 326 | 299 | ||
2162 | 327 | return 1; | 300 | return 1; |
2163 | 328 | 301 | ||
2164 | @@ -332,7 +305,7 @@ | |||
2165 | 332 | 305 | ||
2166 | 333 | if (!defined('TYPO3_cliMode')) { | 306 | if (!defined('TYPO3_cliMode')) { |
2167 | 334 | 307 | ||
2169 | 335 | $_message = t3lib_div::makeInstance( | 308 | $message = t3lib_div::makeInstance( |
2170 | 336 | 't3lib_FlashMessage', | 309 | 't3lib_FlashMessage', |
2171 | 337 | $GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE), | 310 | $GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE), |
2172 | 338 | $GLOBALS['LANG']->getLL('flash.error', TRUE), | 311 | $GLOBALS['LANG']->getLL('flash.error', TRUE), |
2173 | @@ -340,11 +313,15 @@ | |||
2174 | 340 | TRUE | 313 | TRUE |
2175 | 341 | ); | 314 | ); |
2176 | 342 | 315 | ||
2182 | 343 | t3lib_FlashMessageQueue::addMessage($_message); | 316 | t3lib_FlashMessageQueue::addMessage($message); |
2183 | 344 | 317 | ||
2184 | 345 | } | 318 | } |
2185 | 346 | 319 | ||
2186 | 347 | trigger_error('Could not connect to Apache Solr server', E_USER_ERROR); | 320 | if (TYPO3_DLOG) { |
2187 | 321 | |||
2188 | 322 | t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Could not connect to Apache Solr server', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2189 | 323 | |||
2190 | 324 | } | ||
2191 | 348 | 325 | ||
2192 | 349 | return 1; | 326 | return 1; |
2193 | 350 | 327 | ||
2194 | @@ -352,7 +329,7 @@ | |||
2195 | 352 | 329 | ||
2196 | 353 | if (!defined('TYPO3_cliMode')) { | 330 | if (!defined('TYPO3_cliMode')) { |
2197 | 354 | 331 | ||
2199 | 355 | $_message = t3lib_div::makeInstance( | 332 | $message = t3lib_div::makeInstance( |
2200 | 356 | 't3lib_FlashMessage', | 333 | 't3lib_FlashMessage', |
2201 | 357 | htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentDeleted'), $title, $uid)), | 334 | htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentDeleted'), $title, $uid)), |
2202 | 358 | $GLOBALS['LANG']->getLL('flash.done', TRUE), | 335 | $GLOBALS['LANG']->getLL('flash.done', TRUE), |
2203 | @@ -360,7 +337,7 @@ | |||
2204 | 360 | TRUE | 337 | TRUE |
2205 | 361 | ); | 338 | ); |
2206 | 362 | 339 | ||
2208 | 363 | t3lib_FlashMessageQueue::addMessage($_message); | 340 | t3lib_FlashMessageQueue::addMessage($message); |
2209 | 364 | 341 | ||
2210 | 365 | } | 342 | } |
2211 | 366 | 343 | ||
2212 | @@ -368,7 +345,11 @@ | |||
2213 | 368 | 345 | ||
2214 | 369 | } else { | 346 | } else { |
2215 | 370 | 347 | ||
2217 | 371 | trigger_error('Could not find document with UID '.$uid, E_USER_ERROR); | 348 | if (TYPO3_DLOG) { |
2218 | 349 | |||
2219 | 350 | t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Invalid UID "'.$uid.'" for document deletion', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2220 | 351 | |||
2221 | 352 | } | ||
2222 | 372 | 353 | ||
2223 | 373 | return 1; | 354 | return 1; |
2224 | 374 | 355 | ||
2225 | @@ -388,7 +369,7 @@ | |||
2226 | 388 | protected static function loadIndexConf($pid) { | 369 | protected static function loadIndexConf($pid) { |
2227 | 389 | 370 | ||
2228 | 390 | // Get the list of toplevel structures. | 371 | // Get the list of toplevel structures. |
2230 | 391 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 372 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
2231 | 392 | 'tx_dlf_structures.index_name AS index_name', | 373 | 'tx_dlf_structures.index_name AS index_name', |
2232 | 393 | 'tx_dlf_structures', | 374 | 'tx_dlf_structures', |
2233 | 394 | 'tx_dlf_structures.toplevel=1 AND tx_dlf_structures.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_structures'), | 375 | 'tx_dlf_structures.toplevel=1 AND tx_dlf_structures.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_structures'), |
2234 | @@ -397,14 +378,14 @@ | |||
2235 | 397 | '' | 378 | '' |
2236 | 398 | ); | 379 | ); |
2237 | 399 | 380 | ||
2239 | 400 | while ($_toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { | 381 | while ($toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
2240 | 401 | 382 | ||
2242 | 402 | self::$toplevel[] = $_toplevel['index_name']; | 383 | self::$toplevel[] = $toplevel['index_name']; |
2243 | 403 | 384 | ||
2244 | 404 | } | 385 | } |
2245 | 405 | 386 | ||
2246 | 406 | // Get the metadata indexing options. | 387 | // Get the metadata indexing options. |
2248 | 407 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 388 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
2249 | 408 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.tokenized AS tokenized,tx_dlf_metadata.stored AS stored,tx_dlf_metadata.indexed AS indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.autocomplete AS autocomplete,tx_dlf_metadata.boost AS boost', | 389 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.tokenized AS tokenized,tx_dlf_metadata.stored AS stored,tx_dlf_metadata.indexed AS indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.autocomplete AS autocomplete,tx_dlf_metadata.boost AS boost', |
2250 | 409 | 'tx_dlf_metadata', | 390 | 'tx_dlf_metadata', |
2251 | 410 | 'tx_dlf_metadata.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_metadata'), | 391 | 'tx_dlf_metadata.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
2252 | @@ -413,51 +394,51 @@ | |||
2253 | 413 | '' | 394 | '' |
2254 | 414 | ); | 395 | ); |
2255 | 415 | 396 | ||
2297 | 416 | while ($_indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { | 397 | while ($indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
2298 | 417 | 398 | ||
2299 | 418 | if ($_indexing['tokenized']) { | 399 | if ($indexing['tokenized']) { |
2300 | 419 | 400 | ||
2301 | 420 | self::$tokenized[] = $_indexing['index_name']; | 401 | self::$fields['tokenized'][] = $indexing['index_name']; |
2302 | 421 | 402 | ||
2303 | 422 | } | 403 | } |
2304 | 423 | 404 | ||
2305 | 424 | if ($_indexing['stored'] || $_indexing['is_listed']) { | 405 | if ($indexing['stored'] || $indexing['is_listed']) { |
2306 | 425 | 406 | ||
2307 | 426 | self::$stored[] = $_indexing['index_name']; | 407 | self::$fields['stored'][] = $indexing['index_name']; |
2308 | 427 | 408 | ||
2309 | 428 | } | 409 | } |
2310 | 429 | 410 | ||
2311 | 430 | if ($_indexing['indexed']) { | 411 | if ($indexing['indexed']) { |
2312 | 431 | 412 | ||
2313 | 432 | self::$indexed[] = $_indexing['index_name']; | 413 | self::$fields['indexed'][] = $indexing['index_name']; |
2314 | 433 | 414 | ||
2315 | 434 | } | 415 | } |
2316 | 435 | 416 | ||
2317 | 436 | if ($_indexing['is_sortable']) { | 417 | if ($indexing['is_sortable']) { |
2318 | 437 | 418 | ||
2319 | 438 | self::$sortables[] = $_indexing['index_name']; | 419 | self::$fields['sortables'][] = $indexing['index_name']; |
2320 | 439 | 420 | ||
2321 | 440 | } | 421 | } |
2322 | 441 | 422 | ||
2323 | 442 | if ($_indexing['is_facet']) { | 423 | if ($indexing['is_facet']) { |
2324 | 443 | 424 | ||
2325 | 444 | self::$facets[] = $_indexing['index_name']; | 425 | self::$fields['facets'][] = $indexing['index_name']; |
2326 | 445 | 426 | ||
2327 | 446 | } | 427 | } |
2328 | 447 | 428 | ||
2329 | 448 | if ($_indexing['autocomplete']) { | 429 | if ($indexing['autocomplete']) { |
2330 | 449 | 430 | ||
2331 | 450 | self::$autocompleted[] = $_indexing['index_name']; | 431 | self::$fields['autocompleted'][] = $indexing['index_name']; |
2332 | 451 | 432 | ||
2333 | 452 | } | 433 | } |
2334 | 453 | 434 | ||
2335 | 454 | if ($_indexing['boost'] > 0.0) { | 435 | if ($indexing['boost'] > 0.0) { |
2336 | 455 | 436 | ||
2337 | 456 | self::$fieldboost[$_indexing['index_name']] = floatval($_indexing['boost']); | 437 | self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['boost']); |
2338 | 457 | 438 | ||
2339 | 458 | } else { | 439 | } else { |
2340 | 459 | 440 | ||
2342 | 460 | self::$fieldboost[$_indexing['index_name']] = FALSE; | 441 | self::$fields['fieldboost'][$indexing['index_name']] = FALSE; |
2343 | 461 | 442 | ||
2344 | 462 | } | 443 | } |
2345 | 463 | 444 | ||
2346 | @@ -513,39 +494,39 @@ | |||
2347 | 513 | 494 | ||
2348 | 514 | $solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel)); | 495 | $solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel)); |
2349 | 515 | 496 | ||
2355 | 516 | $solrDoc->setField('type', $logicalUnit['type'], self::$fieldboost['type']); | 497 | $solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']); |
2356 | 517 | 498 | ||
2357 | 518 | $solrDoc->setField('title', $metadata['title'][0], self::$fieldboost['title']); | 499 | $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
2358 | 519 | 500 | ||
2359 | 520 | $solrDoc->setField('volume', $metadata['volume'][0], self::$fieldboost['volume']); | 501 | $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
2360 | 521 | 502 | ||
2361 | 522 | foreach ($metadata as $index_name => $data) { | 503 | foreach ($metadata as $index_name => $data) { |
2362 | 523 | 504 | ||
2363 | 524 | if (!empty($data) && substr($index_name, -8) !== '_sorting') { | 505 | if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
2364 | 525 | 506 | ||
2374 | 526 | $suffix = (in_array($index_name, self::$tokenized) ? 't' : 'u'); | 507 | $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
2375 | 527 | 508 | ||
2376 | 528 | $suffix .= (in_array($index_name, self::$stored) ? 's' : 'u'); | 509 | $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
2377 | 529 | 510 | ||
2378 | 530 | $suffix .= (in_array($index_name, self::$indexed) ? 'i' : 'u'); | 511 | $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
2379 | 531 | 512 | ||
2380 | 532 | $solrDoc->setField($index_name.'_'.$suffix, $data, self::$fieldboost[$index_name]); | 513 | $solrDoc->setField($index_name.'_'.$suffix, $data, self::$fields['fieldboost'][$index_name]); |
2381 | 533 | 514 | ||
2382 | 534 | if (in_array($index_name, self::$sortables)) { | 515 | if (in_array($index_name, self::$fields['sortables'])) { |
2383 | 535 | 516 | ||
2384 | 536 | // Add sortable fields to index. | 517 | // Add sortable fields to index. |
2385 | 537 | $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); | 518 | $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
2386 | 538 | 519 | ||
2387 | 539 | } | 520 | } |
2388 | 540 | 521 | ||
2390 | 541 | if (in_array($index_name, self::$facets)) { | 522 | if (in_array($index_name, self::$fields['facets'])) { |
2391 | 542 | 523 | ||
2392 | 543 | // Add facets to index. | 524 | // Add facets to index. |
2393 | 544 | $solrDoc->setField($index_name.'_faceting', $data); | 525 | $solrDoc->setField($index_name.'_faceting', $data); |
2394 | 545 | 526 | ||
2395 | 546 | } | 527 | } |
2396 | 547 | 528 | ||
2398 | 548 | if (in_array($index_name, self::$autocompleted)) { | 529 | if (in_array($index_name, self::$fields['autocompleted'])) { |
2399 | 549 | 530 | ||
2400 | 550 | // Add autocomplete values to index. | 531 | // Add autocomplete values to index. |
2401 | 551 | $solrDoc->setField($index_name.'_suggest', $data); | 532 | $solrDoc->setField($index_name.'_suggest', $data); |
2402 | @@ -564,7 +545,7 @@ | |||
2403 | 564 | 545 | ||
2404 | 565 | if (!defined('TYPO3_cliMode')) { | 546 | if (!defined('TYPO3_cliMode')) { |
2405 | 566 | 547 | ||
2407 | 567 | $_message = t3lib_div::makeInstance( | 548 | $message = t3lib_div::makeInstance( |
2408 | 568 | 't3lib_FlashMessage', | 549 | 't3lib_FlashMessage', |
2409 | 569 | $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), | 550 | $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
2410 | 570 | $GLOBALS['LANG']->getLL('flash.error', TRUE), | 551 | $GLOBALS['LANG']->getLL('flash.error', TRUE), |
2411 | @@ -572,7 +553,7 @@ | |||
2412 | 572 | TRUE | 553 | TRUE |
2413 | 573 | ); | 554 | ); |
2414 | 574 | 555 | ||
2416 | 575 | t3lib_FlashMessageQueue::addMessage($_message); | 556 | t3lib_FlashMessageQueue::addMessage($message); |
2417 | 576 | 557 | ||
2418 | 577 | } | 558 | } |
2419 | 578 | 559 | ||
2420 | 579 | 560 | ||
2421 | === modified file 'dlf/common/class.tx_dlf_list.php' | |||
2422 | --- dlf/common/class.tx_dlf_list.php 2012-08-06 15:19:06 +0000 | |||
2423 | +++ dlf/common/class.tx_dlf_list.php 2012-08-17 07:00:27 +0000 | |||
2424 | @@ -92,11 +92,18 @@ | |||
2425 | 92 | */ | 92 | */ |
2426 | 93 | public function remove($position) { | 93 | public function remove($position) { |
2427 | 94 | 94 | ||
2428 | 95 | // Save parameter for logging purposes. | ||
2429 | 96 | $_position = $position; | ||
2430 | 97 | |||
2431 | 95 | $position = intval($position); | 98 | $position = intval($position); |
2432 | 96 | 99 | ||
2433 | 97 | if ($position < 0 || $position >= $this->count) { | 100 | if ($position < 0 || $position >= $this->count) { |
2434 | 98 | 101 | ||
2436 | 99 | trigger_error('No valid list position for removal', E_USER_WARNING); | 102 | if (TYPO3_DLOG) { |
2437 | 103 | |||
2438 | 104 | t3lib_div::devLog('[tx_dlf_list->remove('.$_position.')] Invalid position "'.$position.'" for element removing', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
2439 | 105 | |||
2440 | 106 | } | ||
2441 | 100 | 107 | ||
2442 | 101 | return; | 108 | return; |
2443 | 102 | 109 | ||
2444 | @@ -122,12 +129,21 @@ | |||
2445 | 122 | */ | 129 | */ |
2446 | 123 | public function move($position, $steps) { | 130 | public function move($position, $steps) { |
2447 | 124 | 131 | ||
2448 | 132 | // Save parameters for logging purposes. | ||
2449 | 133 | $_position = $position; | ||
2450 | 134 | |||
2451 | 135 | $_steps = $steps; | ||
2452 | 136 | |||
2453 | 125 | $position = intval($position); | 137 | $position = intval($position); |
2454 | 126 | 138 | ||
2455 | 127 | // Check if list position is valid. | 139 | // Check if list position is valid. |
2456 | 128 | if ($position < 0 || $position >= $this->count) { | 140 | if ($position < 0 || $position >= $this->count) { |
2457 | 129 | 141 | ||
2459 | 130 | trigger_error('Invalid list position '.$position, E_USER_WARNING); | 142 | if (TYPO3_DLOG) { |
2460 | 143 | |||
2461 | 144 | t3lib_div::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid position "'.$position.'" for element moving', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
2462 | 145 | |||
2463 | 146 | } | ||
2464 | 131 | 147 | ||
2465 | 132 | return; | 148 | return; |
2466 | 133 | 149 | ||
2467 | @@ -138,7 +154,11 @@ | |||
2468 | 138 | // Check if moving given amount of steps is possible. | 154 | // Check if moving given amount of steps is possible. |
2469 | 139 | if (($position + $steps) < 0 || ($position + $steps) >= $this->count) { | 155 | if (($position + $steps) < 0 || ($position + $steps) >= $this->count) { |
2470 | 140 | 156 | ||
2472 | 141 | trigger_error('Element at position '.$position.' can not be moved '.$steps.' steps', E_USER_WARNING); | 157 | if (TYPO3_DLOG) { |
2473 | 158 | |||
2474 | 159 | t3lib_div::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid steps "'.$steps.'" for moving element at position "'.$position.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
2475 | 160 | |||
2476 | 161 | } | ||
2477 | 142 | 162 | ||
2478 | 143 | return; | 163 | return; |
2479 | 144 | 164 | ||
2480 | @@ -273,6 +293,14 @@ | |||
2481 | 273 | 293 | ||
2482 | 274 | $this->elements = $newOrder; | 294 | $this->elements = $newOrder; |
2483 | 275 | 295 | ||
2484 | 296 | } else { | ||
2485 | 297 | |||
2486 | 298 | if (TYPO3_DLOG) { | ||
2487 | 299 | |||
2488 | 300 | t3lib_div::devLog('[tx_dlf_list->sort('.$by.', ['.($asc ? 'TRUE' : 'FALSE').'])] Sorted list elements do not match unsorted elements', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2489 | 301 | |||
2490 | 302 | } | ||
2491 | 303 | |||
2492 | 276 | } | 304 | } |
2493 | 277 | 305 | ||
2494 | 278 | } | 306 | } |
2495 | @@ -400,17 +428,21 @@ | |||
2496 | 400 | */ | 428 | */ |
2497 | 401 | public function __get($var) { | 429 | public function __get($var) { |
2498 | 402 | 430 | ||
2504 | 403 | $_method = '_get'.ucfirst($var); | 431 | $method = '_get'.ucfirst($var); |
2505 | 404 | 432 | ||
2506 | 405 | if (!property_exists($this, $var) || !method_exists($this, $_method)) { | 433 | if (!property_exists($this, $var) || !method_exists($this, $method)) { |
2507 | 406 | 434 | ||
2508 | 407 | trigger_error('There is no get function for property '.$var, E_USER_ERROR); | 435 | if (TYPO3_DLOG) { |
2509 | 436 | |||
2510 | 437 | t3lib_div::devLog('[tx_dlf_list->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
2511 | 438 | |||
2512 | 439 | } | ||
2513 | 408 | 440 | ||
2514 | 409 | return; | 441 | return; |
2515 | 410 | 442 | ||
2516 | 411 | } else { | 443 | } else { |
2517 | 412 | 444 | ||
2519 | 413 | return $this->$_method(); | 445 | return $this->$method(); |
2520 | 414 | 446 | ||
2521 | 415 | } | 447 | } |
2522 | 416 | 448 | ||
2523 | @@ -428,15 +460,19 @@ | |||
2524 | 428 | */ | 460 | */ |
2525 | 429 | public function __set($var, $value) { | 461 | public function __set($var, $value) { |
2526 | 430 | 462 | ||
2532 | 431 | $_method = '_set'.ucfirst($var); | 463 | $method = '_set'.ucfirst($var); |
2533 | 432 | 464 | ||
2534 | 433 | if (!property_exists($this, $var) || !method_exists($this, $_method)) { | 465 | if (!property_exists($this, $var) || !method_exists($this, $method)) { |
2535 | 434 | 466 | ||
2536 | 435 | trigger_error('There is no set function for property '.$var, E_USER_ERROR); | 467 | if (TYPO3_DLOG) { |
2537 | 468 | |||
2538 | 469 | t3lib_div::devLog('[tx_dlf_list->__set('.$var.', '.$value.')] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING); | ||
2539 | 470 | |||
2540 | 471 | } | ||
2541 | 436 | 472 | ||
2542 | 437 | } else { | 473 | } else { |
2543 | 438 | 474 | ||
2545 | 439 | $this->$_method($value); | 475 | $this->$method($value); |
2546 | 440 | 476 | ||
2547 | 441 | } | 477 | } |
2548 | 442 | 478 | ||
2549 | 443 | 479 | ||
2550 | === modified file 'dlf/common/class.tx_dlf_mods.php' | |||
2551 | --- dlf/common/class.tx_dlf_mods.php 2012-08-07 14:39:23 +0000 | |||
2552 | +++ dlf/common/class.tx_dlf_mods.php 2012-08-17 07:00:27 +0000 | |||
2553 | @@ -107,12 +107,6 @@ | |||
2554 | 107 | 107 | ||
2555 | 108 | $metadata['author'][$i] = trim(implode(', ', $name)); | 108 | $metadata['author'][$i] = trim(implode(', ', $name)); |
2556 | 109 | 109 | ||
2557 | 110 | if (!$metadata['author_sorting'][0]) { | ||
2558 | 111 | |||
2559 | 112 | $metadata['author_sorting'][0] = trim(implode(', ', $name)); | ||
2560 | 113 | |||
2561 | 114 | } | ||
2562 | 115 | |||
2563 | 116 | } | 110 | } |
2564 | 117 | 111 | ||
2565 | 118 | // Check if there is a display form. | 112 | // Check if there is a display form. |
2566 | @@ -120,12 +114,6 @@ | |||
2567 | 120 | 114 | ||
2568 | 121 | $metadata['author'][$i] = (string) $displayForm[0]; | 115 | $metadata['author'][$i] = (string) $displayForm[0]; |
2569 | 122 | 116 | ||
2570 | 123 | if (!$metadata['author_sorting'][0]) { | ||
2571 | 124 | |||
2572 | 125 | $metadata['author_sorting'][0] = (string) $displayForm[0]; | ||
2573 | 126 | |||
2574 | 127 | } | ||
2575 | 128 | |||
2576 | 129 | } | 117 | } |
2577 | 130 | 118 | ||
2578 | 131 | } | 119 | } |
2579 | 132 | 120 | ||
2580 | === modified file 'dlf/common/class.tx_dlf_module.php' | |||
2581 | --- dlf/common/class.tx_dlf_module.php 2012-08-07 14:39:23 +0000 | |||
2582 | +++ dlf/common/class.tx_dlf_module.php 2012-08-17 07:00:27 +0000 | |||
2583 | @@ -147,13 +147,13 @@ | |||
2584 | 147 | // Set $this->MOD_MENU array here or leave empty. | 147 | // Set $this->MOD_MENU array here or leave empty. |
2585 | 148 | 148 | ||
2586 | 149 | /* Example code: | 149 | /* Example code: |
2594 | 150 | $this->MOD_MENU = array ( | 150 | $this->MOD_MENU = array ( |
2595 | 151 | 'function' => array ( | 151 | 'function' => array ( |
2596 | 152 | '1' => $GLOBALS['LANG']->getLL('function1'), | 152 | '1' => $GLOBALS['LANG']->getLL('function1'), |
2597 | 153 | '2' => $GLOBALS['LANG']->getLL('function2'), | 153 | '2' => $GLOBALS['LANG']->getLL('function2'), |
2598 | 154 | '3' => $GLOBALS['LANG']->getLL('function3'), | 154 | '3' => $GLOBALS['LANG']->getLL('function3'), |
2599 | 155 | ) | 155 | ) |
2600 | 156 | ); */ | 156 | ); */ |
2601 | 157 | 157 | ||
2602 | 158 | } | 158 | } |
2603 | 159 | 159 | ||
2604 | @@ -182,17 +182,15 @@ | |||
2605 | 182 | <script type="text/javascript"> | 182 | <script type="text/javascript"> |
2606 | 183 | script_ended = 0; | 183 | script_ended = 0; |
2607 | 184 | function jumpToUrl(URL) { | 184 | function jumpToUrl(URL) { |
2612 | 185 | document.location = URL; | 185 | document.location = URL; |
2613 | 186 | } | 186 | } |
2614 | 187 | </script> | 187 | </script>'; |
2611 | 188 | '; | ||
2615 | 189 | 188 | ||
2616 | 190 | // Add Javascript for convenient module switch. | 189 | // Add Javascript for convenient module switch. |
2617 | 191 | $this->doc->postCode .= ' | 190 | $this->doc->postCode .= ' |
2618 | 192 | <script type="text/javascript"> | 191 | <script type="text/javascript"> |
2619 | 193 | script_ended = 1; | 192 | script_ended = 1; |
2622 | 194 | </script> | 193 | </script>'; |
2621 | 195 | '; | ||
2623 | 196 | 194 | ||
2624 | 197 | // Render output. | 195 | // Render output. |
2625 | 198 | $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); | 196 | $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); |
2626 | @@ -233,7 +231,7 @@ | |||
2627 | 233 | } | 231 | } |
2628 | 234 | 232 | ||
2629 | 235 | /* No xclasses for abstract classes! | 233 | /* No xclasses for abstract classes! |
2631 | 236 | if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']) { | 234 | if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']) { |
2632 | 237 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']); | 235 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']); |
2633 | 238 | } | 236 | } |
2634 | 239 | */ | 237 | */ |
2635 | 240 | 238 | ||
2636 | === modified file 'dlf/common/class.tx_dlf_plugin.php' | |||
2637 | --- dlf/common/class.tx_dlf_plugin.php 2012-08-07 14:39:23 +0000 | |||
2638 | +++ dlf/common/class.tx_dlf_plugin.php 2012-08-17 07:00:27 +0000 | |||
2639 | @@ -155,7 +155,11 @@ | |||
2640 | 155 | if (!$this->doc->ready) { | 155 | if (!$this->doc->ready) { |
2641 | 156 | 156 | ||
2642 | 157 | // Destroy the incomplete object. | 157 | // Destroy the incomplete object. |
2644 | 158 | trigger_error('Failed to load document with UID '.$this->piVars['id'], E_USER_ERROR); | 158 | if (TYPO3_DLOG) { |
2645 | 159 | |||
2646 | 160 | t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with UID "'.$this->piVars['id'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2647 | 161 | |||
2648 | 162 | } | ||
2649 | 159 | 163 | ||
2650 | 160 | $this->doc = NULL; | 164 | $this->doc = NULL; |
2651 | 161 | 165 | ||
2652 | @@ -170,12 +174,12 @@ | |||
2653 | 170 | 174 | ||
2654 | 171 | // Get UID of document with given record identifier. | 175 | // Get UID of document with given record identifier. |
2655 | 172 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 176 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
2662 | 173 | 'tx_dlf_documents.uid', | 177 | 'tx_dlf_documents.uid', |
2663 | 174 | 'tx_dlf_documents', | 178 | 'tx_dlf_documents', |
2664 | 175 | 'tx_dlf_documents.record_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['recordId'], 'tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_documents'), | 179 | 'tx_dlf_documents.record_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['recordId'], 'tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_documents'), |
2665 | 176 | '', | 180 | '', |
2666 | 177 | '', | 181 | '', |
2667 | 178 | '1' | 182 | '1' |
2668 | 179 | ); | 183 | ); |
2669 | 180 | 184 | ||
2670 | 181 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) { | 185 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) { |
2671 | @@ -193,13 +197,21 @@ | |||
2672 | 193 | 197 | ||
2673 | 194 | } else { | 198 | } else { |
2674 | 195 | 199 | ||
2676 | 196 | trigger_error('Failed to load document with record ID '.$this->piVars['recordId'], E_USER_ERROR); | 200 | if (TYPO3_DLOG) { |
2677 | 201 | |||
2678 | 202 | t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with record ID "'.$this->piVars['recordId'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2679 | 203 | |||
2680 | 204 | } | ||
2681 | 197 | 205 | ||
2682 | 198 | } | 206 | } |
2683 | 199 | 207 | ||
2684 | 200 | } else { | 208 | } else { |
2685 | 201 | 209 | ||
2687 | 202 | trigger_error('No UID or PID given for document', E_USER_ERROR); | 210 | if (TYPO3_DLOG) { |
2688 | 211 | |||
2689 | 212 | t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Invalid UID "'.$this->piVars['id'].'" or PID "'.$this->conf['pages'].'" for document loading', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2690 | 213 | |||
2691 | 214 | } | ||
2692 | 203 | 215 | ||
2693 | 204 | } | 216 | } |
2694 | 205 | 217 | ||
2695 | @@ -304,7 +316,7 @@ | |||
2696 | 304 | } | 316 | } |
2697 | 305 | 317 | ||
2698 | 306 | /* No xclasses for abstract classes! | 318 | /* No xclasses for abstract classes! |
2700 | 307 | if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']) { | 319 | if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']) { |
2701 | 308 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']); | 320 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']); |
2702 | 309 | } | 321 | } |
2703 | 310 | */ | 322 | */ |
2704 | 311 | 323 | ||
2705 | === modified file 'dlf/common/class.tx_dlf_solr.php' | |||
2706 | --- dlf/common/class.tx_dlf_solr.php 2012-08-07 14:39:23 +0000 | |||
2707 | +++ dlf/common/class.tx_dlf_solr.php 2012-08-17 07:00:27 +0000 | |||
2708 | @@ -93,6 +93,9 @@ | |||
2709 | 93 | */ | 93 | */ |
2710 | 94 | public static function solrConnect($core = 0) { | 94 | public static function solrConnect($core = 0) { |
2711 | 95 | 95 | ||
2712 | 96 | // Save parameter for logging purposes. | ||
2713 | 97 | $_core = $core; | ||
2714 | 98 | |||
2715 | 96 | // Load class. | 99 | // Load class. |
2716 | 97 | if (!class_exists('Apache_Solr_Service')) { | 100 | if (!class_exists('Apache_Solr_Service')) { |
2717 | 98 | 101 | ||
2718 | @@ -122,7 +125,11 @@ | |||
2719 | 122 | 125 | ||
2720 | 123 | if (empty($core)) { | 126 | if (empty($core)) { |
2721 | 124 | 127 | ||
2723 | 125 | trigger_error('Could not find Solr core with UID '.$core, E_USER_NOTICE); | 128 | if (TYPO3_DLOG) { |
2724 | 129 | |||
2725 | 130 | t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Invalid UID "'.$_core.'" for Apache Solr core', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2726 | 131 | |||
2727 | 132 | } | ||
2728 | 126 | 133 | ||
2729 | 127 | return; | 134 | return; |
2730 | 128 | 135 | ||
2731 | @@ -146,7 +153,11 @@ | |||
2732 | 146 | 153 | ||
2733 | 147 | } else { | 154 | } else { |
2734 | 148 | 155 | ||
2736 | 149 | trigger_error('Could not connect to Solr server with core "'.$core.'"', E_USER_ERROR); | 156 | if (TYPO3_DLOG) { |
2737 | 157 | |||
2738 | 158 | t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Could not connect to Apache Solr server with core "'.$core.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
2739 | 159 | |||
2740 | 160 | } | ||
2741 | 150 | 161 | ||
2742 | 151 | return; | 162 | return; |
2743 | 152 | 163 | ||
2744 | @@ -191,7 +202,7 @@ | |||
2745 | 191 | } | 202 | } |
2746 | 192 | 203 | ||
2747 | 193 | /* No xclasses for static classes! | 204 | /* No xclasses for static classes! |
2749 | 194 | if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']) { | 205 | if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']) { |
2750 | 195 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']); | 206 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']); |
2751 | 196 | } | 207 | } |
2752 | 197 | */ | 208 | */ |
2753 | 198 | 209 | ||
2754 | === modified file 'dlf/ext_autoload.php' | |||
2755 | --- dlf/ext_autoload.php 2012-08-07 14:39:23 +0000 | |||
2756 | +++ dlf/ext_autoload.php 2012-08-17 07:00:27 +0000 | |||
2757 | @@ -25,36 +25,36 @@ | |||
2758 | 25 | $extensionPath = t3lib_extMgm::extPath('dlf'); | 25 | $extensionPath = t3lib_extMgm::extPath('dlf'); |
2759 | 26 | 26 | ||
2760 | 27 | return array ( | 27 | return array ( |
2791 | 28 | 'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php', | 28 | 'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php', |
2792 | 29 | 'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php', | 29 | 'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php', |
2793 | 30 | 'tx_dlf_format' => $extensionPath.'common/class.tx_dlf_format.php', | 30 | 'tx_dlf_format' => $extensionPath.'common/class.tx_dlf_format.php', |
2794 | 31 | 'tx_dlf_helper' => $extensionPath.'common/class.tx_dlf_helper.php', | 31 | 'tx_dlf_helper' => $extensionPath.'common/class.tx_dlf_helper.php', |
2795 | 32 | 'tx_dlf_indexing' => $extensionPath.'common/class.tx_dlf_indexing.php', | 32 | 'tx_dlf_indexing' => $extensionPath.'common/class.tx_dlf_indexing.php', |
2796 | 33 | 'tx_dlf_list' => $extensionPath.'common/class.tx_dlf_list.php', | 33 | 'tx_dlf_list' => $extensionPath.'common/class.tx_dlf_list.php', |
2797 | 34 | 'tx_dlf_mods' => $extensionPath.'common/class.tx_dlf_mods.php', | 34 | 'tx_dlf_mods' => $extensionPath.'common/class.tx_dlf_mods.php', |
2798 | 35 | 'tx_dlf_module' => $extensionPath.'common/class.tx_dlf_module.php', | 35 | 'tx_dlf_module' => $extensionPath.'common/class.tx_dlf_module.php', |
2799 | 36 | 'tx_dlf_plugin' => $extensionPath.'common/class.tx_dlf_plugin.php', | 36 | 'tx_dlf_plugin' => $extensionPath.'common/class.tx_dlf_plugin.php', |
2800 | 37 | 'tx_dlf_solr' => $extensionPath.'common/class.tx_dlf_solr.php', | 37 | 'tx_dlf_solr' => $extensionPath.'common/class.tx_dlf_solr.php', |
2801 | 38 | 'tx_dlf_em' => $extensionPath.'hooks/class.tx_dlf_em.php', | 38 | 'tx_dlf_em' => $extensionPath.'hooks/class.tx_dlf_em.php', |
2802 | 39 | 'tx_dlf_hacks' => $extensionPath.'hooks/class.tx_dlf_hacks.php', | 39 | 'tx_dlf_hacks' => $extensionPath.'hooks/class.tx_dlf_hacks.php', |
2803 | 40 | 'tx_dlf_tceforms' => $extensionPath.'hooks/class.tx_dlf_tceforms.php', | 40 | 'tx_dlf_tceforms' => $extensionPath.'hooks/class.tx_dlf_tceforms.php', |
2804 | 41 | 'tx_dlf_tcemain' => $extensionPath.'hooks/class.tx_dlf_tcemain.php', | 41 | 'tx_dlf_tcemain' => $extensionPath.'hooks/class.tx_dlf_tcemain.php', |
2805 | 42 | 'tx_dlf_modIndexing' => $extensionPath.'modules/indexing/index.php', | 42 | 'tx_dlf_modIndexing' => $extensionPath.'modules/indexing/index.php', |
2806 | 43 | 'tx_dlf_modNewclient' => $extensionPath.'modules/newclient/index.php', | 43 | 'tx_dlf_modNewclient' => $extensionPath.'modules/newclient/index.php', |
2807 | 44 | 'tx_dlf_collection' => $extensionPath.'plugins/collection/class.tx_dlf_collection.php', | 44 | 'tx_dlf_collection' => $extensionPath.'plugins/collection/class.tx_dlf_collection.php', |
2808 | 45 | 'tx_dlf_feeds' => $extensionPath.'plugins/feeds/class.tx_dlf_feeds.php', | 45 | 'tx_dlf_feeds' => $extensionPath.'plugins/feeds/class.tx_dlf_feeds.php', |
2809 | 46 | 'tx_dlf_listview' => $extensionPath.'plugins/listview/class.tx_dlf_listview.php', | 46 | 'tx_dlf_listview' => $extensionPath.'plugins/listview/class.tx_dlf_listview.php', |
2810 | 47 | 'tx_dlf_metadata' => $extensionPath.'plugins/metadata/class.tx_dlf_metadata.php', | 47 | 'tx_dlf_metadata' => $extensionPath.'plugins/metadata/class.tx_dlf_metadata.php', |
2811 | 48 | 'tx_dlf_navigation' => $extensionPath.'plugins/navigation/class.tx_dlf_navigation.php', | 48 | 'tx_dlf_navigation' => $extensionPath.'plugins/navigation/class.tx_dlf_navigation.php', |
2812 | 49 | 'tx_dlf_oai' => $extensionPath.'plugins/oai/class.tx_dlf_oai.php', | 49 | 'tx_dlf_oai' => $extensionPath.'plugins/oai/class.tx_dlf_oai.php', |
2813 | 50 | 'tx_dlf_pageview' => $extensionPath.'plugins/pageview/class.tx_dlf_pageview.php', | 50 | 'tx_dlf_pageview' => $extensionPath.'plugins/pageview/class.tx_dlf_pageview.php', |
2814 | 51 | 'tx_dlf_search' => $extensionPath.'plugins/search/class.tx_dlf_search.php', | 51 | 'tx_dlf_search' => $extensionPath.'plugins/search/class.tx_dlf_search.php', |
2815 | 52 | 'tx_dlf_search_suggest' => $extensionPath.'plugins/search/class.tx_dlf_search_suggest.php', | 52 | 'tx_dlf_search_suggest' => $extensionPath.'plugins/search/class.tx_dlf_search_suggest.php', |
2816 | 53 | 'tx_dlf_statistics' => $extensionPath.'plugins/statistics/class.tx_dlf_statistics.php', | 53 | 'tx_dlf_statistics' => $extensionPath.'plugins/statistics/class.tx_dlf_statistics.php', |
2817 | 54 | 'tx_dlf_toc' => $extensionPath.'plugins/toc/class.tx_dlf_toc.php', | 54 | 'tx_dlf_toc' => $extensionPath.'plugins/toc/class.tx_dlf_toc.php', |
2818 | 55 | 'tx_dlf_toolbox' => $extensionPath.'plugins/toolbox/class.tx_dlf_toolbox.php', | 55 | 'tx_dlf_toolbox' => $extensionPath.'plugins/toolbox/class.tx_dlf_toolbox.php', |
2819 | 56 | 'tx_dlf_toolsDfgviewer' => $extensionPath.'plugins/toolbox/tools/dfgviewer/class.tx_dlf_toolsDfgviewer.php', | 56 | 'tx_dlf_toolsDfgviewer' => $extensionPath.'plugins/toolbox/tools/dfgviewer/class.tx_dlf_toolsDfgviewer.php', |
2820 | 57 | 'tx_dlf_toolsPdf' => $extensionPath.'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php' | 57 | 'tx_dlf_toolsPdf' => $extensionPath.'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php' |
2821 | 58 | ); | 58 | ); |
2822 | 59 | 59 | ||
2823 | 60 | ?> | 60 | ?> |
2824 | 61 | \ No newline at end of file | 61 | \ No newline at end of file |
2825 | 62 | 62 | ||
2826 | === modified file 'dlf/ext_emconf.php' | |||
2827 | --- dlf/ext_emconf.php 2012-08-09 12:13:34 +0000 | |||
2828 | +++ dlf/ext_emconf.php 2012-08-17 07:00:27 +0000 | |||
2829 | @@ -23,6 +23,7 @@ | |||
2830 | 23 | ***************************************************************/ | 23 | ***************************************************************/ |
2831 | 24 | 24 | ||
2832 | 25 | $EM_CONF[$_EXTKEY] = array( | 25 | $EM_CONF[$_EXTKEY] = array( |
2833 | 26 | <<<<<<< TREE | ||
2834 | 26 | 'title' => 'Goobi.Presentation', | 27 | 'title' => 'Goobi.Presentation', |
2835 | 27 | 'description' => 'Base plugins, modules, services and API of the Digital Library Framework. It is part of the community-based Goobi Digitization Suite.', | 28 | 'description' => 'Base plugins, modules, services and API of the Digital Library Framework. It is part of the community-based Goobi Digitization Suite.', |
2836 | 28 | 'category' => 'fe', | 29 | 'category' => 'fe', |
2837 | @@ -53,6 +54,38 @@ | |||
2838 | 53 | ), | 54 | ), |
2839 | 54 | ), | 55 | ), |
2840 | 55 | '_md5_values_when_last_written' => '', | 56 | '_md5_values_when_last_written' => '', |
2841 | 57 | ======= | ||
2842 | 58 | 'title' => 'Goobi.Presentation', | ||
2843 | 59 | 'description' => 'Base plugins, modules, services and API of the Digital Library Framework. It is part of the community-based Goobi Digitization Suite.', | ||
2844 | 60 | 'category' => 'fe', | ||
2845 | 61 | 'author' => 'Sebastian Meyer', | ||
2846 | 62 | 'author_email' => 'sebastian.meyer@slub-dresden.de', | ||
2847 | 63 | 'author_company' => '<br /><a href="http://www.slub-dresden.de/en/" target="_blank">Saxon State and University Library Dresden</a><br /><a href="https://launchpad.net/goobi" target="_blank">The Goobi Community</a>', | ||
2848 | 64 | 'shy' => '', | ||
2849 | 65 | 'priority' => '', | ||
2850 | 66 | 'module' => '', | ||
2851 | 67 | 'state' => 'stable', | ||
2852 | 68 | 'internal' => '', | ||
2853 | 69 | 'uploadfolder' => TRUE, | ||
2854 | 70 | 'createDirs' => '', | ||
2855 | 71 | 'modify_tables' => '', | ||
2856 | 72 | 'clearCacheOnLoad' => FALSE, | ||
2857 | 73 | 'lockType' => '', | ||
2858 | 74 | 'version' => '1.1.3', | ||
2859 | 75 | 'constraints' => array( | ||
2860 | 76 | 'depends' => array( | ||
2861 | 77 | 'php' => '5.3.0-', | ||
2862 | 78 | 'typo3' => '4.5.0-', | ||
2863 | 79 | ), | ||
2864 | 80 | 'conflicts' => array( | ||
2865 | 81 | ), | ||
2866 | 82 | 'suggests' => array( | ||
2867 | 83 | 'realurl' => '', | ||
2868 | 84 | 't3jquery' => '', | ||
2869 | 85 | ), | ||
2870 | 86 | ), | ||
2871 | 87 | '_md5_values_when_last_written' => '', | ||
2872 | 88 | >>>>>>> MERGE-SOURCE | ||
2873 | 56 | ); | 89 | ); |
2874 | 57 | 90 | ||
2875 | 58 | ?> | 91 | ?> |
2876 | 59 | \ No newline at end of file | 92 | \ No newline at end of file |
2877 | 60 | 93 | ||
2878 | === modified file 'dlf/ext_tables.php' | |||
2879 | --- dlf/ext_tables.php 2012-08-07 14:39:23 +0000 | |||
2880 | +++ dlf/ext_tables.php 2012-08-17 07:00:27 +0000 | |||
2881 | @@ -26,173 +26,174 @@ | |||
2882 | 26 | 26 | ||
2883 | 27 | // Register database tables. | 27 | // Register database tables. |
2884 | 28 | $TCA['tx_dlf_documents'] = array ( | 28 | $TCA['tx_dlf_documents'] = array ( |
2902 | 29 | 'ctrl' => array ( | 29 | 'ctrl' => array ( |
2903 | 30 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents', | 30 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents', |
2904 | 31 | 'label' => 'title', | 31 | 'label' => 'title', |
2905 | 32 | 'tstamp' => 'tstamp', | 32 | 'tstamp' => 'tstamp', |
2906 | 33 | 'crdate' => 'crdate', | 33 | 'crdate' => 'crdate', |
2907 | 34 | 'cruser_id' => 'cruser_id', | 34 | 'cruser_id' => 'cruser_id', |
2908 | 35 | 'default_sortby' => 'ORDER BY title_sorting', | 35 | 'default_sortby' => 'ORDER BY title_sorting', |
2909 | 36 | 'delete' => 'deleted', | 36 | 'delete' => 'deleted', |
2910 | 37 | 'enablecolumns' => array ( | 37 | 'enablecolumns' => array ( |
2911 | 38 | 'disabled' => 'hidden', | 38 | 'disabled' => 'hidden', |
2912 | 39 | 'fe_group' => 'fe_group', | 39 | 'starttime' => 'starttime', |
2913 | 40 | ), | 40 | 'endtime' => 'endtime', |
2914 | 41 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', | 41 | 'fe_group' => 'fe_group', |
2898 | 42 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfdocuments.png', | ||
2899 | 43 | 'rootLevel' => 0, | ||
2900 | 44 | 'dividers2tabs' => 2, | ||
2901 | 45 | 'searchFields' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn', | ||
2915 | 46 | ), | 42 | ), |
2919 | 47 | 'feInterface' => array ( | 43 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', |
2920 | 48 | 'fe_admin_fieldList' => '', | 44 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfdocuments.png', |
2921 | 49 | ) | 45 | 'rootLevel' => 0, |
2922 | 46 | 'dividers2tabs' => 2, | ||
2923 | 47 | 'searchFields' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn', | ||
2924 | 48 | ), | ||
2925 | 49 | 'feInterface' => array ( | ||
2926 | 50 | 'fe_admin_fieldList' => '', | ||
2927 | 51 | ) | ||
2928 | 50 | ); | 52 | ); |
2929 | 51 | 53 | ||
2930 | 52 | $TCA['tx_dlf_structures'] = array ( | 54 | $TCA['tx_dlf_structures'] = array ( |
2950 | 53 | 'ctrl' => array ( | 55 | 'ctrl' => array ( |
2951 | 54 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures', | 56 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures', |
2952 | 55 | 'label' => 'label', | 57 | 'label' => 'label', |
2953 | 56 | 'tstamp' => 'tstamp', | 58 | 'tstamp' => 'tstamp', |
2954 | 57 | 'crdate' => 'crdate', | 59 | 'crdate' => 'crdate', |
2955 | 58 | 'cruser_id' => 'cruser_id', | 60 | 'cruser_id' => 'cruser_id', |
2956 | 59 | 'languageField' => 'sys_language_uid', | 61 | 'languageField' => 'sys_language_uid', |
2957 | 60 | 'transOrigPointerField' => 'l18n_parent', | 62 | 'transOrigPointerField' => 'l18n_parent', |
2958 | 61 | 'transOrigDiffSourceField' => 'l18n_diffsource', | 63 | 'transOrigDiffSourceField' => 'l18n_diffsource', |
2959 | 62 | 'default_sortby' => 'ORDER BY label', | 64 | 'default_sortby' => 'ORDER BY label', |
2960 | 63 | 'delete' => 'deleted', | 65 | 'delete' => 'deleted', |
2961 | 64 | 'enablecolumns' => array ( | 66 | 'enablecolumns' => array ( |
2962 | 65 | 'disabled' => 'hidden', | 67 | 'disabled' => 'hidden', |
2944 | 66 | ), | ||
2945 | 67 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', | ||
2946 | 68 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfstructures.png', | ||
2947 | 69 | 'rootLevel' => 0, | ||
2948 | 70 | 'dividers2tabs' => 2, | ||
2949 | 71 | 'searchFields' => 'label,index_name,oai_name', | ||
2963 | 72 | ), | 68 | ), |
2967 | 73 | 'feInterface' => array ( | 69 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', |
2968 | 74 | 'fe_admin_fieldList' => '', | 70 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfstructures.png', |
2969 | 75 | ) | 71 | 'rootLevel' => 0, |
2970 | 72 | 'dividers2tabs' => 2, | ||
2971 | 73 | 'searchFields' => 'label,index_name,oai_name', | ||
2972 | 74 | ), | ||
2973 | 75 | 'feInterface' => array ( | ||
2974 | 76 | 'fe_admin_fieldList' => '', | ||
2975 | 77 | ) | ||
2976 | 76 | ); | 78 | ); |
2977 | 77 | 79 | ||
2978 | 78 | $TCA['tx_dlf_metadata'] = array ( | 80 | $TCA['tx_dlf_metadata'] = array ( |
2999 | 79 | 'ctrl' => array ( | 81 | 'ctrl' => array ( |
3000 | 80 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata', | 82 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata', |
3001 | 81 | 'label' => 'label', | 83 | 'label' => 'label', |
3002 | 82 | 'tstamp' => 'tstamp', | 84 | 'tstamp' => 'tstamp', |
3003 | 83 | 'crdate' => 'crdate', | 85 | 'crdate' => 'crdate', |
3004 | 84 | 'cruser_id' => 'cruser_id', | 86 | 'cruser_id' => 'cruser_id', |
3005 | 85 | 'languageField' => 'sys_language_uid', | 87 | 'languageField' => 'sys_language_uid', |
3006 | 86 | 'transOrigPointerField' => 'l18n_parent', | 88 | 'transOrigPointerField' => 'l18n_parent', |
3007 | 87 | 'transOrigDiffSourceField' => 'l18n_diffsource', | 89 | 'transOrigDiffSourceField' => 'l18n_diffsource', |
3008 | 88 | 'sortby' => 'sorting', | 90 | 'sortby' => 'sorting', |
3009 | 89 | 'delete' => 'deleted', | 91 | 'delete' => 'deleted', |
3010 | 90 | 'enablecolumns' => array ( | 92 | 'enablecolumns' => array ( |
3011 | 91 | 'disabled' => 'hidden', | 93 | 'disabled' => 'hidden', |
2992 | 92 | ), | ||
2993 | 93 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', | ||
2994 | 94 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfmetadata.png', | ||
2995 | 95 | 'rootLevel' => 0, | ||
2996 | 96 | 'dividers2tabs' => 2, | ||
2997 | 97 | 'searchFields' => 'label,index_name,encoding,xpath,xpath_sorting,default', | ||
2998 | 98 | 'requestUpdate' => 'is_sortable', | ||
3012 | 99 | ), | 94 | ), |
3016 | 100 | 'feInterface' => array ( | 95 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', |
3017 | 101 | 'fe_admin_fieldList' => '', | 96 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfmetadata.png', |
3018 | 102 | ) | 97 | 'rootLevel' => 0, |
3019 | 98 | 'dividers2tabs' => 2, | ||
3020 | 99 | 'searchFields' => 'label,index_name,encoding,xpath,xpath_sorting,default', | ||
3021 | 100 | 'requestUpdate' => 'is_sortable', | ||
3022 | 101 | ), | ||
3023 | 102 | 'feInterface' => array ( | ||
3024 | 103 | 'fe_admin_fieldList' => '', | ||
3025 | 104 | ) | ||
3026 | 103 | ); | 105 | ); |
3027 | 104 | 106 | ||
3028 | 105 | $TCA['tx_dlf_formats'] = array ( | 107 | $TCA['tx_dlf_formats'] = array ( |
3046 | 106 | 'ctrl' => array ( | 108 | 'ctrl' => array ( |
3047 | 107 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats', | 109 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats', |
3048 | 108 | 'label' => 'type', | 110 | 'label' => 'type', |
3049 | 109 | 'tstamp' => 'tstamp', | 111 | 'tstamp' => 'tstamp', |
3050 | 110 | 'crdate' => 'crdate', | 112 | 'crdate' => 'crdate', |
3051 | 111 | 'cruser_id' => 'cruser_id', | 113 | 'cruser_id' => 'cruser_id', |
3052 | 112 | 'default_sortby' => 'ORDER BY type', | 114 | 'default_sortby' => 'ORDER BY type', |
3053 | 113 | 'delete' => 'deleted', | 115 | 'delete' => 'deleted', |
3054 | 114 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', | 116 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', |
3055 | 115 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfformats.png', | 117 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfformats.png', |
3056 | 116 | 'rootLevel' => 1, | 118 | 'rootLevel' => 1, |
3057 | 117 | 'dividers2tabs' => 2, | 119 | 'dividers2tabs' => 2, |
3058 | 118 | 'searchFields' => 'type,class', | 120 | 'searchFields' => 'type,class', |
3059 | 119 | ), | 121 | ), |
3060 | 120 | 'feInterface' => array ( | 122 | 'feInterface' => array ( |
3061 | 121 | 'fe_admin_fieldList' => '', | 123 | 'fe_admin_fieldList' => '', |
3062 | 122 | ) | 124 | ) |
3063 | 123 | ); | 125 | ); |
3064 | 124 | 126 | ||
3065 | 125 | $TCA['tx_dlf_solrcores'] = array ( | 127 | $TCA['tx_dlf_solrcores'] = array ( |
3084 | 126 | 'ctrl' => array ( | 128 | 'ctrl' => array ( |
3085 | 127 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_solrcores', | 129 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_solrcores', |
3086 | 128 | 'label' => 'label', | 130 | 'label' => 'label', |
3087 | 129 | 'tstamp' => 'tstamp', | 131 | 'tstamp' => 'tstamp', |
3088 | 130 | 'crdate' => 'crdate', | 132 | 'crdate' => 'crdate', |
3089 | 131 | 'cruser_id' => 'cruser_id', | 133 | 'cruser_id' => 'cruser_id', |
3090 | 132 | 'default_sortby' => 'ORDER BY label', | 134 | 'default_sortby' => 'ORDER BY label', |
3091 | 133 | 'delete' => 'deleted', | 135 | 'delete' => 'deleted', |
3092 | 134 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', | 136 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', |
3093 | 135 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfsolrcores.png', | 137 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfsolrcores.png', |
3094 | 136 | 'rootLevel' => -1, | 138 | 'rootLevel' => -1, |
3095 | 137 | 'adminOnly' => 1, | 139 | 'dividers2tabs' => 2, |
3096 | 138 | 'dividers2tabs' => 2, | 140 | 'searchFields' => 'label,index_name', |
3097 | 139 | 'searchFields' => 'label,index_name', | 141 | ), |
3098 | 140 | ), | 142 | 'feInterface' => array ( |
3099 | 141 | 'feInterface' => array ( | 143 | 'fe_admin_fieldList' => '', |
3100 | 142 | 'fe_admin_fieldList' => '', | 144 | ) |
3083 | 143 | ) | ||
3101 | 144 | ); | 145 | ); |
3102 | 145 | 146 | ||
3103 | 146 | $TCA['tx_dlf_collections'] = array ( | 147 | $TCA['tx_dlf_collections'] = array ( |
3126 | 147 | 'ctrl' => array ( | 148 | 'ctrl' => array ( |
3127 | 148 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_collections', | 149 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_collections', |
3128 | 149 | 'label' => 'label', | 150 | 'label' => 'label', |
3129 | 150 | 'tstamp' => 'tstamp', | 151 | 'tstamp' => 'tstamp', |
3130 | 151 | 'crdate' => 'crdate', | 152 | 'crdate' => 'crdate', |
3131 | 152 | 'cruser_id' => 'cruser_id', | 153 | 'cruser_id' => 'cruser_id', |
3132 | 153 | 'fe_cruser_id' => 'fe_cruser_id', | 154 | 'fe_cruser_id' => 'fe_cruser_id', |
3133 | 154 | 'fe_admin_lock' => 'fe_admin_lock', | 155 | 'fe_admin_lock' => 'fe_admin_lock', |
3134 | 155 | 'languageField' => 'sys_language_uid', | 156 | 'languageField' => 'sys_language_uid', |
3135 | 156 | 'transOrigPointerField' => 'l18n_parent', | 157 | 'transOrigPointerField' => 'l18n_parent', |
3136 | 157 | 'transOrigDiffSourceField' => 'l18n_diffsource', | 158 | 'transOrigDiffSourceField' => 'l18n_diffsource', |
3137 | 158 | 'default_sortby' => 'ORDER BY label', | 159 | 'default_sortby' => 'ORDER BY label', |
3138 | 159 | 'delete' => 'deleted', | 160 | 'delete' => 'deleted', |
3139 | 160 | 'enablecolumns' => array ( | 161 | 'enablecolumns' => array ( |
3140 | 161 | 'disabled' => 'hidden', | 162 | 'disabled' => 'hidden', |
3141 | 162 | 'fe_group' => 'fe_group', | 163 | 'fe_group' => 'fe_group', |
3120 | 163 | ), | ||
3121 | 164 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', | ||
3122 | 165 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfcollections.png', | ||
3123 | 166 | 'rootLevel' => 0, | ||
3124 | 167 | 'dividers2tabs' => 2, | ||
3125 | 168 | 'searchFields' => 'label,index_name,oai_name,fe_cruser_id', | ||
3142 | 169 | ), | 164 | ), |
3146 | 170 | 'feInterface' => array ( | 165 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', |
3147 | 171 | 'fe_admin_fieldList' => 'label,description,documents', | 166 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfcollections.png', |
3148 | 172 | ) | 167 | 'rootLevel' => 0, |
3149 | 168 | 'dividers2tabs' => 2, | ||
3150 | 169 | 'searchFields' => 'label,index_name,oai_name,fe_cruser_id', | ||
3151 | 170 | ), | ||
3152 | 171 | 'feInterface' => array ( | ||
3153 | 172 | 'fe_admin_fieldList' => 'label,description,documents', | ||
3154 | 173 | ) | ||
3155 | 173 | ); | 174 | ); |
3156 | 174 | 175 | ||
3157 | 175 | $TCA['tx_dlf_libraries'] = array ( | 176 | $TCA['tx_dlf_libraries'] = array ( |
3178 | 176 | 'ctrl' => array ( | 177 | 'ctrl' => array ( |
3179 | 177 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_libraries', | 178 | 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_libraries', |
3180 | 178 | 'label' => 'label', | 179 | 'label' => 'label', |
3181 | 179 | 'tstamp' => 'tstamp', | 180 | 'tstamp' => 'tstamp', |
3182 | 180 | 'crdate' => 'crdate', | 181 | 'crdate' => 'crdate', |
3183 | 181 | 'cruser_id' => 'cruser_id', | 182 | 'cruser_id' => 'cruser_id', |
3184 | 182 | 'languageField' => 'sys_language_uid', | 183 | 'languageField' => 'sys_language_uid', |
3185 | 183 | 'transOrigPointerField' => 'l18n_parent', | 184 | 'transOrigPointerField' => 'l18n_parent', |
3186 | 184 | 'transOrigDiffSourceField' => 'l18n_diffsource', | 185 | 'transOrigDiffSourceField' => 'l18n_diffsource', |
3187 | 185 | 'default_sortby' => 'ORDER BY label', | 186 | 'default_sortby' => 'ORDER BY label', |
3188 | 186 | 'delete' => 'deleted', | 187 | 'delete' => 'deleted', |
3189 | 187 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', | 188 | 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php', |
3190 | 188 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlflibraries.png', | 189 | 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlflibraries.png', |
3191 | 189 | 'rootLevel' => 0, | 190 | 'rootLevel' => 0, |
3192 | 190 | 'dividers2tabs' => 2, | 191 | 'dividers2tabs' => 2, |
3193 | 191 | 'searchFields' => 'label,website,contact', | 192 | 'searchFields' => 'label,website,contact', |
3194 | 192 | ), | 193 | ), |
3195 | 193 | 'feInterface' => array ( | 194 | 'feInterface' => array ( |
3196 | 194 | 'fe_admin_fieldList' => '', | 195 | 'fe_admin_fieldList' => '', |
3197 | 195 | ) | 196 | ) |
3198 | 196 | ); | 197 | ); |
3199 | 197 | 198 | ||
3200 | 198 | // Register static typoscript. | 199 | // Register static typoscript. |
3201 | 199 | 200 | ||
3202 | === modified file 'dlf/ext_tables.sql' | |||
3203 | --- dlf/ext_tables.sql 2012-08-09 10:31:57 +0000 | |||
3204 | +++ dlf/ext_tables.sql 2012-08-17 07:00:27 +0000 | |||
3205 | @@ -9,6 +9,8 @@ | |||
3206 | 9 | cruser_id int(11) DEFAULT '0' NOT NULL, | 9 | cruser_id int(11) DEFAULT '0' NOT NULL, |
3207 | 10 | deleted tinyint(4) DEFAULT '0' NOT NULL, | 10 | deleted tinyint(4) DEFAULT '0' NOT NULL, |
3208 | 11 | hidden tinyint(4) DEFAULT '0' NOT NULL, | 11 | hidden tinyint(4) DEFAULT '0' NOT NULL, |
3209 | 12 | starttime int(11) DEFAULT '0' NOT NULL, | ||
3210 | 13 | endtime int(11) DEFAULT '0' NOT NULL, | ||
3211 | 12 | fe_group varchar(100) DEFAULT '' NOT NULL, | 14 | fe_group varchar(100) DEFAULT '' NOT NULL, |
3212 | 13 | prod_id tinytext NOT NULL, | 15 | prod_id tinytext NOT NULL, |
3213 | 14 | location text NOT NULL, | 16 | location text NOT NULL, |
3214 | @@ -109,7 +111,6 @@ | |||
3215 | 109 | cruser_id int(11) DEFAULT '0' NOT NULL, | 111 | cruser_id int(11) DEFAULT '0' NOT NULL, |
3216 | 110 | deleted tinyint(4) DEFAULT '0' NOT NULL, | 112 | deleted tinyint(4) DEFAULT '0' NOT NULL, |
3217 | 111 | type tinytext NOT NULL, | 113 | type tinytext NOT NULL, |
3218 | 112 | other_type tinyint(4) DEFAULT '0' NOT NULL, | ||
3219 | 113 | root tinytext NOT NULL, | 114 | root tinytext NOT NULL, |
3220 | 114 | namespace text NOT NULL, | 115 | namespace text NOT NULL, |
3221 | 115 | class text NOT NULL, | 116 | class text NOT NULL, |
3222 | 116 | 117 | ||
3223 | === modified file 'dlf/ext_tables_static+adt.sql' | |||
3224 | --- dlf/ext_tables_static+adt.sql 2012-04-30 16:05:21 +0000 | |||
3225 | +++ dlf/ext_tables_static+adt.sql 2012-08-17 07:00:27 +0000 | |||
3226 | @@ -9,7 +9,6 @@ | |||
3227 | 9 | cruser_id int(11) DEFAULT '0' NOT NULL, | 9 | cruser_id int(11) DEFAULT '0' NOT NULL, |
3228 | 10 | deleted tinyint(4) DEFAULT '0' NOT NULL, | 10 | deleted tinyint(4) DEFAULT '0' NOT NULL, |
3229 | 11 | type tinytext NOT NULL, | 11 | type tinytext NOT NULL, |
3230 | 12 | other_type tinyint(4) DEFAULT '0' NOT NULL, | ||
3231 | 13 | root tinytext NOT NULL, | 12 | root tinytext NOT NULL, |
3232 | 14 | namespace text NOT NULL, | 13 | namespace text NOT NULL, |
3233 | 15 | class text NOT NULL, | 14 | class text NOT NULL, |
3234 | @@ -18,4 +17,4 @@ | |||
3235 | 18 | KEY parent (pid) | 17 | KEY parent (pid) |
3236 | 19 | ); | 18 | ); |
3237 | 20 | 19 | ||
3239 | 21 | INSERT INTO tx_dlf_formats VALUES ('1', '0', '0', '0', '0', '0', 'MODS', '0', 'mods', 'http://www.loc.gov/mods/v3', 'tx_dlf_mods'); | 20 | INSERT INTO tx_dlf_formats VALUES ('1', '0', '0', '0', '0', '0', 'MODS', 'mods', 'http://www.loc.gov/mods/v3', 'tx_dlf_mods'); |
3240 | 22 | 21 | ||
3241 | === modified file 'dlf/hooks/class.tx_dlf_em.php' | |||
3242 | --- dlf/hooks/class.tx_dlf_em.php 2012-08-07 14:39:23 +0000 | |||
3243 | +++ dlf/hooks/class.tx_dlf_em.php 2012-08-17 07:00:27 +0000 | |||
3244 | @@ -84,10 +84,10 @@ | |||
3245 | 84 | $url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores'; | 84 | $url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores'; |
3246 | 85 | 85 | ||
3247 | 86 | $context = stream_context_create(array ( | 86 | $context = stream_context_create(array ( |
3252 | 87 | 'http' => array ( | 87 | 'http' => array ( |
3253 | 88 | 'method' => 'GET', | 88 | 'method' => 'GET', |
3254 | 89 | 'user_agent' => (!empty($conf['useragent']) ? $conf['useragent'] : ini_get('user_agent')) | 89 | 'user_agent' => (!empty($conf['useragent']) ? $conf['useragent'] : ini_get('user_agent')) |
3255 | 90 | ) | 90 | ) |
3256 | 91 | )); | 91 | )); |
3257 | 92 | 92 | ||
3258 | 93 | // Try to connect to Solr server. | 93 | // Try to connect to Solr server. |
3259 | @@ -101,11 +101,11 @@ | |||
3260 | 101 | if (is_array($status)) { | 101 | if (is_array($status)) { |
3261 | 102 | 102 | ||
3262 | 103 | $message = t3lib_div::makeInstance( | 103 | $message = t3lib_div::makeInstance( |
3268 | 104 | 't3lib_FlashMessage', | 104 | 't3lib_FlashMessage', |
3269 | 105 | sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]), | 105 | sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]), |
3270 | 106 | $GLOBALS['LANG']->getLL('solr.connected'), | 106 | $GLOBALS['LANG']->getLL('solr.connected'), |
3271 | 107 | ($status[0] == 0 ? t3lib_FlashMessage::OK : t3lib_FlashMessage::WARNING), | 107 | ($status[0] == 0 ? t3lib_FlashMessage::OK : t3lib_FlashMessage::WARNING), |
3272 | 108 | FALSE | 108 | FALSE |
3273 | 109 | ); | 109 | ); |
3274 | 110 | 110 | ||
3275 | 111 | $this->content .= $message->render(); | 111 | $this->content .= $message->render(); |
3276 | @@ -117,11 +117,11 @@ | |||
3277 | 117 | } | 117 | } |
3278 | 118 | 118 | ||
3279 | 119 | $message = t3lib_div::makeInstance( | 119 | $message = t3lib_div::makeInstance( |
3285 | 120 | 't3lib_FlashMessage', | 120 | 't3lib_FlashMessage', |
3286 | 121 | sprintf($GLOBALS['LANG']->getLL('solr.error'), $url), | 121 | sprintf($GLOBALS['LANG']->getLL('solr.error'), $url), |
3287 | 122 | $GLOBALS['LANG']->getLL('solr.notConnected'), | 122 | $GLOBALS['LANG']->getLL('solr.notConnected'), |
3288 | 123 | t3lib_FlashMessage::WARNING, | 123 | t3lib_FlashMessage::WARNING, |
3289 | 124 | FALSE | 124 | FALSE |
3290 | 125 | ); | 125 | ); |
3291 | 126 | 126 | ||
3292 | 127 | $this->content .= $message->render(); | 127 | $this->content .= $message->render(); |
3293 | @@ -147,9 +147,9 @@ | |||
3294 | 147 | 147 | ||
3295 | 148 | // Check if user "_cli_dlf" exists, is no admin and is not disabled. | 148 | // Check if user "_cli_dlf" exists, is no admin and is not disabled. |
3296 | 149 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 149 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
3300 | 150 | 'uid,admin,usergroup', | 150 | 'uid,admin,usergroup', |
3301 | 151 | 'be_users', | 151 | 'be_users', |
3302 | 152 | 'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_users').t3lib_BEfunc::deleteClause('be_users') | 152 | 'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_users').t3lib_BEfunc::deleteClause('be_users') |
3303 | 153 | ); | 153 | ); |
3304 | 154 | 154 | ||
3305 | 155 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { | 155 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { |
3306 | @@ -160,25 +160,25 @@ | |||
3307 | 160 | $resArray['usergroup'] = explode(',', $resArray['usergroup']); | 160 | $resArray['usergroup'] = explode(',', $resArray['usergroup']); |
3308 | 161 | 161 | ||
3309 | 162 | // Check if user is not disabled. | 162 | // Check if user is not disabled. |
3314 | 163 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 163 | $result2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
3315 | 164 | '1', | 164 | '1', |
3316 | 165 | 'be_users', | 165 | 'be_users', |
3317 | 166 | 'uid='.intval($resArray['uid']).t3lib_BEfunc::BEenableFields('be_users') | 166 | 'uid='.intval($resArray['uid']).t3lib_BEfunc::BEenableFields('be_users') |
3318 | 167 | ); | 167 | ); |
3319 | 168 | 168 | ||
3320 | 169 | // Check if user is configured properly. | 169 | // Check if user is configured properly. |
3321 | 170 | if (count(array_diff(array ($groupUid), $resArray['usergroup'])) == 0 | 170 | if (count(array_diff(array ($groupUid), $resArray['usergroup'])) == 0 |
3322 | 171 | && !$resArray['admin'] | 171 | && !$resArray['admin'] |
3324 | 172 | && $GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) { | 172 | && $GLOBALS['TYPO3_DB']->sql_num_rows($result2) > 0) { |
3325 | 173 | 173 | ||
3326 | 174 | $usrUid = $resArray['uid']; | 174 | $usrUid = $resArray['uid']; |
3327 | 175 | 175 | ||
3328 | 176 | $message = t3lib_div::makeInstance( | 176 | $message = t3lib_div::makeInstance( |
3334 | 177 | 't3lib_FlashMessage', | 177 | 't3lib_FlashMessage', |
3335 | 178 | $GLOBALS['LANG']->getLL('cliUserGroup.usrOkayMsg'), | 178 | $GLOBALS['LANG']->getLL('cliUserGroup.usrOkayMsg'), |
3336 | 179 | $GLOBALS['LANG']->getLL('cliUserGroup.usrOkay'), | 179 | $GLOBALS['LANG']->getLL('cliUserGroup.usrOkay'), |
3337 | 180 | t3lib_FlashMessage::OK, | 180 | t3lib_FlashMessage::OK, |
3338 | 181 | FALSE | 181 | FALSE |
3339 | 182 | ); | 182 | ); |
3340 | 183 | 183 | ||
3341 | 184 | } else { | 184 | } else { |
3342 | @@ -186,15 +186,15 @@ | |||
3343 | 186 | if (!$checkOnly && $groupUid) { | 186 | if (!$checkOnly && $groupUid) { |
3344 | 187 | 187 | ||
3345 | 188 | // Keep exisiting values and add the new ones. | 188 | // Keep exisiting values and add the new ones. |
3347 | 189 | $_usergroup = array_unique(array_merge(array ($groupUid), $resArray['usergroup'])); | 189 | $usergroup = array_unique(array_merge(array ($groupUid), $resArray['usergroup'])); |
3348 | 190 | 190 | ||
3349 | 191 | // Try to configure user. | 191 | // Try to configure user. |
3350 | 192 | $data['be_users'][$resArray['uid']] = array ( | 192 | $data['be_users'][$resArray['uid']] = array ( |
3356 | 193 | 'admin' => 0, | 193 | 'admin' => 0, |
3357 | 194 | 'usergroup' => implode(',', $_usergroup), | 194 | 'usergroup' => implode(',', $usergroup), |
3358 | 195 | $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['disabled'] => 0, | 195 | $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['disabled'] => 0, |
3359 | 196 | $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['starttime'] => 0, | 196 | $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['starttime'] => 0, |
3360 | 197 | $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['endtime'] => 0 | 197 | $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['endtime'] => 0 |
3361 | 198 | ); | 198 | ); |
3362 | 199 | 199 | ||
3363 | 200 | tx_dlf_helper::processDB($data); | 200 | tx_dlf_helper::processDB($data); |
3364 | @@ -205,33 +205,33 @@ | |||
3365 | 205 | $usrUid = $resArray['uid']; | 205 | $usrUid = $resArray['uid']; |
3366 | 206 | 206 | ||
3367 | 207 | $message = t3lib_div::makeInstance( | 207 | $message = t3lib_div::makeInstance( |
3373 | 208 | 't3lib_FlashMessage', | 208 | 't3lib_FlashMessage', |
3374 | 209 | $GLOBALS['LANG']->getLL('cliUserGroup.usrConfiguredMsg'), | 209 | $GLOBALS['LANG']->getLL('cliUserGroup.usrConfiguredMsg'), |
3375 | 210 | $GLOBALS['LANG']->getLL('cliUserGroup.usrConfigured'), | 210 | $GLOBALS['LANG']->getLL('cliUserGroup.usrConfigured'), |
3376 | 211 | t3lib_FlashMessage::INFO, | 211 | t3lib_FlashMessage::INFO, |
3377 | 212 | FALSE | 212 | FALSE |
3378 | 213 | ); | 213 | ); |
3379 | 214 | 214 | ||
3380 | 215 | } else { | 215 | } else { |
3381 | 216 | 216 | ||
3382 | 217 | $message = t3lib_div::makeInstance( | 217 | $message = t3lib_div::makeInstance( |
3383 | 218 | 't3lib_FlashMessage', | ||
3384 | 219 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'), | ||
3385 | 220 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'), | ||
3386 | 221 | t3lib_FlashMessage::ERROR, | ||
3387 | 222 | FALSE | ||
3388 | 223 | ); | ||
3389 | 224 | |||
3390 | 225 | } | ||
3391 | 226 | |||
3392 | 227 | } else { | ||
3393 | 228 | |||
3394 | 229 | $message = t3lib_div::makeInstance( | ||
3395 | 230 | 't3lib_FlashMessage', | 218 | 't3lib_FlashMessage', |
3396 | 231 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'), | 219 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'), |
3397 | 232 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'), | 220 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'), |
3398 | 233 | t3lib_FlashMessage::ERROR, | 221 | t3lib_FlashMessage::ERROR, |
3399 | 234 | FALSE | 222 | FALSE |
3400 | 223 | ); | ||
3401 | 224 | |||
3402 | 225 | } | ||
3403 | 226 | |||
3404 | 227 | } else { | ||
3405 | 228 | |||
3406 | 229 | $message = t3lib_div::makeInstance( | ||
3407 | 230 | 't3lib_FlashMessage', | ||
3408 | 231 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'), | ||
3409 | 232 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'), | ||
3410 | 233 | t3lib_FlashMessage::ERROR, | ||
3411 | 234 | FALSE | ||
3412 | 235 | ); | 235 | ); |
3413 | 236 | 236 | ||
3414 | 237 | } | 237 | } |
3415 | @@ -243,51 +243,51 @@ | |||
3416 | 243 | if (!$checkOnly && $groupUid) { | 243 | if (!$checkOnly && $groupUid) { |
3417 | 244 | 244 | ||
3418 | 245 | // Try to create user. | 245 | // Try to create user. |
3420 | 246 | $_tempUid = uniqid('NEW'); | 246 | $tempUid = uniqid('NEW'); |
3421 | 247 | 247 | ||
3428 | 248 | $data['be_users'][$_tempUid] = array ( | 248 | $data['be_users'][$tempUid] = array ( |
3429 | 249 | 'pid' => 0, | 249 | 'pid' => 0, |
3430 | 250 | 'username' => '_cli_dlf', | 250 | 'username' => '_cli_dlf', |
3431 | 251 | 'password' => md5($_tempUid), | 251 | 'password' => md5($tempUid), |
3432 | 252 | 'realName' => $GLOBALS['LANG']->getLL('cliUserGroup.usrRealName'), | 252 | 'realName' => $GLOBALS['LANG']->getLL('cliUserGroup.usrRealName'), |
3433 | 253 | 'usergroup' => intval($groupUid) | 253 | 'usergroup' => intval($groupUid) |
3434 | 254 | ); | 254 | ); |
3435 | 255 | 255 | ||
3437 | 256 | $_substUid = tx_dlf_helper::processDB($data); | 256 | $substUid = tx_dlf_helper::processDB($data); |
3438 | 257 | 257 | ||
3439 | 258 | // Check if creation was successful. | 258 | // Check if creation was successful. |
3441 | 259 | if (!empty($_substUid[$_tempUid])) { | 259 | if (!empty($substUid[$tempUid])) { |
3442 | 260 | 260 | ||
3444 | 261 | $usrUid = $_substUid[$_tempUid]; | 261 | $usrUid = $substUid[$tempUid]; |
3445 | 262 | 262 | ||
3446 | 263 | $message = t3lib_div::makeInstance( | 263 | $message = t3lib_div::makeInstance( |
3452 | 264 | 't3lib_FlashMessage', | 264 | 't3lib_FlashMessage', |
3453 | 265 | $GLOBALS['LANG']->getLL('cliUserGroup.usrCreatedMsg'), | 265 | $GLOBALS['LANG']->getLL('cliUserGroup.usrCreatedMsg'), |
3454 | 266 | $GLOBALS['LANG']->getLL('cliUserGroup.usrCreated'), | 266 | $GLOBALS['LANG']->getLL('cliUserGroup.usrCreated'), |
3455 | 267 | t3lib_FlashMessage::INFO, | 267 | t3lib_FlashMessage::INFO, |
3456 | 268 | FALSE | 268 | FALSE |
3457 | 269 | ); | 269 | ); |
3458 | 270 | 270 | ||
3459 | 271 | } else { | 271 | } else { |
3460 | 272 | 272 | ||
3461 | 273 | $message = t3lib_div::makeInstance( | 273 | $message = t3lib_div::makeInstance( |
3462 | 274 | 't3lib_FlashMessage', | ||
3463 | 275 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'), | ||
3464 | 276 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'), | ||
3465 | 277 | t3lib_FlashMessage::ERROR, | ||
3466 | 278 | FALSE | ||
3467 | 279 | ); | ||
3468 | 280 | |||
3469 | 281 | } | ||
3470 | 282 | |||
3471 | 283 | } else { | ||
3472 | 284 | |||
3473 | 285 | $message = t3lib_div::makeInstance( | ||
3474 | 286 | 't3lib_FlashMessage', | 274 | 't3lib_FlashMessage', |
3475 | 287 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'), | 275 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'), |
3476 | 288 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'), | 276 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'), |
3477 | 289 | t3lib_FlashMessage::ERROR, | 277 | t3lib_FlashMessage::ERROR, |
3478 | 290 | FALSE | 278 | FALSE |
3479 | 279 | ); | ||
3480 | 280 | |||
3481 | 281 | } | ||
3482 | 282 | |||
3483 | 283 | } else { | ||
3484 | 284 | |||
3485 | 285 | $message = t3lib_div::makeInstance( | ||
3486 | 286 | 't3lib_FlashMessage', | ||
3487 | 287 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'), | ||
3488 | 288 | $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'), | ||
3489 | 289 | t3lib_FlashMessage::ERROR, | ||
3490 | 290 | FALSE | ||
3491 | 291 | ); | 291 | ); |
3492 | 292 | 292 | ||
3493 | 293 | } | 293 | } |
3494 | @@ -319,21 +319,21 @@ | |||
3495 | 319 | if (empty($settings)) { | 319 | if (empty($settings)) { |
3496 | 320 | 320 | ||
3497 | 321 | $settings = array ( | 321 | $settings = array ( |
3513 | 322 | 'non_exclude_fields' => array (), | 322 | 'non_exclude_fields' => array (), |
3514 | 323 | 'tables_select' => array ( | 323 | 'tables_select' => array ( |
3515 | 324 | 'tx_dlf_documents', | 324 | 'tx_dlf_documents', |
3516 | 325 | 'tx_dlf_collections', | 325 | 'tx_dlf_collections', |
3517 | 326 | 'tx_dlf_libraries', | 326 | 'tx_dlf_libraries', |
3518 | 327 | 'tx_dlf_structures', | 327 | 'tx_dlf_structures', |
3519 | 328 | 'tx_dlf_metadata', | 328 | 'tx_dlf_metadata', |
3520 | 329 | 'tx_dlf_formats', | 329 | 'tx_dlf_formats', |
3521 | 330 | 'tx_dlf_solrcores' | 330 | 'tx_dlf_solrcores' |
3522 | 331 | ), | 331 | ), |
3523 | 332 | 'tables_modify' => array ( | 332 | 'tables_modify' => array ( |
3524 | 333 | 'tx_dlf_documents', | 333 | 'tx_dlf_documents', |
3525 | 334 | 'tx_dlf_collections', | 334 | 'tx_dlf_collections', |
3526 | 335 | 'tx_dlf_libraries' | 335 | 'tx_dlf_libraries' |
3527 | 336 | ) | 336 | ) |
3528 | 337 | ); | 337 | ); |
3529 | 338 | 338 | ||
3530 | 339 | // Set allowed exclude fields. | 339 | // Set allowed exclude fields. |
3531 | @@ -357,9 +357,9 @@ | |||
3532 | 357 | 357 | ||
3533 | 358 | // Check if group "_cli_dlf" exists and is not disabled. | 358 | // Check if group "_cli_dlf" exists and is not disabled. |
3534 | 359 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 359 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
3538 | 360 | 'uid,non_exclude_fields,tables_select,tables_modify,inc_access_lists,'.$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'], | 360 | 'uid,non_exclude_fields,tables_select,tables_modify,inc_access_lists,'.$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'], |
3539 | 361 | 'be_groups', | 361 | 'be_groups', |
3540 | 362 | 'title='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_groups').t3lib_BEfunc::deleteClause('be_groups') | 362 | 'title='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_groups').t3lib_BEfunc::deleteClause('be_groups') |
3541 | 363 | ); | 363 | ); |
3542 | 364 | 364 | ||
3543 | 365 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { | 365 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { |
3544 | @@ -383,11 +383,11 @@ | |||
3545 | 383 | $grpUid = $resArray['uid']; | 383 | $grpUid = $resArray['uid']; |
3546 | 384 | 384 | ||
3547 | 385 | $message = t3lib_div::makeInstance( | 385 | $message = t3lib_div::makeInstance( |
3553 | 386 | 't3lib_FlashMessage', | 386 | 't3lib_FlashMessage', |
3554 | 387 | $GLOBALS['LANG']->getLL('cliUserGroup.grpOkayMsg'), | 387 | $GLOBALS['LANG']->getLL('cliUserGroup.grpOkayMsg'), |
3555 | 388 | $GLOBALS['LANG']->getLL('cliUserGroup.grpOkay'), | 388 | $GLOBALS['LANG']->getLL('cliUserGroup.grpOkay'), |
3556 | 389 | t3lib_FlashMessage::OK, | 389 | t3lib_FlashMessage::OK, |
3557 | 390 | FALSE | 390 | FALSE |
3558 | 391 | ); | 391 | ); |
3559 | 392 | 392 | ||
3560 | 393 | } else { | 393 | } else { |
3561 | @@ -395,19 +395,19 @@ | |||
3562 | 395 | if (!$checkOnly) { | 395 | if (!$checkOnly) { |
3563 | 396 | 396 | ||
3564 | 397 | // Keep exisiting values and add the new ones. | 397 | // Keep exisiting values and add the new ones. |
3570 | 398 | $_non_exclude_fields = array_unique(array_merge($settings['non_exclude_fields'], $resArray['non_exclude_fields'])); | 398 | $non_exclude_fields = array_unique(array_merge($settings['non_exclude_fields'], $resArray['non_exclude_fields'])); |
3571 | 399 | 399 | ||
3572 | 400 | $_tables_select = array_unique(array_merge($settings['tables_select'], $resArray['tables_select'])); | 400 | $tables_select = array_unique(array_merge($settings['tables_select'], $resArray['tables_select'])); |
3573 | 401 | 401 | ||
3574 | 402 | $_tables_modify = array_unique(array_merge($settings['tables_modify'], $resArray['tables_modify'])); | 402 | $tables_modify = array_unique(array_merge($settings['tables_modify'], $resArray['tables_modify'])); |
3575 | 403 | 403 | ||
3576 | 404 | // Try to configure usergroup. | 404 | // Try to configure usergroup. |
3577 | 405 | $data['be_groups'][$resArray['uid']] = array ( | 405 | $data['be_groups'][$resArray['uid']] = array ( |
3583 | 406 | 'non_exclude_fields' => implode(',', $_non_exclude_fields), | 406 | 'non_exclude_fields' => implode(',', $non_exclude_fields), |
3584 | 407 | 'tables_select' => implode(',', $_tables_select), | 407 | 'tables_select' => implode(',', $tables_select), |
3585 | 408 | 'tables_modify' => implode(',', $_tables_modify), | 408 | 'tables_modify' => implode(',', $tables_modify), |
3586 | 409 | 'inc_access_lists' => 1, | 409 | 'inc_access_lists' => 1, |
3587 | 410 | $GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'] => 0 | 410 | $GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'] => 0 |
3588 | 411 | ); | 411 | ); |
3589 | 412 | 412 | ||
3590 | 413 | tx_dlf_helper::processDB($data); | 413 | tx_dlf_helper::processDB($data); |
3591 | @@ -418,33 +418,33 @@ | |||
3592 | 418 | $grpUid = $resArray['uid']; | 418 | $grpUid = $resArray['uid']; |
3593 | 419 | 419 | ||
3594 | 420 | $message = t3lib_div::makeInstance( | 420 | $message = t3lib_div::makeInstance( |
3600 | 421 | 't3lib_FlashMessage', | 421 | 't3lib_FlashMessage', |
3601 | 422 | $GLOBALS['LANG']->getLL('cliUserGroup.grpConfiguredMsg'), | 422 | $GLOBALS['LANG']->getLL('cliUserGroup.grpConfiguredMsg'), |
3602 | 423 | $GLOBALS['LANG']->getLL('cliUserGroup.grpConfigured'), | 423 | $GLOBALS['LANG']->getLL('cliUserGroup.grpConfigured'), |
3603 | 424 | t3lib_FlashMessage::INFO, | 424 | t3lib_FlashMessage::INFO, |
3604 | 425 | FALSE | 425 | FALSE |
3605 | 426 | ); | 426 | ); |
3606 | 427 | 427 | ||
3607 | 428 | } else { | 428 | } else { |
3608 | 429 | 429 | ||
3609 | 430 | $message = t3lib_div::makeInstance( | 430 | $message = t3lib_div::makeInstance( |
3610 | 431 | 't3lib_FlashMessage', | ||
3611 | 432 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'), | ||
3612 | 433 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'), | ||
3613 | 434 | t3lib_FlashMessage::ERROR, | ||
3614 | 435 | FALSE | ||
3615 | 436 | ); | ||
3616 | 437 | |||
3617 | 438 | } | ||
3618 | 439 | |||
3619 | 440 | } else { | ||
3620 | 441 | |||
3621 | 442 | $message = t3lib_div::makeInstance( | ||
3622 | 443 | 't3lib_FlashMessage', | 431 | 't3lib_FlashMessage', |
3623 | 444 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'), | 432 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'), |
3624 | 445 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'), | 433 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'), |
3625 | 446 | t3lib_FlashMessage::ERROR, | 434 | t3lib_FlashMessage::ERROR, |
3626 | 447 | FALSE | 435 | FALSE |
3627 | 436 | ); | ||
3628 | 437 | |||
3629 | 438 | } | ||
3630 | 439 | |||
3631 | 440 | } else { | ||
3632 | 441 | |||
3633 | 442 | $message = t3lib_div::makeInstance( | ||
3634 | 443 | 't3lib_FlashMessage', | ||
3635 | 444 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'), | ||
3636 | 445 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'), | ||
3637 | 446 | t3lib_FlashMessage::ERROR, | ||
3638 | 447 | FALSE | ||
3639 | 448 | ); | 448 | ); |
3640 | 449 | 449 | ||
3641 | 450 | } | 450 | } |
3642 | @@ -456,53 +456,53 @@ | |||
3643 | 456 | if (!$checkOnly) { | 456 | if (!$checkOnly) { |
3644 | 457 | 457 | ||
3645 | 458 | // Try to create usergroup. | 458 | // Try to create usergroup. |
3647 | 459 | $_tempUid = uniqid('NEW'); | 459 | $tempUid = uniqid('NEW'); |
3648 | 460 | 460 | ||
3657 | 461 | $data['be_groups'][$_tempUid] = array ( | 461 | $data['be_groups'][$tempUid] = array ( |
3658 | 462 | 'pid' => 0, | 462 | 'pid' => 0, |
3659 | 463 | 'title' => '_cli_dlf', | 463 | 'title' => '_cli_dlf', |
3660 | 464 | 'description' => $GLOBALS['LANG']->getLL('cliUserGroup.grpDescription'), | 464 | 'description' => $GLOBALS['LANG']->getLL('cliUserGroup.grpDescription'), |
3661 | 465 | 'non_exclude_fields' => implode(',', $settings['non_exclude_fields']), | 465 | 'non_exclude_fields' => implode(',', $settings['non_exclude_fields']), |
3662 | 466 | 'tables_select' => implode(',', $settings['tables_select']), | 466 | 'tables_select' => implode(',', $settings['tables_select']), |
3663 | 467 | 'tables_modify' => implode(',', $settings['tables_modify']), | 467 | 'tables_modify' => implode(',', $settings['tables_modify']), |
3664 | 468 | 'inc_access_lists' => 1 | 468 | 'inc_access_lists' => 1 |
3665 | 469 | ); | 469 | ); |
3666 | 470 | 470 | ||
3668 | 471 | $_substUid = tx_dlf_helper::processDB($data); | 471 | $substUid = tx_dlf_helper::processDB($data); |
3669 | 472 | 472 | ||
3670 | 473 | // Check if creation was successful. | 473 | // Check if creation was successful. |
3672 | 474 | if (!empty($_substUid[$_tempUid])) { | 474 | if (!empty($substUid[$tempUid])) { |
3673 | 475 | 475 | ||
3675 | 476 | $grpUid = $_substUid[$_tempUid]; | 476 | $grpUid = $substUid[$tempUid]; |
3676 | 477 | 477 | ||
3677 | 478 | $message = t3lib_div::makeInstance( | 478 | $message = t3lib_div::makeInstance( |
3683 | 479 | 't3lib_FlashMessage', | 479 | 't3lib_FlashMessage', |
3684 | 480 | $GLOBALS['LANG']->getLL('cliUserGroup.grpCreatedMsg'), | 480 | $GLOBALS['LANG']->getLL('cliUserGroup.grpCreatedMsg'), |
3685 | 481 | $GLOBALS['LANG']->getLL('cliUserGroup.grpCreated'), | 481 | $GLOBALS['LANG']->getLL('cliUserGroup.grpCreated'), |
3686 | 482 | t3lib_FlashMessage::INFO, | 482 | t3lib_FlashMessage::INFO, |
3687 | 483 | FALSE | 483 | FALSE |
3688 | 484 | ); | 484 | ); |
3689 | 485 | 485 | ||
3690 | 486 | } else { | 486 | } else { |
3691 | 487 | 487 | ||
3692 | 488 | $message = t3lib_div::makeInstance( | 488 | $message = t3lib_div::makeInstance( |
3693 | 489 | 't3lib_FlashMessage', | ||
3694 | 490 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'), | ||
3695 | 491 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'), | ||
3696 | 492 | t3lib_FlashMessage::ERROR, | ||
3697 | 493 | FALSE | ||
3698 | 494 | ); | ||
3699 | 495 | |||
3700 | 496 | } | ||
3701 | 497 | |||
3702 | 498 | } else { | ||
3703 | 499 | |||
3704 | 500 | $message = t3lib_div::makeInstance( | ||
3705 | 501 | 't3lib_FlashMessage', | 489 | 't3lib_FlashMessage', |
3706 | 502 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'), | 490 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'), |
3707 | 503 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'), | 491 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'), |
3708 | 504 | t3lib_FlashMessage::ERROR, | 492 | t3lib_FlashMessage::ERROR, |
3709 | 505 | FALSE | 493 | FALSE |
3710 | 494 | ); | ||
3711 | 495 | |||
3712 | 496 | } | ||
3713 | 497 | |||
3714 | 498 | } else { | ||
3715 | 499 | |||
3716 | 500 | $message = t3lib_div::makeInstance( | ||
3717 | 501 | 't3lib_FlashMessage', | ||
3718 | 502 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'), | ||
3719 | 503 | $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'), | ||
3720 | 504 | t3lib_FlashMessage::ERROR, | ||
3721 | 505 | FALSE | ||
3722 | 506 | ); | 506 | ); |
3723 | 507 | 507 | ||
3724 | 508 | } | 508 | } |
3725 | @@ -549,21 +549,21 @@ | |||
3726 | 549 | if (is_executable(PATH_typo3.'cli_dispatch.phpsh')) { | 549 | if (is_executable(PATH_typo3.'cli_dispatch.phpsh')) { |
3727 | 550 | 550 | ||
3728 | 551 | $message = t3lib_div::makeInstance( | 551 | $message = t3lib_div::makeInstance( |
3734 | 552 | 't3lib_FlashMessage', | 552 | 't3lib_FlashMessage', |
3735 | 553 | $GLOBALS['LANG']->getLL('cliUserGroup.cliOkayMsg'), | 553 | $GLOBALS['LANG']->getLL('cliUserGroup.cliOkayMsg'), |
3736 | 554 | $GLOBALS['LANG']->getLL('cliUserGroup.cliOkay'), | 554 | $GLOBALS['LANG']->getLL('cliUserGroup.cliOkay'), |
3737 | 555 | t3lib_FlashMessage::OK, | 555 | t3lib_FlashMessage::OK, |
3738 | 556 | FALSE | 556 | FALSE |
3739 | 557 | ); | 557 | ); |
3740 | 558 | 558 | ||
3741 | 559 | } else { | 559 | } else { |
3742 | 560 | 560 | ||
3743 | 561 | $message = t3lib_div::makeInstance( | 561 | $message = t3lib_div::makeInstance( |
3749 | 562 | 't3lib_FlashMessage', | 562 | 't3lib_FlashMessage', |
3750 | 563 | $GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkayMsg'), | 563 | $GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkayMsg'), |
3751 | 564 | $GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkay'), | 564 | $GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkay'), |
3752 | 565 | t3lib_FlashMessage::ERROR, | 565 | t3lib_FlashMessage::ERROR, |
3753 | 566 | FALSE | 566 | FALSE |
3754 | 567 | ); | 567 | ); |
3755 | 568 | 568 | ||
3756 | 569 | } | 569 | } |
3757 | 570 | 570 | ||
3758 | === modified file 'dlf/hooks/class.tx_dlf_hacks.php' | |||
3759 | --- dlf/hooks/class.tx_dlf_hacks.php 2012-08-07 14:39:23 +0000 | |||
3760 | +++ dlf/hooks/class.tx_dlf_hacks.php 2012-08-17 07:00:27 +0000 | |||
3761 | @@ -55,23 +55,23 @@ | |||
3762 | 55 | 55 | ||
3763 | 56 | $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); | 56 | $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
3764 | 57 | 57 | ||
3774 | 58 | if (($_divs = $xml->xpath('//mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]'))) { | 58 | if (($divs = $xml->xpath('//mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]'))) { |
3775 | 59 | 59 | ||
3776 | 60 | $_smLinks = $xml->xpath('//mets:structLink/mets:smLink'); | 60 | $smLinks = $xml->xpath('//mets:structLink/mets:smLink'); |
3777 | 61 | 61 | ||
3778 | 62 | if ($_smLinks) { | 62 | if ($smLinks) { |
3779 | 63 | 63 | ||
3780 | 64 | foreach ($_smLinks as $_smLink) { | 64 | foreach ($smLinks as $smLink) { |
3781 | 65 | 65 | ||
3782 | 66 | $_links[(string) $_smLink->attributes('http://www.w3.org/1999/xlink')->from][] = (string) $_smLink->attributes('http://www.w3.org/1999/xlink')->to; | 66 | $links[(string) $smLink->attributes('http://www.w3.org/1999/xlink')->from][] = (string) $smLink->attributes('http://www.w3.org/1999/xlink')->to; |
3783 | 67 | 67 | ||
3784 | 68 | } | 68 | } |
3785 | 69 | 69 | ||
3791 | 70 | foreach ($_divs as $_div) { | 70 | foreach ($divs as $div) { |
3792 | 71 | 71 | ||
3793 | 72 | if (!empty($_links[(string) $_div['ID']])) { | 72 | if (!empty($links[(string) $div['ID']])) { |
3794 | 73 | 73 | ||
3795 | 74 | $_id = (string) $_div['DMDID']; | 74 | $id = (string) $div['DMDID']; |
3796 | 75 | 75 | ||
3797 | 76 | break; | 76 | break; |
3798 | 77 | 77 | ||
3799 | @@ -81,17 +81,17 @@ | |||
3800 | 81 | 81 | ||
3801 | 82 | } | 82 | } |
3802 | 83 | 83 | ||
3804 | 84 | if (empty($_id)) { | 84 | if (empty($id)) { |
3805 | 85 | 85 | ||
3807 | 86 | $_id = (string) $_divs[0]['DMDID']; | 86 | $id = (string) $divs[0]['DMDID']; |
3808 | 87 | 87 | ||
3809 | 88 | } | 88 | } |
3810 | 89 | 89 | ||
3816 | 90 | $_recordId = $xml->xpath('//mets:dmdSec[@ID="'.$_id.'"]//mods:mods/mods:recordInfo/mods:recordIdentifier'); | 90 | $recordIds = $xml->xpath('//mets:dmdSec[@ID="'.$id.'"]//mods:mods/mods:recordInfo/mods:recordIdentifier'); |
3817 | 91 | 91 | ||
3818 | 92 | if (!empty($_recordId[0])) { | 92 | if (!empty($recordIds[0])) { |
3819 | 93 | 93 | ||
3820 | 94 | return (string) $_recordId[0]; | 94 | return (string) $recordIds[0]; |
3821 | 95 | 95 | ||
3822 | 96 | } | 96 | } |
3823 | 97 | 97 | ||
3824 | 98 | 98 | ||
3825 | === modified file 'dlf/hooks/class.tx_dlf_tceforms.php' | |||
3826 | --- dlf/hooks/class.tx_dlf_tceforms.php 2012-08-07 14:39:23 +0000 | |||
3827 | +++ dlf/hooks/class.tx_dlf_tceforms.php 2012-08-17 07:00:27 +0000 | |||
3828 | @@ -59,21 +59,21 @@ | |||
3829 | 59 | // i.e. instead of "18" it reads "pages_18|Title" | 59 | // i.e. instead of "18" it reads "pages_18|Title" |
3830 | 60 | if (!t3lib_div::testInt($pages)) { | 60 | if (!t3lib_div::testInt($pages)) { |
3831 | 61 | 61 | ||
3833 | 62 | $_parts = explode('|', $pages); | 62 | $parts = explode('|', $pages); |
3834 | 63 | 63 | ||
3836 | 64 | $pages = array_pop(explode('_', $_parts[0])); | 64 | $pages = array_pop(explode('_', $parts[0])); |
3837 | 65 | 65 | ||
3838 | 66 | } | 66 | } |
3839 | 67 | 67 | ||
3840 | 68 | if ($pages > 0) { | 68 | if ($pages > 0) { |
3841 | 69 | 69 | ||
3842 | 70 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 70 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
3849 | 71 | 'label,uid', | 71 | 'label,uid', |
3850 | 72 | 'tx_dlf_collections', | 72 | 'tx_dlf_collections', |
3851 | 73 | 'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_collections'), | 73 | 'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_collections'), |
3852 | 74 | '', | 74 | '', |
3853 | 75 | 'label', | 75 | 'label', |
3854 | 76 | '' | 76 | '' |
3855 | 77 | ); | 77 | ); |
3856 | 78 | 78 | ||
3857 | 79 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { | 79 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { |
3858 | @@ -114,21 +114,21 @@ | |||
3859 | 114 | // i.e. instead of "18" it reads "pages_18|Title" | 114 | // i.e. instead of "18" it reads "pages_18|Title" |
3860 | 115 | if (!t3lib_div::testInt($pages)) { | 115 | if (!t3lib_div::testInt($pages)) { |
3861 | 116 | 116 | ||
3863 | 117 | $_parts = explode('|', $pages); | 117 | $parts = explode('|', $pages); |
3864 | 118 | 118 | ||
3866 | 119 | $pages = array_pop(explode('_', $_parts[0])); | 119 | $pages = array_pop(explode('_', $parts[0])); |
3867 | 120 | 120 | ||
3868 | 121 | } | 121 | } |
3869 | 122 | 122 | ||
3870 | 123 | if ($pages > 0) { | 123 | if ($pages > 0) { |
3871 | 124 | 124 | ||
3872 | 125 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 125 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
3879 | 126 | 'label,uid', | 126 | 'label,uid', |
3880 | 127 | 'tx_dlf_libraries', | 127 | 'tx_dlf_libraries', |
3881 | 128 | 'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_libraries'), | 128 | 'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_libraries'), |
3882 | 129 | '', | 129 | '', |
3883 | 130 | 'label', | 130 | 'label', |
3884 | 131 | '' | 131 | '' |
3885 | 132 | ); | 132 | ); |
3886 | 133 | 133 | ||
3887 | 134 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { | 134 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { |
3888 | @@ -169,21 +169,21 @@ | |||
3889 | 169 | // i.e. instead of "18" it reads "pages_18|Title" | 169 | // i.e. instead of "18" it reads "pages_18|Title" |
3890 | 170 | if (!t3lib_div::testInt($pages)) { | 170 | if (!t3lib_div::testInt($pages)) { |
3891 | 171 | 171 | ||
3893 | 172 | $_parts = explode('|', $pages); | 172 | $parts = explode('|', $pages); |
3894 | 173 | 173 | ||
3896 | 174 | $pages = array_pop(explode('_', $_parts[0])); | 174 | $pages = array_pop(explode('_', $parts[0])); |
3897 | 175 | 175 | ||
3898 | 176 | } | 176 | } |
3899 | 177 | 177 | ||
3900 | 178 | if ($pages > 0) { | 178 | if ($pages > 0) { |
3901 | 179 | 179 | ||
3902 | 180 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 180 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
3909 | 181 | 'label,uid', | 181 | 'label,uid', |
3910 | 182 | 'tx_dlf_solrcores', | 182 | 'tx_dlf_solrcores', |
3911 | 183 | 'pid IN ('.intval($pages).',0)'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), | 183 | 'pid IN ('.intval($pages).',0)'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
3912 | 184 | '', | 184 | '', |
3913 | 185 | 'label', | 185 | 'label', |
3914 | 186 | '' | 186 | '' |
3915 | 187 | ); | 187 | ); |
3916 | 188 | 188 | ||
3917 | 189 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { | 189 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) { |
3918 | 190 | 190 | ||
3919 | === modified file 'dlf/hooks/class.tx_dlf_tcemain.php' | |||
3920 | --- dlf/hooks/class.tx_dlf_tcemain.php 2012-08-07 14:39:23 +0000 | |||
3921 | +++ dlf/hooks/class.tx_dlf_tcemain.php 2012-08-17 07:00:27 +0000 | |||
3922 | @@ -59,37 +59,13 @@ | |||
3923 | 59 | // Field post-processing for table "tx_dlf_documents". | 59 | // Field post-processing for table "tx_dlf_documents". |
3924 | 60 | case 'tx_dlf_documents': | 60 | case 'tx_dlf_documents': |
3925 | 61 | 61 | ||
3927 | 62 | // Set sorting fields if empty. | 62 | // Set sorting field if empty. |
3928 | 63 | if (empty($fieldArray['title_sorting']) && !empty($fieldArray['title'])) { | 63 | if (empty($fieldArray['title_sorting']) && !empty($fieldArray['title'])) { |
3929 | 64 | 64 | ||
3930 | 65 | $fieldArray['title_sorting'] = $fieldArray['title']; | 65 | $fieldArray['title_sorting'] = $fieldArray['title']; |
3931 | 66 | 66 | ||
3932 | 67 | } | 67 | } |
3933 | 68 | 68 | ||
3934 | 69 | if (empty($fieldArray['author_sorting']) && !empty($fieldArray['author'])) { | ||
3935 | 70 | |||
3936 | 71 | $fieldArray['author_sorting'] = $fieldArray['author']; | ||
3937 | 72 | |||
3938 | 73 | } | ||
3939 | 74 | |||
3940 | 75 | if (empty($fieldArray['year_sorting']) && !empty($fieldArray['year'])) { | ||
3941 | 76 | |||
3942 | 77 | $fieldArray['year_sorting'] = str_ireplace('x', '5', preg_replace('/[^\d.x]/i', '', (string) $fieldArray['year'])); | ||
3943 | 78 | |||
3944 | 79 | if (strpos($fieldArray['year_sorting'], '.') || strlen($fieldArray['year_sorting']) < 3) { | ||
3945 | 80 | |||
3946 | 81 | $fieldArray['year_sorting'] = ((intval(trim($fieldArray['year_sorting'], '.')) - 1) * 100) + 50; | ||
3947 | 82 | |||
3948 | 83 | } | ||
3949 | 84 | |||
3950 | 85 | } | ||
3951 | 86 | |||
3952 | 87 | if (empty($fieldArray['place_sorting']) && !empty($fieldArray['place'])) { | ||
3953 | 88 | |||
3954 | 89 | $fieldArray['place_sorting'] = preg_replace('/[[:punct:]]/', '', (string) $fieldArray['place']); | ||
3955 | 90 | |||
3956 | 91 | } | ||
3957 | 92 | |||
3958 | 93 | break; | 69 | break; |
3959 | 94 | 70 | ||
3960 | 95 | // Field post-processing for tables "tx_dlf_collections", "tx_dlf_libraries", "tx_dlf_metadata" and "tx_dlf_structures". | 71 | // Field post-processing for tables "tx_dlf_collections", "tx_dlf_libraries", "tx_dlf_metadata" and "tx_dlf_structures". |
3961 | @@ -119,12 +95,12 @@ | |||
3962 | 119 | 95 | ||
3963 | 120 | // Get number of existing cores. | 96 | // Get number of existing cores. |
3964 | 121 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 97 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
3971 | 122 | '*', | 98 | '*', |
3972 | 123 | 'tx_dlf_solrcores', | 99 | 'tx_dlf_solrcores', |
3973 | 124 | '', | 100 | '', |
3974 | 125 | '', | 101 | '', |
3975 | 126 | '', | 102 | '', |
3976 | 127 | '' | 103 | '' |
3977 | 128 | ); | 104 | ); |
3978 | 129 | 105 | ||
3979 | 130 | // Get first unused core number. | 106 | // Get first unused core number. |
3980 | @@ -155,10 +131,10 @@ | |||
3981 | 155 | $url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores?action=CREATE&name=dlfCore'.$coreNumber.'&instanceDir=.&dataDir=dlfCore'.$coreNumber; | 131 | $url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores?action=CREATE&name=dlfCore'.$coreNumber.'&instanceDir=.&dataDir=dlfCore'.$coreNumber; |
3982 | 156 | 132 | ||
3983 | 157 | $context = stream_context_create(array ( | 133 | $context = stream_context_create(array ( |
3988 | 158 | 'http' => array ( | 134 | 'http' => array ( |
3989 | 159 | 'method' => 'GET', | 135 | 'method' => 'GET', |
3990 | 160 | 'user_agent' => ($conf['useragent'] ? $conf['useragent'] : ini_get('user_agent')) | 136 | 'user_agent' => ($conf['useragent'] ? $conf['useragent'] : ini_get('user_agent')) |
3991 | 161 | ) | 137 | ) |
3992 | 162 | )); | 138 | )); |
3993 | 163 | 139 | ||
3994 | 164 | $response = @simplexml_load_string(file_get_contents($url, FALSE, $context)); | 140 | $response = @simplexml_load_string(file_get_contents($url, FALSE, $context)); |
3995 | @@ -178,7 +154,11 @@ | |||
3996 | 178 | 154 | ||
3997 | 179 | } | 155 | } |
3998 | 180 | 156 | ||
4000 | 181 | trigger_error('Could not create new Solr core "dlfCore'.$coreNumber.'"', E_USER_WARNING); | 157 | if (TYPO3_DLOG) { |
4001 | 158 | |||
4002 | 159 | t3lib_div::devLog('[tx_dlf_tcemain->processDatamap_postProcessFieldArray('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Could not create new Apache Solr core "dlfCore'.$coreNumber.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $fieldArray); | ||
4003 | 160 | |||
4004 | 161 | } | ||
4005 | 182 | 162 | ||
4006 | 183 | $fieldArray = NULL; | 163 | $fieldArray = NULL; |
4007 | 184 | 164 | ||
4008 | @@ -206,12 +186,12 @@ | |||
4009 | 206 | 186 | ||
4010 | 207 | // Get current index name. | 187 | // Get current index name. |
4011 | 208 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 188 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
4018 | 209 | $table.'.index_name AS index_name', | 189 | $table.'.index_name AS index_name', |
4019 | 210 | $table, | 190 | $table, |
4020 | 211 | $table.'.uid='.intval($id).tx_dlf_helper::whereClause($table), | 191 | $table.'.uid='.intval($id).tx_dlf_helper::whereClause($table), |
4021 | 212 | '', | 192 | '', |
4022 | 213 | '', | 193 | '', |
4023 | 214 | '1' | 194 | '1' |
4024 | 215 | ); | 195 | ); |
4025 | 216 | 196 | ||
4026 | 217 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { | 197 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
4027 | @@ -225,7 +205,11 @@ | |||
4028 | 225 | 205 | ||
4029 | 226 | } | 206 | } |
4030 | 227 | 207 | ||
4032 | 228 | trigger_error('Prevented change of "index_name" for UID '.intval($id).' in table "'.htmlspecialchars($table).'"', E_USER_NOTICE); | 208 | if (TYPO3_DLOG) { |
4033 | 209 | |||
4034 | 210 | t3lib_div::devLog('[tx_dlf_tcemain->processDatamap_postProcessFieldArray('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Prevented change of "index_name" for UID "'.$id.'" in table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_NOTICE, $fieldArray); | ||
4035 | 211 | |||
4036 | 212 | } | ||
4037 | 229 | 213 | ||
4038 | 230 | } | 214 | } |
4039 | 231 | 215 | ||
4040 | @@ -252,7 +236,7 @@ | |||
4041 | 252 | */ | 236 | */ |
4042 | 253 | public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, $pObj) { | 237 | public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, $pObj) { |
4043 | 254 | 238 | ||
4045 | 255 | if ($status == "update") { | 239 | if ($status == 'update') { |
4046 | 256 | 240 | ||
4047 | 257 | switch ($table) { | 241 | switch ($table) { |
4048 | 258 | 242 | ||
4049 | @@ -264,12 +248,12 @@ | |||
4050 | 264 | 248 | ||
4051 | 265 | // Get Solr core. | 249 | // Get Solr core. |
4052 | 266 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 250 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
4059 | 267 | 'tx_dlf_solrcores.uid', | 251 | 'tx_dlf_solrcores.uid', |
4060 | 268 | 'tx_dlf_solrcores,tx_dlf_documents', | 252 | 'tx_dlf_solrcores,tx_dlf_documents', |
4061 | 269 | 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.intval($id).tx_dlf_helper::whereClause('tx_dlf_solrcores'), | 253 | 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.intval($id).tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
4062 | 270 | '', | 254 | '', |
4063 | 271 | '', | 255 | '', |
4064 | 272 | '1' | 256 | '1' |
4065 | 273 | ); | 257 | ); |
4066 | 274 | 258 | ||
4067 | 275 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { | 259 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
4068 | @@ -299,7 +283,11 @@ | |||
4069 | 299 | 283 | ||
4070 | 300 | } else { | 284 | } else { |
4071 | 301 | 285 | ||
4073 | 302 | trigger_error('Failed to reindex document with UID '.$id, E_USER_WARNING); | 286 | if (TYPO3_DLOG) { |
4074 | 287 | |||
4075 | 288 | t3lib_div::devLog('[tx_dlf_tcemain->processDatamap_afterDatabaseOperations('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Failed to re-index document with UID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $fieldArray); | ||
4076 | 289 | |||
4077 | 290 | } | ||
4078 | 303 | 291 | ||
4079 | 304 | } | 292 | } |
4080 | 305 | 293 | ||
4081 | @@ -336,12 +324,12 @@ | |||
4082 | 336 | 324 | ||
4083 | 337 | // Get Solr core. | 325 | // Get Solr core. |
4084 | 338 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 326 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
4091 | 339 | 'tx_dlf_solrcores.uid', | 327 | 'tx_dlf_solrcores.uid', |
4092 | 340 | 'tx_dlf_solrcores,tx_dlf_documents', | 328 | 'tx_dlf_solrcores,tx_dlf_documents', |
4093 | 341 | 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.intval($id).tx_dlf_helper::whereClause('tx_dlf_solrcores'), | 329 | 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.intval($id).tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
4094 | 342 | '', | 330 | '', |
4095 | 343 | '', | 331 | '', |
4096 | 344 | '1' | 332 | '1' |
4097 | 345 | ); | 333 | ); |
4098 | 346 | 334 | ||
4099 | 347 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { | 335 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
4100 | @@ -380,7 +368,11 @@ | |||
4101 | 380 | 368 | ||
4102 | 381 | } else { | 369 | } else { |
4103 | 382 | 370 | ||
4105 | 383 | trigger_error('Failed to reindex document with UID '.$id, E_USER_WARNING); | 371 | if (TYPO3_DLOG) { |
4106 | 372 | |||
4107 | 373 | t3lib_div::devLog('[tx_dlf_tcemain->processCmdmap_postProcess('.$command.', '.$table.', '.$id.', '.$value.', ['.get_class($pObj).'])] Failed to re-index document with UID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_ERROR); | ||
4108 | 374 | |||
4109 | 375 | } | ||
4110 | 384 | 376 | ||
4111 | 385 | } | 377 | } |
4112 | 386 | 378 | ||
4113 | 387 | 379 | ||
4114 | === modified file 'dlf/locallang.xml' | |||
4115 | --- dlf/locallang.xml 2012-08-09 10:31:57 +0000 | |||
4116 | +++ dlf/locallang.xml 2012-08-17 07:00:27 +0000 | |||
4117 | @@ -64,7 +64,6 @@ | |||
4118 | 64 | <label index="tx_dlf_metadata.tab3">Access</label> | 64 | <label index="tx_dlf_metadata.tab3">Access</label> |
4119 | 65 | <label index="tx_dlf_formats">Data Formats</label> | 65 | <label index="tx_dlf_formats">Data Formats</label> |
4120 | 66 | <label index="tx_dlf_formats.type">METS Name</label> | 66 | <label index="tx_dlf_formats.type">METS Name</label> |
4121 | 67 | <label index="tx_dlf_formats.other_type">Is it @MDTYPE="OTHER" in METS?</label> | ||
4122 | 68 | <label index="tx_dlf_formats.root">Root Element</label> | 67 | <label index="tx_dlf_formats.root">Root Element</label> |
4123 | 69 | <label index="tx_dlf_formats.namespace">Namespace URI</label> | 68 | <label index="tx_dlf_formats.namespace">Namespace URI</label> |
4124 | 70 | <label index="tx_dlf_formats.class">Class Name</label> | 69 | <label index="tx_dlf_formats.class">Class Name</label> |
4125 | @@ -219,7 +218,6 @@ | |||
4126 | 219 | <label index="tx_dlf_metadata.tab3">Zugriff</label> | 218 | <label index="tx_dlf_metadata.tab3">Zugriff</label> |
4127 | 220 | <label index="tx_dlf_formats">Datenformate</label> | 219 | <label index="tx_dlf_formats">Datenformate</label> |
4128 | 221 | <label index="tx_dlf_formats.type">Bezeichnung in METS</label> | 220 | <label index="tx_dlf_formats.type">Bezeichnung in METS</label> |
4129 | 222 | <label index="tx_dlf_formats.other_type">@MDTYPE="OTHER" in METS?</label> | ||
4130 | 223 | <label index="tx_dlf_formats.root">Root-Element</label> | 221 | <label index="tx_dlf_formats.root">Root-Element</label> |
4131 | 224 | <label index="tx_dlf_formats.namespace">Namensraum URI</label> | 222 | <label index="tx_dlf_formats.namespace">Namensraum URI</label> |
4132 | 225 | <label index="tx_dlf_formats.class">Klassenname</label> | 223 | <label index="tx_dlf_formats.class">Klassenname</label> |
4133 | 226 | 224 | ||
4134 | === modified file 'dlf/modules/indexing/index.php' | |||
4135 | --- dlf/modules/indexing/index.php 2012-07-13 07:54:25 +0000 | |||
4136 | +++ dlf/modules/indexing/index.php 2012-08-17 07:00:27 +0000 | |||
4137 | @@ -70,7 +70,7 @@ | |||
4138 | 70 | $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 70 | $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
4139 | 71 | 'tx_dlf_solrcores.label AS label,tx_dlf_solrcores.uid AS uid', | 71 | 'tx_dlf_solrcores.label AS label,tx_dlf_solrcores.uid AS uid', |
4140 | 72 | 'tx_dlf_solrcores', | 72 | 'tx_dlf_solrcores', |
4142 | 73 | '1=1'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), | 73 | 'tx_dlf_solrcores.pid IN (0,'.intval($this->id).')'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
4143 | 74 | '', | 74 | '', |
4144 | 75 | '', | 75 | '', |
4145 | 76 | '' | 76 | '' |
4146 | @@ -134,7 +134,7 @@ | |||
4147 | 134 | $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 134 | $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
4148 | 135 | 'tx_dlf_solrcores.label AS label,tx_dlf_solrcores.uid AS uid', | 135 | 'tx_dlf_solrcores.label AS label,tx_dlf_solrcores.uid AS uid', |
4149 | 136 | 'tx_dlf_solrcores', | 136 | 'tx_dlf_solrcores', |
4151 | 137 | '1=1'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), | 137 | 'tx_dlf_solrcores.pid IN (0,'.intval($this->id).')'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
4152 | 138 | '', | 138 | '', |
4153 | 139 | '', | 139 | '', |
4154 | 140 | '' | 140 | '' |
4155 | 141 | 141 | ||
4156 | === modified file 'dlf/modules/newclient/index.php' | |||
4157 | --- dlf/modules/newclient/index.php 2012-08-07 14:39:23 +0000 | |||
4158 | +++ dlf/modules/newclient/index.php 2012-08-17 07:00:27 +0000 | |||
4159 | @@ -127,6 +127,7 @@ | |||
4160 | 127 | 'is_sortable' => $values['is_sortable'], | 127 | 'is_sortable' => $values['is_sortable'], |
4161 | 128 | 'is_facet' => $values['is_facet'], | 128 | 'is_facet' => $values['is_facet'], |
4162 | 129 | 'is_listed' => $values['is_listed'], | 129 | 'is_listed' => $values['is_listed'], |
4163 | 130 | 'autocomplete' => $value['autocomplete'], | ||
4164 | 130 | ); | 131 | ); |
4165 | 131 | 132 | ||
4166 | 132 | } | 133 | } |
4167 | 133 | 134 | ||
4168 | === modified file 'dlf/modules/newclient/metadata.inc.php' | |||
4169 | --- dlf/modules/newclient/metadata.inc.php 2012-08-07 14:39:23 +0000 | |||
4170 | +++ dlf/modules/newclient/metadata.inc.php 2012-08-17 07:00:27 +0000 | |||
4171 | @@ -39,6 +39,7 @@ | |||
4172 | 39 | 'is_sortable' => 0, | 39 | 'is_sortable' => 0, |
4173 | 40 | 'is_facet' => 0, | 40 | 'is_facet' => 0, |
4174 | 41 | 'is_listed' => 0, | 41 | 'is_listed' => 0, |
4175 | 42 | 'autocomplete' => 0, | ||
4176 | 42 | ), | 43 | ), |
4177 | 43 | 'record_id' => array ( | 44 | 'record_id' => array ( |
4178 | 44 | 'encoded' => 1, | 45 | 'encoded' => 1, |
4179 | @@ -53,6 +54,7 @@ | |||
4180 | 53 | 'is_sortable' => 0, | 54 | 'is_sortable' => 0, |
4181 | 54 | 'is_facet' => 0, | 55 | 'is_facet' => 0, |
4182 | 55 | 'is_listed' => 0, | 56 | 'is_listed' => 0, |
4183 | 57 | 'autocomplete' => 0, | ||
4184 | 56 | ), | 58 | ), |
4185 | 57 | 'union_id' => array ( | 59 | 'union_id' => array ( |
4186 | 58 | 'encoded' => 1, | 60 | 'encoded' => 1, |
4187 | @@ -67,6 +69,7 @@ | |||
4188 | 67 | 'is_sortable' => 0, | 69 | 'is_sortable' => 0, |
4189 | 68 | 'is_facet' => 0, | 70 | 'is_facet' => 0, |
4190 | 69 | 'is_listed' => 0, | 71 | 'is_listed' => 0, |
4191 | 72 | 'autocomplete' => 0, | ||
4192 | 70 | ), | 73 | ), |
4193 | 71 | 'opac_id' => array ( | 74 | 'opac_id' => array ( |
4194 | 72 | 'encoded' => 1, | 75 | 'encoded' => 1, |
4195 | @@ -81,13 +84,14 @@ | |||
4196 | 81 | 'is_sortable' => 0, | 84 | 'is_sortable' => 0, |
4197 | 82 | 'is_facet' => 0, | 85 | 'is_facet' => 0, |
4198 | 83 | 'is_listed' => 0, | 86 | 'is_listed' => 0, |
4199 | 87 | 'autocomplete' => 0, | ||
4200 | 84 | ), | 88 | ), |
4201 | 85 | 'urn' => array ( | 89 | 'urn' => array ( |
4202 | 86 | 'encoded' => 1, | 90 | 'encoded' => 1, |
4203 | 87 | 'xpath' => './mods:identifier[@type="urn"]', | 91 | 'xpath' => './mods:identifier[@type="urn"]', |
4204 | 88 | 'xpath_sorting' => '', | 92 | 'xpath_sorting' => '', |
4205 | 89 | 'default_value' => '', | 93 | 'default_value' => '', |
4207 | 90 | 'wrap' => "key.wrap = <dt>|</dt>\nvalue.setContentToCurrent = 1\nvalue.required = 1\nvalue.typolink.parameter.current = 1\nvalue.typolink.parameter.prepend = TEXT\nvalue.typolink.parameter.prepend.value = http://nbn-resolving.de/\nvalue.wrap = <dd>|</dd>", | 94 | 'wrap' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.setContentToCurrent = 1\nvalue.typolink.parameter.current = 1\nvalue.typolink.parameter.prepend = TEXT\nvalue.typolink.parameter.prepend.value = http://nbn-resolving.de/\nvalue.wrap = <dd>|</dd>", |
4208 | 91 | 'tokenized' => 0, | 95 | 'tokenized' => 0, |
4209 | 92 | 'stored' => 0, | 96 | 'stored' => 0, |
4210 | 93 | 'indexed' => 1, | 97 | 'indexed' => 1, |
4211 | @@ -95,13 +99,14 @@ | |||
4212 | 95 | 'is_sortable' => 0, | 99 | 'is_sortable' => 0, |
4213 | 96 | 'is_facet' => 0, | 100 | 'is_facet' => 0, |
4214 | 97 | 'is_listed' => 0, | 101 | 'is_listed' => 0, |
4215 | 102 | 'autocomplete' => 0, | ||
4216 | 98 | ), | 103 | ), |
4217 | 99 | 'purl' => array ( | 104 | 'purl' => array ( |
4218 | 100 | 'encoded' => 1, | 105 | 'encoded' => 1, |
4219 | 101 | 'xpath' => './mods:identifier[@type="purl"]', | 106 | 'xpath' => './mods:identifier[@type="purl"]', |
4220 | 102 | 'xpath_sorting' => '', | 107 | 'xpath_sorting' => '', |
4221 | 103 | 'default_value' => '', | 108 | 'default_value' => '', |
4223 | 104 | 'wrap' => "key.wrap = <dt>|</dt>\nvalue.setContentToCurrent = 1\nvalue.required = 1\nvalue.typolink.parameter.current = 1\nvalue.wrap = <dd>|</dd>", | 109 | 'wrap' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.setContentToCurrent = 1\nvalue.typolink.parameter.current = 1\nvalue.wrap = <dd>|</dd>", |
4224 | 105 | 'tokenized' => 0, | 110 | 'tokenized' => 0, |
4225 | 106 | 'stored' => 0, | 111 | 'stored' => 0, |
4226 | 107 | 'indexed' => 0, | 112 | 'indexed' => 0, |
4227 | @@ -109,6 +114,7 @@ | |||
4228 | 109 | 'is_sortable' => 0, | 114 | 'is_sortable' => 0, |
4229 | 110 | 'is_facet' => 0, | 115 | 'is_facet' => 0, |
4230 | 111 | 'is_listed' => 0, | 116 | 'is_listed' => 0, |
4231 | 117 | 'autocomplete' => 0, | ||
4232 | 112 | ), | 118 | ), |
4233 | 113 | 'owner' => array ( | 119 | 'owner' => array ( |
4234 | 114 | 'encoded' => 1, | 120 | 'encoded' => 1, |
4235 | @@ -123,6 +129,7 @@ | |||
4236 | 123 | 'is_sortable' => 0, | 129 | 'is_sortable' => 0, |
4237 | 124 | 'is_facet' => 1, | 130 | 'is_facet' => 1, |
4238 | 125 | 'is_listed' => 0, | 131 | 'is_listed' => 0, |
4239 | 132 | 'autocomplete' => 0, | ||
4240 | 126 | ), | 133 | ), |
4241 | 127 | 'collection' => array ( | 134 | 'collection' => array ( |
4242 | 128 | 'encoded' => 1, | 135 | 'encoded' => 1, |
4243 | @@ -137,6 +144,7 @@ | |||
4244 | 137 | 'is_sortable' => 0, | 144 | 'is_sortable' => 0, |
4245 | 138 | 'is_facet' => 1, | 145 | 'is_facet' => 1, |
4246 | 139 | 'is_listed' => 0, | 146 | 'is_listed' => 0, |
4247 | 147 | 'autocomplete' => 0, | ||
4248 | 140 | ), | 148 | ), |
4249 | 141 | 'language' => array ( | 149 | 'language' => array ( |
4250 | 142 | 'encoded' => 1, | 150 | 'encoded' => 1, |
4251 | @@ -151,6 +159,7 @@ | |||
4252 | 151 | 'is_sortable' => 0, | 159 | 'is_sortable' => 0, |
4253 | 152 | 'is_facet' => 1, | 160 | 'is_facet' => 1, |
4254 | 153 | 'is_listed' => 0, | 161 | 'is_listed' => 0, |
4255 | 162 | 'autocomplete' => 0, | ||
4256 | 154 | ), | 163 | ), |
4257 | 155 | 'year' => array ( | 164 | 'year' => array ( |
4258 | 156 | 'encoded' => 1, | 165 | 'encoded' => 1, |
4259 | @@ -165,6 +174,7 @@ | |||
4260 | 165 | 'is_sortable' => 1, | 174 | 'is_sortable' => 1, |
4261 | 166 | 'is_facet' => 1, | 175 | 'is_facet' => 1, |
4262 | 167 | 'is_listed' => 1, | 176 | 'is_listed' => 1, |
4263 | 177 | 'autocomplete' => 0, | ||
4264 | 168 | ), | 178 | ), |
4265 | 169 | 'place' => array ( | 179 | 'place' => array ( |
4266 | 170 | 'encoded' => 1, | 180 | 'encoded' => 1, |
4267 | @@ -179,6 +189,7 @@ | |||
4268 | 179 | 'is_sortable' => 1, | 189 | 'is_sortable' => 1, |
4269 | 180 | 'is_facet' => 1, | 190 | 'is_facet' => 1, |
4270 | 181 | 'is_listed' => 1, | 191 | 'is_listed' => 1, |
4271 | 192 | 'autocomplete' => 0, | ||
4272 | 182 | ), | 193 | ), |
4273 | 183 | 'author' => array ( | 194 | 'author' => array ( |
4274 | 184 | 'encoded' => 1, | 195 | 'encoded' => 1, |
4275 | @@ -193,6 +204,7 @@ | |||
4276 | 193 | 'is_sortable' => 1, | 204 | 'is_sortable' => 1, |
4277 | 194 | 'is_facet' => 1, | 205 | 'is_facet' => 1, |
4278 | 195 | 'is_listed' => 1, | 206 | 'is_listed' => 1, |
4279 | 207 | 'autocomplete' => 1, | ||
4280 | 196 | ), | 208 | ), |
4281 | 197 | 'volume' => array ( | 209 | 'volume' => array ( |
4282 | 198 | 'encoded' => 1, | 210 | 'encoded' => 1, |
4283 | @@ -207,6 +219,7 @@ | |||
4284 | 207 | 'is_sortable' => 1, | 219 | 'is_sortable' => 1, |
4285 | 208 | 'is_facet' => 0, | 220 | 'is_facet' => 0, |
4286 | 209 | 'is_listed' => 1, | 221 | 'is_listed' => 1, |
4287 | 222 | 'autocomplete' => 0, | ||
4288 | 210 | ), | 223 | ), |
4289 | 211 | 'title' => array ( | 224 | 'title' => array ( |
4290 | 212 | 'encoded' => 1, | 225 | 'encoded' => 1, |
4291 | @@ -221,13 +234,14 @@ | |||
4292 | 221 | 'is_sortable' => 1, | 234 | 'is_sortable' => 1, |
4293 | 222 | 'is_facet' => 0, | 235 | 'is_facet' => 0, |
4294 | 223 | 'is_listed' => 1, | 236 | 'is_listed' => 1, |
4295 | 237 | 'autocomplete' => 1, | ||
4296 | 224 | ), | 238 | ), |
4297 | 225 | 'type' => array ( | 239 | 'type' => array ( |
4298 | 226 | 'encoded' => 0, | 240 | 'encoded' => 0, |
4299 | 227 | 'xpath' => '', | 241 | 'xpath' => '', |
4300 | 228 | 'xpath_sorting' => '', | 242 | 'xpath_sorting' => '', |
4301 | 229 | 'default_value' => '', | 243 | 'default_value' => '', |
4303 | 230 | 'wrap' => "key.wrap = <dt class=\"tx-dlf-metadata-type\">|</dt>\nvalue.required = 1\nvalue.wrap = <dd class=\"tx-dlf-metadata-type\">|</dd>", | 244 | 'wrap' => '', |
4304 | 231 | 'tokenized' => 0, | 245 | 'tokenized' => 0, |
4305 | 232 | 'stored' => 1, | 246 | 'stored' => 1, |
4306 | 233 | 'indexed' => 0, | 247 | 'indexed' => 0, |
4307 | @@ -235,6 +249,7 @@ | |||
4308 | 235 | 'is_sortable' => 1, | 249 | 'is_sortable' => 1, |
4309 | 236 | 'is_facet' => 1, | 250 | 'is_facet' => 1, |
4310 | 237 | 'is_listed' => 1, | 251 | 'is_listed' => 1, |
4311 | 252 | 'autocomplete' => 0, | ||
4312 | 238 | ) | 253 | ) |
4313 | 239 | ); | 254 | ); |
4314 | 240 | 255 | ||
4315 | 241 | 256 | ||
4316 | === modified file 'dlf/plugins/collection/class.tx_dlf_collection.php' | |||
4317 | --- dlf/plugins/collection/class.tx_dlf_collection.php 2012-08-07 14:42:49 +0000 | |||
4318 | +++ dlf/plugins/collection/class.tx_dlf_collection.php 2012-08-17 07:00:27 +0000 | |||
4319 | @@ -56,7 +56,11 @@ | |||
4320 | 56 | // Quit without doing anything if required configuration variables are not set. | 56 | // Quit without doing anything if required configuration variables are not set. |
4321 | 57 | if (empty($this->conf['pages'])) { | 57 | if (empty($this->conf['pages'])) { |
4322 | 58 | 58 | ||
4324 | 59 | trigger_error('Incomplete configuration for plugin '.get_class($this), E_USER_NOTICE); | 59 | if (TYPO3_DLOG) { |
4325 | 60 | |||
4326 | 61 | t3lib_div::devLog('[tx_dlf_collection->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf); | ||
4327 | 62 | |||
4328 | 63 | } | ||
4329 | 60 | 64 | ||
4330 | 61 | return $content; | 65 | return $content; |
4331 | 62 | 66 | ||
4332 | @@ -201,9 +205,9 @@ | |||
4333 | 201 | // Add feed link if applicable. | 205 | // Add feed link if applicable. |
4334 | 202 | if (!empty($this->conf['targetFeed'])) { | 206 | if (!empty($this->conf['targetFeed'])) { |
4335 | 203 | 207 | ||
4337 | 204 | $_img = '<img src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/icons/txdlffeeds.png" alt="'.$this->pi_getLL('feedAlt', '', TRUE).'" title="'.$this->pi_getLL('feedTitle', '', TRUE).'" />'; | 208 | $img = '<img src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/icons/txdlffeeds.png" alt="'.$this->pi_getLL('feedAlt', '', TRUE).'" title="'.$this->pi_getLL('feedTitle', '', TRUE).'" />'; |
4338 | 205 | 209 | ||
4340 | 206 | $markerArray[$resArray['uid']]['###FEED###'] = $this->pi_linkTP($_img, array ($this->prefixId => array ('collection' => $resArray['uid'])), FALSE, $this->conf['targetFeed']); | 210 | $markerArray[$resArray['uid']]['###FEED###'] = $this->pi_linkTP($img, array ($this->prefixId => array ('collection' => $resArray['uid'])), FALSE, $this->conf['targetFeed']); |
4341 | 207 | 211 | ||
4342 | 208 | } else { | 212 | } else { |
4343 | 209 | 213 | ||
4344 | @@ -215,21 +219,21 @@ | |||
4345 | 215 | $markerArray[$resArray['uid']]['###DESCRIPTION###'] = $this->pi_RTEcssText($resArray['description']); | 219 | $markerArray[$resArray['uid']]['###DESCRIPTION###'] = $this->pi_RTEcssText($resArray['description']); |
4346 | 216 | 220 | ||
4347 | 217 | // Build statistic's output. | 221 | // Build statistic's output. |
4355 | 218 | $_labelTitles = $this->pi_getLL(($resArray['titles'] > 1 ? 'titles' : 'title'), '', FALSE); | 222 | $labelTitles = $this->pi_getLL(($resArray['titles'] > 1 ? 'titles' : 'title'), '', FALSE); |
4356 | 219 | 223 | ||
4357 | 220 | $markerArray[$resArray['uid']]['###COUNT_TITLES###'] = htmlspecialchars($resArray['titles'].$_labelTitles); | 224 | $markerArray[$resArray['uid']]['###COUNT_TITLES###'] = htmlspecialchars($resArray['titles'].$labelTitles); |
4358 | 221 | 225 | ||
4359 | 222 | $_labelVolumes = $this->pi_getLL(($volumes[$resArray['uid']] > 1 ? 'volumes' : 'volume'), '', FALSE); | 226 | $labelVolumes = $this->pi_getLL(($volumes[$resArray['uid']] > 1 ? 'volumes' : 'volume'), '', FALSE); |
4360 | 223 | 227 | ||
4361 | 224 | $markerArray[$resArray['uid']]['###COUNT_VOLUMES###'] = htmlspecialchars($volumes[$resArray['uid']].$_labelVolumes); | 228 | $markerArray[$resArray['uid']]['###COUNT_VOLUMES###'] = htmlspecialchars($volumes[$resArray['uid']].$labelVolumes); |
4362 | 225 | 229 | ||
4363 | 226 | } | 230 | } |
4364 | 227 | 231 | ||
4365 | 228 | $entry = $this->cObj->getSubpart($this->template, '###ENTRY###'); | 232 | $entry = $this->cObj->getSubpart($this->template, '###ENTRY###'); |
4366 | 229 | 233 | ||
4368 | 230 | foreach ($markerArray as $_markerArray) { | 234 | foreach ($markerArray as $marker) { |
4369 | 231 | 235 | ||
4371 | 232 | $content .= $this->cObj->substituteMarkerArray($entry, $_markerArray); | 236 | $content .= $this->cObj->substituteMarkerArray($entry, $marker); |
4372 | 233 | 237 | ||
4373 | 234 | } | 238 | } |
4374 | 235 | 239 | ||
4375 | @@ -271,9 +275,9 @@ | |||
4376 | 271 | // Process results. | 275 | // Process results. |
4377 | 272 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { | 276 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
4378 | 273 | 277 | ||
4380 | 274 | if (empty($_metadata)) { | 278 | if (empty($listMetadata)) { |
4381 | 275 | 279 | ||
4383 | 276 | $_metadata = array ( | 280 | $listMetadata = array ( |
4384 | 277 | 'label' => htmlspecialchars($resArray['collLabel']), | 281 | 'label' => htmlspecialchars($resArray['collLabel']), |
4385 | 278 | 'description' => $this->pi_RTEcssText($resArray['collDesc']), | 282 | 'description' => $this->pi_RTEcssText($resArray['collDesc']), |
4386 | 279 | 'options' => array ( | 283 | 'options' => array ( |
4387 | @@ -379,7 +383,7 @@ | |||
4388 | 379 | 383 | ||
4389 | 380 | $list->add(array_values($toplevel)); | 384 | $list->add(array_values($toplevel)); |
4390 | 381 | 385 | ||
4392 | 382 | $list->metadata = $_metadata; | 386 | $list->metadata = $listMetadata; |
4393 | 383 | 387 | ||
4394 | 384 | $list->save(); | 388 | $list->save(); |
4395 | 385 | 389 | ||
4396 | 386 | 390 | ||
4397 | === modified file 'dlf/plugins/feeds/class.tx_dlf_feeds.php' | |||
4398 | --- dlf/plugins/feeds/class.tx_dlf_feeds.php 2012-03-24 09:05:28 +0000 | |||
4399 | +++ dlf/plugins/feeds/class.tx_dlf_feeds.php 2012-08-17 07:00:27 +0000 | |||
4400 | @@ -77,7 +77,7 @@ | |||
4401 | 77 | 77 | ||
4402 | 78 | } | 78 | } |
4403 | 79 | 79 | ||
4405 | 80 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 80 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
4406 | 81 | 'tx_dlf_libraries.label AS label', | 81 | 'tx_dlf_libraries.label AS label', |
4407 | 82 | 'tx_dlf_libraries', | 82 | 'tx_dlf_libraries', |
4408 | 83 | 'tx_dlf_libraries.pid='.intval($this->conf['pages']).' AND tx_dlf_libraries.uid='.intval($this->conf['library']).tx_dlf_helper::whereClause('tx_dlf_libraries'), | 83 | 'tx_dlf_libraries.pid='.intval($this->conf['pages']).' AND tx_dlf_libraries.uid='.intval($this->conf['library']).tx_dlf_helper::whereClause('tx_dlf_libraries'), |
4409 | @@ -86,11 +86,11 @@ | |||
4410 | 86 | '1' | 86 | '1' |
4411 | 87 | ); | 87 | ); |
4412 | 88 | 88 | ||
4418 | 89 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result)) { | 89 | if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
4419 | 90 | 90 | ||
4420 | 91 | $_resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result); | 91 | $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
4421 | 92 | 92 | ||
4422 | 93 | $channel->appendChild($rss->createElement('copyright', htmlspecialchars($_resArray['label'], ENT_NOQUOTES, 'UTF-8'))); | 93 | $channel->appendChild($rss->createElement('copyright', htmlspecialchars($resArray['label'], ENT_NOQUOTES, 'UTF-8'))); |
4423 | 94 | 94 | ||
4424 | 95 | } | 95 | } |
4425 | 96 | 96 | ||
4426 | 97 | 97 | ||
4427 | === modified file 'dlf/plugins/listview/class.tx_dlf_listview.php' | |||
4428 | --- dlf/plugins/listview/class.tx_dlf_listview.php 2012-08-07 15:30:34 +0000 | |||
4429 | +++ dlf/plugins/listview/class.tx_dlf_listview.php 2012-08-17 07:00:27 +0000 | |||
4430 | @@ -162,71 +162,71 @@ | |||
4431 | 162 | 162 | ||
4432 | 163 | $element = $this->list->elements[$number]; | 163 | $element = $this->list->elements[$number]; |
4433 | 164 | 164 | ||
4439 | 165 | foreach ($this->metadata as $_index_name => $_metaConf) { | 165 | foreach ($this->metadata as $index_name => $metaConf) { |
4440 | 166 | 166 | ||
4441 | 167 | $value = ''; | 167 | $parsedValue = ''; |
4442 | 168 | 168 | ||
4443 | 169 | $fieldwrap = $this->parseTS($_metaConf['wrap']); | 169 | $fieldwrap = $this->parseTS($metaConf['wrap']); |
4444 | 170 | 170 | ||
4445 | 171 | do { | 171 | do { |
4446 | 172 | 172 | ||
4448 | 173 | $_value = @array_shift($element['metadata'][$_index_name]); | 173 | $value = @array_shift($element['metadata'][$index_name]); |
4449 | 174 | 174 | ||
4450 | 175 | // Link title to pageview. | 175 | // Link title to pageview. |
4452 | 176 | if ($_index_name == 'title') { | 176 | if ($index_name == 'title') { |
4453 | 177 | 177 | ||
4454 | 178 | // Get title of parent document if needed. | 178 | // Get title of parent document if needed. |
4456 | 179 | if (empty($_value) && $this->conf['getTitle']) { | 179 | if (empty($value) && $this->conf['getTitle']) { |
4457 | 180 | 180 | ||
4459 | 181 | $_value = '['.tx_dlf_document::getTitle($element['uid'], TRUE).']'; | 181 | $value = '['.tx_dlf_document::getTitle($element['uid'], TRUE).']'; |
4460 | 182 | 182 | ||
4461 | 183 | } | 183 | } |
4462 | 184 | 184 | ||
4463 | 185 | // Set fake title if still not present. | 185 | // Set fake title if still not present. |
4465 | 186 | if (empty($_value)) { | 186 | if (empty($value)) { |
4466 | 187 | 187 | ||
4468 | 188 | $_value = $this->pi_getLL('noTitle'); | 188 | $value = $this->pi_getLL('noTitle'); |
4469 | 189 | 189 | ||
4470 | 190 | } | 190 | } |
4471 | 191 | 191 | ||
4473 | 192 | $_value = $this->pi_linkTP(htmlspecialchars($_value), array ($this->prefixId => array ('id' => $this->list->elements[$number]['uid'], 'page' => $element['page'], 'pointer' => $this->piVars['pointer'])), TRUE, $this->conf['targetPid']); | 192 | $value = $this->pi_linkTP(htmlspecialchars($value), array ($this->prefixId => array ('id' => $this->list->elements[$number]['uid'], 'page' => $element['page'], 'pointer' => $this->piVars['pointer'])), TRUE, $this->conf['targetPid']); |
4474 | 193 | 193 | ||
4475 | 194 | // Translate name of holding library. | 194 | // Translate name of holding library. |
4477 | 195 | } elseif ($_index_name == 'owner' && !empty($_value)) { | 195 | } elseif ($index_name == 'owner' && !empty($value)) { |
4478 | 196 | 196 | ||
4480 | 197 | $_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_libraries', $this->conf['pages'])); | 197 | $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
4481 | 198 | 198 | ||
4482 | 199 | // Translate document type. | 199 | // Translate document type. |
4484 | 200 | } elseif ($_index_name == 'type' && !empty($_value)) { | 200 | } elseif ($index_name == 'type' && !empty($value)) { |
4485 | 201 | 201 | ||
4487 | 202 | $_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_structures', $this->conf['pages'])); | 202 | $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
4488 | 203 | 203 | ||
4489 | 204 | // Translate ISO 639 language code. | 204 | // Translate ISO 639 language code. |
4515 | 205 | } elseif ($_index_name == 'language' && !empty($_value)) { | 205 | } elseif ($index_name == 'language' && !empty($value)) { |
4516 | 206 | 206 | ||
4517 | 207 | $_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value)); | 207 | $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value)); |
4518 | 208 | 208 | ||
4519 | 209 | } elseif (!empty($_value)) { | 209 | } elseif (!empty($value)) { |
4520 | 210 | 210 | ||
4521 | 211 | $_value = htmlspecialchars($_value); | 211 | $value = htmlspecialchars($value); |
4522 | 212 | 212 | ||
4523 | 213 | } | 213 | } |
4524 | 214 | 214 | ||
4525 | 215 | $_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']); | 215 | $value = $this->cObj->stdWrap($value, $fieldwrap['value.']); |
4526 | 216 | 216 | ||
4527 | 217 | if (!empty($_value)) { | 217 | if (!empty($value)) { |
4528 | 218 | 218 | ||
4529 | 219 | $value .= $_value; | 219 | $parsedValue .= $value; |
4530 | 220 | 220 | ||
4531 | 221 | } | 221 | } |
4532 | 222 | 222 | ||
4533 | 223 | } while (count($element['metadata'][$_index_name])); | 223 | } while (count($element['metadata'][$index_name])); |
4534 | 224 | 224 | ||
4535 | 225 | if (!empty($value)) { | 225 | if (!empty($parsedValue)) { |
4536 | 226 | 226 | ||
4537 | 227 | $field = $this->cObj->stdWrap(htmlspecialchars($_metaConf['label']), $fieldwrap['key.']); | 227 | $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']); |
4538 | 228 | 228 | ||
4539 | 229 | $field .= $value; | 229 | $field .= $parsedValue; |
4540 | 230 | 230 | ||
4541 | 231 | $markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']); | 231 | $markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']); |
4542 | 232 | 232 | ||
4543 | @@ -276,13 +276,20 @@ | |||
4544 | 276 | 276 | ||
4545 | 277 | } | 277 | } |
4546 | 278 | 278 | ||
4550 | 279 | $_uniqId = uniqid($prefix.'-'); | 279 | $uniqId = uniqid($prefix.'-'); |
4551 | 280 | 280 | ||
4552 | 281 | $sorting .= '<label for="'.$_uniqId.'">'.$this->pi_getLL('orderBy', '', TRUE).'</label><select id="'.$_uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();"><option value=""></option>'; | 281 | $sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('orderBy', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();">'; |
4553 | 282 | |||
4554 | 283 | // Add relevance sorting if this is a search result list. | ||
4555 | 284 | if ($this->list->metadata['options']['source'] == 'search') { | ||
4556 | 285 | |||
4557 | 286 | $sorting .= '<option value="relevance"'.(($this->list->metadata['options']['order'] == 'relevance') ? ' selected="selected"' : '').'>'.$this->pi_getLL('relevance', '', TRUE).'</option>'; | ||
4558 | 287 | |||
4559 | 288 | } | ||
4560 | 282 | 289 | ||
4561 | 283 | foreach ($this->sortables as $index_name => $label) { | 290 | foreach ($this->sortables as $index_name => $label) { |
4562 | 284 | 291 | ||
4564 | 285 | $sorting .= '<option value="'.$index_name.'"'.(($this->piVars['order'] == $index_name) ? ' selected="selected"' : '').'>'.htmlspecialchars($label).'</option>'; | 292 | $sorting .= '<option value="'.$index_name.'"'.(($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '').'>'.htmlspecialchars($label).'</option>'; |
4565 | 286 | 293 | ||
4566 | 287 | } | 294 | } |
4567 | 288 | 295 | ||
4568 | @@ -310,71 +317,71 @@ | |||
4569 | 310 | 317 | ||
4570 | 311 | $markerArray['###SUBMETADATA###'] = ''; | 318 | $markerArray['###SUBMETADATA###'] = ''; |
4571 | 312 | 319 | ||
4577 | 313 | foreach ($this->metadata as $_index_name => $_metaConf) { | 320 | foreach ($this->metadata as $index_name => $metaConf) { |
4578 | 314 | 321 | ||
4579 | 315 | $value = ''; | 322 | $parsedValue = ''; |
4580 | 316 | 323 | ||
4581 | 317 | $fieldwrap = $this->parseTS($_metaConf['wrap']); | 324 | $fieldwrap = $this->parseTS($metaConf['wrap']); |
4582 | 318 | 325 | ||
4583 | 319 | do { | 326 | do { |
4584 | 320 | 327 | ||
4586 | 321 | $_value = @array_shift($subpart['metadata'][$_index_name]); | 328 | $value = @array_shift($subpart['metadata'][$index_name]); |
4587 | 322 | 329 | ||
4588 | 323 | // Link title to pageview. | 330 | // Link title to pageview. |
4590 | 324 | if ($_index_name == 'title') { | 331 | if ($index_name == 'title') { |
4591 | 325 | 332 | ||
4592 | 326 | // Get title of parent document if needed. | 333 | // Get title of parent document if needed. |
4594 | 327 | if (empty($_value) && $this->conf['getTitle']) { | 334 | if (empty($value) && $this->conf['getTitle']) { |
4595 | 328 | 335 | ||
4597 | 329 | $_value = '['.tx_dlf_document::getTitle($subpart['uid'], TRUE).']'; | 336 | $value = '['.tx_dlf_document::getTitle($subpart['uid'], TRUE).']'; |
4598 | 330 | 337 | ||
4599 | 331 | } | 338 | } |
4600 | 332 | 339 | ||
4601 | 333 | // Set fake title if still not present. | 340 | // Set fake title if still not present. |
4603 | 334 | if (empty($_value)) { | 341 | if (empty($value)) { |
4604 | 335 | 342 | ||
4606 | 336 | $_value = $this->pi_getLL('noTitle'); | 343 | $value = $this->pi_getLL('noTitle'); |
4607 | 337 | 344 | ||
4608 | 338 | } | 345 | } |
4609 | 339 | 346 | ||
4611 | 340 | $_value = $this->pi_linkTP(htmlspecialchars($_value), array ($this->prefixId => array ('id' => $subpart['uid'], 'page' => $subpart['page'], 'pointer' => $this->piVars['pointer'])), TRUE, $this->conf['targetPid']); | 347 | $value = $this->pi_linkTP(htmlspecialchars($value), array ($this->prefixId => array ('id' => $subpart['uid'], 'page' => $subpart['page'], 'pointer' => $this->piVars['pointer'])), TRUE, $this->conf['targetPid']); |
4612 | 341 | 348 | ||
4613 | 342 | // Translate name of holding library. | 349 | // Translate name of holding library. |
4615 | 343 | } elseif ($_index_name == 'owner' && !empty($_value)) { | 350 | } elseif ($index_name == 'owner' && !empty($value)) { |
4616 | 344 | 351 | ||
4618 | 345 | $_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_libraries', $this->conf['pages'])); | 352 | $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
4619 | 346 | 353 | ||
4620 | 347 | // Translate document type. | 354 | // Translate document type. |
4622 | 348 | } elseif ($_index_name == 'type' && !empty($_value)) { | 355 | } elseif ($index_name == 'type' && !empty($value)) { |
4623 | 349 | 356 | ||
4625 | 350 | $_value = $this->pi_getLL($_value, tx_dlf_helper::translate($_value, 'tx_dlf_structures', $this->conf['pages']), FALSE); | 357 | $value = $this->pi_getLL($value, tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages']), FALSE); |
4626 | 351 | 358 | ||
4627 | 352 | // Translate ISO 639 language code. | 359 | // Translate ISO 639 language code. |
4653 | 353 | } elseif ($_index_name == 'language' && !empty($_value)) { | 360 | } elseif ($index_name == 'language' && !empty($value)) { |
4654 | 354 | 361 | ||
4655 | 355 | $_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value)); | 362 | $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value)); |
4656 | 356 | 363 | ||
4657 | 357 | } elseif (!empty($_value)) { | 364 | } elseif (!empty($value)) { |
4658 | 358 | 365 | ||
4659 | 359 | $_value = htmlspecialchars($_value); | 366 | $value = htmlspecialchars($value); |
4660 | 360 | 367 | ||
4661 | 361 | } | 368 | } |
4662 | 362 | 369 | ||
4663 | 363 | $_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']); | 370 | $value = $this->cObj->stdWrap($value, $fieldwrap['value.']); |
4664 | 364 | 371 | ||
4665 | 365 | if (!empty($_value)) { | 372 | if (!empty($value)) { |
4666 | 366 | 373 | ||
4667 | 367 | $value .= $_value; | 374 | $parsedValue .= $value; |
4668 | 368 | 375 | ||
4669 | 369 | } | 376 | } |
4670 | 370 | 377 | ||
4671 | 371 | } while (count($subpart['metadata'][$_index_name])); | 378 | } while (count($subpart['metadata'][$index_name])); |
4672 | 372 | 379 | ||
4673 | 373 | if (!empty($value)) { | 380 | if (!empty($parsedValue)) { |
4674 | 374 | 381 | ||
4675 | 375 | $field = $this->cObj->stdWrap(htmlspecialchars($_metaConf['label']), $fieldwrap['key.']); | 382 | $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']); |
4676 | 376 | 383 | ||
4677 | 377 | $field .= $value; | 384 | $field .= $parsedValue; |
4678 | 378 | 385 | ||
4679 | 379 | $markerArray['###SUBMETADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']); | 386 | $markerArray['###SUBMETADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']); |
4680 | 380 | 387 | ||
4681 | @@ -399,7 +406,7 @@ | |||
4682 | 399 | */ | 406 | */ |
4683 | 400 | protected function loadConfig() { | 407 | protected function loadConfig() { |
4684 | 401 | 408 | ||
4686 | 402 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 409 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
4687 | 403 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.wrap AS wrap,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.is_sortable AS is_sortable', | 410 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.wrap AS wrap,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.is_sortable AS is_sortable', |
4688 | 404 | 'tx_dlf_metadata', | 411 | 'tx_dlf_metadata', |
4689 | 405 | '(tx_dlf_metadata.is_listed=1 OR tx_dlf_metadata.is_sortable=1) AND tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'), | 412 | '(tx_dlf_metadata.is_listed=1 OR tx_dlf_metadata.is_sortable=1) AND tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
4690 | @@ -408,7 +415,7 @@ | |||
4691 | 408 | '' | 415 | '' |
4692 | 409 | ); | 416 | ); |
4693 | 410 | 417 | ||
4695 | 411 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { | 418 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
4696 | 412 | 419 | ||
4697 | 413 | if ($resArray['is_listed']) { | 420 | if ($resArray['is_listed']) { |
4698 | 414 | 421 | ||
4699 | @@ -456,11 +463,11 @@ | |||
4700 | 456 | $this->list->sort($this->piVars['order'], TRUE); | 463 | $this->list->sort($this->piVars['order'], TRUE); |
4701 | 457 | 464 | ||
4702 | 458 | // Update list's metadata. | 465 | // Update list's metadata. |
4708 | 459 | $_metadata = $this->list->metadata; | 466 | $listMetadata = $this->list->metadata; |
4709 | 460 | 467 | ||
4710 | 461 | $_metadata['options']['order'] = $this->piVars['order']; | 468 | $listMetadata['options']['order'] = $this->piVars['order']; |
4711 | 462 | 469 | ||
4712 | 463 | $this->list->metadata = $_metadata; | 470 | $this->list->metadata = $listMetadata; |
4713 | 464 | 471 | ||
4714 | 465 | // Save updated list. | 472 | // Save updated list. |
4715 | 466 | $this->list->save(); | 473 | $this->list->save(); |
4716 | 467 | 474 | ||
4717 | === modified file 'dlf/plugins/listview/locallang.xml' | |||
4718 | --- dlf/plugins/listview/locallang.xml 2011-11-10 16:20:57 +0000 | |||
4719 | +++ dlf/plugins/listview/locallang.xml 2012-08-17 07:00:27 +0000 | |||
4720 | @@ -19,6 +19,7 @@ | |||
4721 | 19 | <label index="separator"> - </label> | 19 | <label index="separator"> - </label> |
4722 | 20 | <label index="skip">...</label> | 20 | <label index="skip">...</label> |
4723 | 21 | <label index="orderBy">Order by: </label> | 21 | <label index="orderBy">Order by: </label> |
4724 | 22 | <label index="relevance">relevance</label> | ||
4725 | 22 | <label index="noTitle">[no title]</label> | 23 | <label index="noTitle">[no title]</label> |
4726 | 23 | </languageKey> | 24 | </languageKey> |
4727 | 24 | <languageKey index="de" type="array"> | 25 | <languageKey index="de" type="array"> |
4728 | @@ -35,6 +36,7 @@ | |||
4729 | 35 | <label index="separator"> - </label> | 36 | <label index="separator"> - </label> |
4730 | 36 | <label index="skip">...</label> | 37 | <label index="skip">...</label> |
4731 | 37 | <label index="orderBy">Sortieren nach: </label> | 38 | <label index="orderBy">Sortieren nach: </label> |
4732 | 39 | <label index="relevance">Relevanz</label> | ||
4733 | 38 | <label index="noTitle">[kein Titel]</label> | 40 | <label index="noTitle">[kein Titel]</label> |
4734 | 39 | </languageKey> | 41 | </languageKey> |
4735 | 40 | </data> | 42 | </data> |
4736 | 41 | 43 | ||
4737 | === modified file 'dlf/plugins/metadata/class.tx_dlf_metadata.php' | |||
4738 | --- dlf/plugins/metadata/class.tx_dlf_metadata.php 2012-08-07 15:15:45 +0000 | |||
4739 | +++ dlf/plugins/metadata/class.tx_dlf_metadata.php 2012-08-17 07:00:27 +0000 | |||
4740 | @@ -68,36 +68,36 @@ | |||
4741 | 68 | if ($this->conf['rootline'] < 2) { | 68 | if ($this->conf['rootline'] < 2) { |
4742 | 69 | 69 | ||
4743 | 70 | // Get current structure's @ID. | 70 | // Get current structure's @ID. |
4745 | 71 | $_ids = array (); | 71 | $ids = array (); |
4746 | 72 | 72 | ||
4747 | 73 | if (!empty($this->doc->physicalPages[$this->piVars['page']]) && !empty($this->doc->smLinks['p2l'][$this->doc->physicalPages[$this->piVars['page']]])) { | 73 | if (!empty($this->doc->physicalPages[$this->piVars['page']]) && !empty($this->doc->smLinks['p2l'][$this->doc->physicalPages[$this->piVars['page']]])) { |
4748 | 74 | 74 | ||
4754 | 75 | foreach ($this->doc->smLinks['p2l'][$this->doc->physicalPages[$this->piVars['page']]] as $_logId) { | 75 | foreach ($this->doc->smLinks['p2l'][$this->doc->physicalPages[$this->piVars['page']]] as $logId) { |
4755 | 76 | 76 | ||
4756 | 77 | $_count = count($this->doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$_logId.'"]/ancestor::*')); | 77 | $count = count($this->doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*')); |
4757 | 78 | 78 | ||
4758 | 79 | $_ids[$_count][] = $_logId; | 79 | $ids[$count][] = $logId; |
4759 | 80 | 80 | ||
4760 | 81 | } | 81 | } |
4761 | 82 | 82 | ||
4762 | 83 | } | 83 | } |
4763 | 84 | 84 | ||
4765 | 85 | ksort($_ids); | 85 | ksort($ids); |
4766 | 86 | 86 | ||
4768 | 87 | reset($_ids); | 87 | reset($ids); |
4769 | 88 | 88 | ||
4770 | 89 | // Check if we should display all metadata up to the root. | 89 | // Check if we should display all metadata up to the root. |
4771 | 90 | if ($this->conf['rootline'] == 1) { | 90 | if ($this->conf['rootline'] == 1) { |
4772 | 91 | 91 | ||
4782 | 92 | foreach ($_ids as $_id) { | 92 | foreach ($ids as $id) { |
4783 | 93 | 93 | ||
4784 | 94 | foreach ($_id as $id) { | 94 | foreach ($id as $sid) { |
4785 | 95 | 95 | ||
4786 | 96 | $_data = $this->doc->getMetadata($id, $this->conf['pages']); | 96 | $data = $this->doc->getMetadata($sid, $this->conf['pages']); |
4787 | 97 | 97 | ||
4788 | 98 | $_data['_id'] = $id; | 98 | $data['_id'] = $sid; |
4789 | 99 | 99 | ||
4790 | 100 | $metadata[] = $_data; | 100 | $metadata[] = $data; |
4791 | 101 | 101 | ||
4792 | 102 | } | 102 | } |
4793 | 103 | 103 | ||
4794 | @@ -105,17 +105,17 @@ | |||
4795 | 105 | 105 | ||
4796 | 106 | } else { | 106 | } else { |
4797 | 107 | 107 | ||
4809 | 108 | $_id = array_pop($_ids); | 108 | $id = array_pop($ids); |
4810 | 109 | 109 | ||
4811 | 110 | if (is_array($_id)) { | 110 | if (is_array($id)) { |
4812 | 111 | 111 | ||
4813 | 112 | foreach ($_id as $id) { | 112 | foreach ($id as $sid) { |
4814 | 113 | 113 | ||
4815 | 114 | $_data = $this->doc->getMetadata($id, $this->conf['pages']); | 114 | $data = $this->doc->getMetadata($sid, $this->conf['pages']); |
4816 | 115 | 115 | ||
4817 | 116 | $_data['_id'] = $id; | 116 | $data['_id'] = $sid; |
4818 | 117 | 117 | ||
4819 | 118 | $metadata[] = $_data; | 118 | $metadata[] = $data; |
4820 | 119 | 119 | ||
4821 | 120 | } | 120 | } |
4822 | 121 | 121 | ||
4823 | @@ -128,17 +128,21 @@ | |||
4824 | 128 | // Get titledata? | 128 | // Get titledata? |
4825 | 129 | if (empty($metadata)) { | 129 | if (empty($metadata)) { |
4826 | 130 | 130 | ||
4832 | 131 | $_data = $this->doc->getTitleData($this->conf['pages']); | 131 | $data = $this->doc->getTitleData($this->conf['pages']); |
4833 | 132 | 132 | ||
4834 | 133 | $_data['_id'] = ''; | 133 | $data['_id'] = $this->doc->toplevelId; |
4835 | 134 | 134 | ||
4836 | 135 | $metadata[] = $_data; | 135 | $metadata[] = $data; |
4837 | 136 | 136 | ||
4838 | 137 | } | 137 | } |
4839 | 138 | 138 | ||
4840 | 139 | if (empty($metadata)) { | 139 | if (empty($metadata)) { |
4841 | 140 | 140 | ||
4843 | 141 | trigger_error('No metadata found', E_USER_WARNING); | 141 | if (TYPO3_DLOG) { |
4844 | 142 | |||
4845 | 143 | t3lib_div::devLog('[tx_dlf_metadata->main('.$content.', [data])] No metadata found for document with UID "'.$this->doc->uid.'"', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf); | ||
4846 | 144 | |||
4847 | 145 | } | ||
4848 | 142 | 146 | ||
4849 | 143 | return $content; | 147 | return $content; |
4850 | 144 | 148 | ||
4851 | @@ -157,11 +161,11 @@ | |||
4852 | 157 | * | 161 | * |
4853 | 158 | * @access protected | 162 | * @access protected |
4854 | 159 | * | 163 | * |
4856 | 160 | * @param array $metadata: The metadata array | 164 | * @param array $metadataArray: The metadata array |
4857 | 161 | * | 165 | * |
4858 | 162 | * @return string The metadata array ready for output | 166 | * @return string The metadata array ready for output |
4859 | 163 | */ | 167 | */ |
4861 | 164 | protected function printMetadata(array $metadata) { | 168 | protected function printMetadata(array $metadataArray) { |
4862 | 165 | 169 | ||
4863 | 166 | // Load template file. | 170 | // Load template file. |
4864 | 167 | if (!empty($this->conf['templateFile'])) { | 171 | if (!empty($this->conf['templateFile'])) { |
4865 | @@ -181,7 +185,7 @@ | |||
4866 | 181 | // Get list of metadata to show. | 185 | // Get list of metadata to show. |
4867 | 182 | $metaList = array (); | 186 | $metaList = array (); |
4868 | 183 | 187 | ||
4870 | 184 | $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( | 188 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
4871 | 185 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.wrap AS wrap', | 189 | 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.wrap AS wrap', |
4872 | 186 | 'tx_dlf_metadata', | 190 | 'tx_dlf_metadata', |
4873 | 187 | 'tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'), | 191 | 'tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
4874 | @@ -190,7 +194,7 @@ | |||
4875 | 190 | '' | 194 | '' |
4876 | 191 | ); | 195 | ); |
4877 | 192 | 196 | ||
4879 | 193 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { | 197 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
4880 | 194 | 198 | ||
4881 | 195 | if ($this->conf['showFull'] || $resArray['is_listed']) { | 199 | if ($this->conf['showFull'] || $resArray['is_listed']) { |
4882 | 196 | 200 | ||
4883 | @@ -207,7 +211,7 @@ | |||
4884 | 207 | $cObjData = $this->cObj->data; | 211 | $cObjData = $this->cObj->data; |
4885 | 208 | 212 | ||
4886 | 209 | // Parse the metadata arrays. | 213 | // Parse the metadata arrays. |
4888 | 210 | foreach ($metadata as $_metadata) { | 214 | foreach ($metadataArray as $metadata) { |
4889 | 211 | 215 | ||
4890 | 212 | $markerArray['###METADATA###'] = ''; | 216 | $markerArray['###METADATA###'] = ''; |
4891 | 213 | 217 | ||
4892 | @@ -215,92 +219,92 @@ | |||
4893 | 215 | $this->cObj->data = $cObjData; | 219 | $this->cObj->data = $cObjData; |
4894 | 216 | 220 | ||
4895 | 217 | // Load all the metadata values into the content object's data array. | 221 | // Load all the metadata values into the content object's data array. |
4901 | 218 | foreach ($_metadata as $_index_name => $_value) { | 222 | foreach ($metadata as $index_name => $value) { |
4902 | 219 | 223 | ||
4903 | 220 | if (is_array($_value)) { | 224 | if (is_array($value)) { |
4904 | 221 | 225 | ||
4905 | 222 | $this->cObj->data[$_index_name] = implode($this->conf['separator'], $_value); | 226 | $this->cObj->data[$index_name] = implode($this->conf['separator'], $value); |
4906 | 223 | 227 | ||
4907 | 224 | } else { | 228 | } else { |
4908 | 225 | 229 | ||
4910 | 226 | $this->cObj->data[$_index_name] = $_value; | 230 | $this->cObj->data[$index_name] = $value; |
4911 | 227 | 231 | ||
4912 | 228 | } | 232 | } |
4913 | 229 | 233 | ||
4914 | 230 | } | 234 | } |
4915 | 231 | 235 | ||
4916 | 232 | // Process each metadate. | 236 | // Process each metadate. |
4922 | 233 | foreach ($metaList as $_index_name => $_metaConf) { | 237 | foreach ($metaList as $index_name => $metaConf) { |
4923 | 234 | 238 | ||
4924 | 235 | $value = ''; | 239 | $parsedValue = ''; |
4925 | 236 | 240 | ||
4926 | 237 | $fieldwrap = $this->parseTS($_metaConf['wrap']); | 241 | $fieldwrap = $this->parseTS($metaConf['wrap']); |
4927 | 238 | 242 | ||
4928 | 239 | do { | 243 | do { |
4929 | 240 | 244 | ||
4931 | 241 | $_value = @array_shift($_metadata[$_index_name]); | 245 | $value = @array_shift($metadata[$index_name]); |
4932 | 242 | 246 | ||
4934 | 243 | if ($_index_name == 'title') { | 247 | if ($index_name == 'title') { |
4935 | 244 | 248 | ||
4936 | 245 | // Get title of parent document if needed. | 249 | // Get title of parent document if needed. |
4938 | 246 | if (empty($_value) && $this->conf['getTitle'] && $this->doc->parentid) { | 250 | if (empty($value) && $this->conf['getTitle'] && $this->doc->parentid) { |
4939 | 247 | 251 | ||
4941 | 248 | $_value = '['.tx_dlf_document::getTitle($this->doc->parentid, TRUE).']'; | 252 | $value = '['.tx_dlf_document::getTitle($this->doc->parentid, TRUE).']'; |
4942 | 249 | 253 | ||
4943 | 250 | } | 254 | } |
4944 | 251 | 255 | ||
4946 | 252 | if (!empty($_value)) { | 256 | if (!empty($value)) { |
4947 | 253 | 257 | ||
4949 | 254 | $_value = htmlspecialchars($_value); | 258 | $value = htmlspecialchars($value); |
4950 | 255 | 259 | ||
4951 | 256 | // Link title to pageview. | 260 | // Link title to pageview. |
4957 | 257 | if ($this->conf['linkTitle'] && $_metadata['_id']) { | 261 | if ($this->conf['linkTitle'] && $metadata['_id']) { |
4958 | 258 | 262 | ||
4959 | 259 | $details = $this->doc->getLogicalStructure($_metadata['_id']); | 263 | $details = $this->doc->getLogicalStructure($metadata['_id']); |
4960 | 260 | 264 | ||
4961 | 261 | $_value = $this->pi_linkTP(htmlspecialchars($_value), array ($this->prefixId => array ('id' => $this->doc->uid, 'page' => (!empty($details['points']) ? intval($details['points']) : 1))), TRUE, $this->conf['targetPid']); | 265 | $value = $this->pi_linkTP(htmlspecialchars($value), array ($this->prefixId => array ('id' => $this->doc->uid, 'page' => (!empty($details['points']) ? intval($details['points']) : 1))), TRUE, $this->conf['targetPid']); |
4962 | 262 | 266 | ||
4963 | 263 | } | 267 | } |
4964 | 264 | 268 | ||
4965 | 265 | } | 269 | } |
4966 | 266 | 270 | ||
4968 | 267 | } elseif ($_index_name == 'owner' && !empty($_value)) { | 271 | } elseif ($index_name == 'owner' && !empty($value)) { |
4969 | 268 | 272 | ||
4970 | 269 | // Translate name of holding library. | 273 | // Translate name of holding library. |
4972 | 270 | $_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_libraries', $this->conf['pages'])); | 274 | $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages'])); |
4973 | 271 | 275 | ||
4975 | 272 | } elseif ($_index_name == 'type' && !empty($_value)) { | 276 | } elseif ($index_name == 'type' && !empty($value)) { |
4976 | 273 | 277 | ||
4977 | 274 | // Translate document type. | 278 | // Translate document type. |
4979 | 275 | $_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_structures', $this->conf['pages'])); | 279 | $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
4980 | 276 | 280 | ||
4982 | 277 | } elseif ($_index_name == 'language' && !empty($_value)) { | 281 | } elseif ($index_name == 'language' && !empty($value)) { |
4983 | 278 | 282 | ||
4984 | 279 | // Translate ISO 639 language code. | 283 | // Translate ISO 639 language code. |
4986 | 280 | $_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value)); | 284 | $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value)); |
4987 | 281 | 285 | ||
4989 | 282 | } elseif (!empty($_value)) { | 286 | } elseif (!empty($value)) { |
4990 | 283 | 287 | ||
4991 | 284 | // Sanitize value for output. | 288 | // Sanitize value for output. |
4992 | 285 | $_value = htmlspecialchars($_value); | ||
4993 | 286 | |||
4994 | 287 | } | ||
4995 | 288 | |||
4996 | 289 | $_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']); | ||
4997 | 290 | |||
4998 | 291 | if (!empty($_value)) { | ||
4999 | 292 | |||
5000 | 293 | $value .= $_value; |
The diff has been truncated for viewing.