Merge lp:goobi-presentation/1.1 into lp:~slub.team/goobi-presentation/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
Reviewer Review Type Date Requested Status
Sebastian Meyer Approve
Review via email: mp+120060@code.launchpad.net
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
=== modified file 'dlf/common/class.tx_dlf_document.php'
--- dlf/common/class.tx_dlf_document.php 2012-08-09 10:31:57 +0000
+++ dlf/common/class.tx_dlf_document.php 2012-08-17 07:00:27 +0000
@@ -35,7 +35,7 @@
35 * @subpackage tx_dlf35 * @subpackage tx_dlf
36 * @access public36 * @access public
37 */37 */
38class tx_dlf_document {38final class tx_dlf_document {
3939
40 /**40 /**
41 * This holds the whole XML file as string for serialization purposes41 * This holds the whole XML file as string for serialization purposes
@@ -87,15 +87,23 @@
87 * @access protected87 * @access protected
88 */88 */
89 protected $formats = array (89 protected $formats = array (
90 'OTHER' => array (90 'METS' => array (
91 'DVRIGHTS' => array (91 'rootElement' => 'mets',
92 'rootElement' => 'rights',92 'namespaceURI' => 'http://www.loc.gov/METS/',
93 'namespaceURI' => 'http://dfg-viewer.de/',93 ),
94 ),94 // This one can become a problem, because MODS uses its own custom XLINK schema.
95 'DVLINKS' => array (95 // @see http://comments.gmane.org/gmane.comp.text.mods/1126
96 'rootElement' => 'links',96 'XLINK' => array (
97 'namespaceURI' => 'http://dfg-viewer.de/',97 'rootElement' => 'xlink',
98 )98 'namespaceURI' => 'http://www.w3.org/1999/xlink',
99 ),
100 'DVRIGHTS' => array (
101 'rootElement' => 'rights',
102 'namespaceURI' => 'http://dfg-viewer.de/',
103 ),
104 'DVLINKS' => array (
105 'rootElement' => 'links',
106 'namespaceURI' => 'http://dfg-viewer.de/',
99 )107 )
100 );108 );
101109
@@ -300,13 +308,17 @@
300 */308 */
301 public function getFileLocation($id) {309 public function getFileLocation($id) {
302310
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"]'))) {
304312
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;
306314
307 } else {315 } else {
308316
309 trigger_error('There is no file node with @ID '.$id, E_USER_WARNING);317 if (TYPO3_DLOG) {
318
319 t3lib_div::devLog('[tx_dlf_document->getFileLocation('.$id.')] There is no file node with @ID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
320
321 }
310322
311 return '';323 return '';
312324
@@ -325,9 +337,9 @@
325337
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'])) {
327339
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) {
329341
330 $this->hookObjects[] = t3lib_div::getUserObj($_classRef);342 $this->hookObjects[] = t3lib_div::getUserObj($classRef);
331343
332 }344 }
333345
@@ -393,10 +405,10 @@
393 self::$registry[$instance->uid] = $instance;405 self::$registry[$instance->uid] = $instance;
394406
395 // Load extension configuration407 // Load extension configuration
396 $_extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']);408 $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']);
397409
398 // Save document to session if caching is enabled.410 // Save document to session if caching is enabled.
399 if (!empty($_extConf['caching'])) {411 if (!empty($extConf['caching'])) {
400412
401 tx_dlf_helper::saveToSession(self::$registry, get_class($instance));413 tx_dlf_helper::saveToSession(self::$registry, get_class($instance));
402414
@@ -412,6 +424,62 @@
412 /**424 /**
413 * This gets details about a logical structure element425 * This gets details about a logical structure element
414 *426 *
427 * @access public
428 *
429 * @param string $id: The @ID attribute of the logical structure node
430 * @param boolean $recursive: Whether to include the child elements
431 *
432 * @return array Array of the element's id, label, type and physical page indexes/mptr link
433 */
434 public function getLogicalStructure($id, $recursive = FALSE) {
435
436 $details = array ();
437
438 // Is the requested logical unit already loaded?
439 if (!$recursive && !empty($this->logicalUnits[$id])) {
440
441 // Yes. Return it.
442 return $this->logicalUnits[$id];
443
444 } elseif (!empty($id)) {
445
446 // Get specified logical unit.
447 $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]');
448
449 } else {
450
451 // Get all logical units at top level.
452 $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div');
453
454 }
455
456 if (!empty($divs)) {
457
458 if (!$recursive) {
459
460 // Get the details for the first xpath hit.
461 $details = $this->getLogicalStructureInfo($divs[0]);
462
463 } else {
464
465 // Walk the logical structure recursively and fill the whole table of contents.
466 foreach ($divs as $div) {
467
468 $this->tableOfContents[] = $this->getLogicalStructureInfo($div, TRUE);
469
470 }
471
472 }
473
474 }
475
476 return $details;
477
478 }
479
480 /**
481 * This gets details about a logical structure element
482 *
415 * @access protected483 * @access protected
416 *484 *
417 * @param SimpleXMLElement $structure: The logical structure node485 * @param SimpleXMLElement $structure: The logical structure node
@@ -439,6 +507,7 @@
439507
440 $details['volume'] = '';508 $details['volume'] = '';
441509
510 // Set volume information only if no label is set and this is the toplevel structure element.
442 if (empty($details['label']) && $details['id'] == $this->_getToplevelId()) {511 if (empty($details['label']) && $details['id'] == $this->_getToplevelId()) {
443512
444 $metadata = $this->getMetadata($details['id']);513 $metadata = $this->getMetadata($details['id']);
@@ -455,11 +524,14 @@
455524
456 $details['type'] = $attributes['TYPE'];525 $details['type'] = $attributes['TYPE'];
457526
527 // Load smLinks.
528 $this->_getSmLinks();
529
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.
459 $details['points'] = '';531 $details['points'] = '';
460532
461 // Is there a mptr node?533 // Is there a mptr node?
462 if (!empty($structure->children('http://www.loc.gov/METS/')->mptr)) {534 if (count($structure->children('http://www.loc.gov/METS/')->mptr)) {
463535
464 // Yes. Get the file reference.536 // Yes. Get the file reference.
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;
@@ -472,7 +544,7 @@
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.
473 $details['pagination'] = $this->physicalPagesInfo[$id]['label'];545 $details['pagination'] = $this->physicalPagesInfo[$id]['label'];
474546
475 // Is this the toplevel structure?547 // Is this the toplevel structure element?
476 } elseif ($details['id'] == $this->_getToplevelId()) {548 } elseif ($details['id'] == $this->_getToplevelId()) {
477549
478 // Yes. Point to itself.550 // Yes. Point to itself.
@@ -484,14 +556,14 @@
484 $this->logicalUnits[$details['id']] = $details;556 $this->logicalUnits[$details['id']] = $details;
485557
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?
487 if ($recursive && !empty($structure->children('http://www.loc.gov/METS/')->div)) {559 if ($recursive && count($structure->children('http://www.loc.gov/METS/')->div)) {
488560
489 $details['children'] = array ();561 $details['children'] = array ();
490562
491 foreach ($structure->children('http://www.loc.gov/METS/')->div as $child) {563 foreach ($structure->children('http://www.loc.gov/METS/')->div as $child) {
492564
493 // Repeat for all children.565 // Repeat for all children.
494 $details['children'][] = $this->getLogicalStructureInfo($child, $recursive);566 $details['children'][] = $this->getLogicalStructureInfo($child, TRUE);
495567
496 }568 }
497569
@@ -502,64 +574,6 @@
502 }574 }
503575
504 /**576 /**
505 * This gets details about a logical structure element
506 *
507 * @access public
508 *
509 * @param string $id: The @ID attribute of the logical structure node
510 * @param boolean $recursive: Whether to include the child elements
511 *
512 * @return array Array of the element's id, label, type and physical page indexes/mptr link
513 */
514 public function getLogicalStructure($id = '', $recursive = FALSE) {
515
516 // Is the requested logical unit already loaded?
517 if (!$recursive && !empty($id) && !empty($this->logicalUnits[$id])) {
518
519 // Yes. Return it.
520 return $this->logicalUnits[$id];
521
522 } elseif (!empty($id)) {
523
524 // Get specified logical unit.
525 $div = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]');
526
527 } elseif ($recursive) {
528
529 // Get all logical units at top level.
530 $div = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div');
531
532 }
533
534 if (!empty($div)) {
535
536 // Load smLinks.
537 $this->_getSmLinks();
538
539 foreach ($div as $structure) {
540
541 // Get logical unit's details.
542 $this->tableOfContents[] = $this->getLogicalStructureInfo($structure, $recursive);
543
544 }
545
546 }
547
548 if (!empty($this->logicalUnits[$id])) {
549
550 return $this->logicalUnits[$id];
551
552 } else {
553
554// trigger_error('There is no logical structure node with @ID '.$id, E_USER_WARNING);
555
556 return array ();
557
558 }
559
560 }
561
562 /**
563 * This extracts all the metadata for a logical structure node577 * This extracts all the metadata for a logical structure node
564 *578 *
565 * @access public579 * @access public
@@ -572,6 +586,9 @@
572 */586 */
573 public function getMetadata($id, $cPid = 0) {587 public function getMetadata($id, $cPid = 0) {
574588
589 // Save parameter for logging purposes.
590 $_cPid = $cPid;
591
575 // Make sure $cPid is a non-negative integer.592 // Make sure $cPid is a non-negative integer.
576 $cPid = max(intval($cPid), 0);593 $cPid = max(intval($cPid), 0);
577594
@@ -583,7 +600,11 @@
583600
584 } elseif (!$cPid) {601 } elseif (!$cPid) {
585602
586 trigger_error('Invalid PID ('.$cPid.') for metadata definitions', E_USER_WARNING);603 if (TYPO3_DLOG) {
604
605 t3lib_div::devLog('[tx_dlf_document->getMetadata('.$id.', '.$_cPid.')] Invalid PID "'.$cPid.'" for metadata definitions', $this->extKey, SYSLOG_SEVERITY_ERROR);
606
607 }
587608
588 return array ();609 return array ();
589610
@@ -597,7 +618,7 @@
597 }618 }
598619
599 // Initialize metadata array with empty values.620 // Initialize metadata array with empty values.
600 $_metadata = array (621 $metadata = array (
601 'title' => array (),622 'title' => array (),
602 'title_sorting' => array (),623 'title_sorting' => array (),
603 'author' => array (),624 'author' => array (),
@@ -619,17 +640,17 @@
619 // Get the logical structure node's DMDID.640 // Get the logical structure node's DMDID.
620 if (!empty($this->logicalUnits[$id])) {641 if (!empty($this->logicalUnits[$id])) {
621642
622 $_dmdId = $this->logicalUnits[$id]['dmdId'];643 $dmdId = $this->logicalUnits[$id]['dmdId'];
623644
624 } else {645 } else {
625646
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');
627648
628 $_dmdId = (string) $_dmdId[0];649 $dmdId = (string) $dmdId[0];
629650
630 }651 }
631652
632 if (!empty($_dmdId)) {653 if (!empty($dmdId)) {
633654
634 // Load available metadata formats and dmdSecs.655 // Load available metadata formats and dmdSecs.
635 $this->loadFormats();656 $this->loadFormats();
@@ -637,30 +658,34 @@
637 $this->_getDmdSec();658 $this->_getDmdSec();
638659
639 // Is this metadata format supported?660 // Is this metadata format supported?
640 if (!empty($this->formats[$this->dmdSec[$_dmdId]['type']]['class'])) {661 if (!empty($this->formats[$this->dmdSec[$dmdId]['type']]['class'])) {
641662
642 $_class = $this->formats[$this->dmdSec[$_dmdId]['type']]['class'];663 $class = $this->formats[$this->dmdSec[$dmdId]['type']]['class'];
643
644 } elseif (!empty($this->formats['OTHER'][$this->dmdSec[$_dmdId]['type']]['class'])) {
645
646 $_class = $this->formats['OTHER'][$this->dmdSec[$_dmdId]['type']]['class'];
647664
648 } else {665 } else {
649666
650 trigger_error('Unsupported metadata format or dmdSec with @ID '.$_dmdId.' not found', E_USER_WARNING);667 if (TYPO3_DLOG) {
668
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);
670
671 }
651672
652 return array ();673 return array ();
653674
654 }675 }
655676
656 // Get the metadata from class.677 // Get the metadata from class.
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) {
658679
659 $obj->extractMetadata($this->dmdSec[$_dmdId]['xml'], $_metadata);680 $obj->extractMetadata($this->dmdSec[$dmdId]['xml'], $metadata);
660681
661 } else {682 } else {
662683
663 trigger_error('Invalid class/method '.$_class.'->extractMetadata()', E_USER_ERROR);684 if (TYPO3_DLOG) {
685
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);
687
688 }
664689
665 return array ();690 return array ();
666691
@@ -669,84 +694,84 @@
669 // Get the structure's type.694 // Get the structure's type.
670 if (!empty($this->logicalUnits[$id])) {695 if (!empty($this->logicalUnits[$id])) {
671696
672 $_metadata['type'] = array ($this->logicalUnits[$id]['type']);697 $metadata['type'] = array ($this->logicalUnits[$id]['type']);
673698
674 } else {699 } else {
675700
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');
677702
678 $_metadata['type'] = array ((string) $_struct[0]);703 $metadata['type'] = array ((string) $struct[0]);
679704
680 }705 }
681706
682 // Get the additional metadata from database.707 // Get the additional metadata from database.
683 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(708 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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',
685 'tx_dlf_metadata,tx_dlf_formats',710 'tx_dlf_metadata,tx_dlf_formats',
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'),
687 '',712 '',
688 '',713 '',
689 ''714 ''
690 );715 );
691716
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.
693 $_domNode = dom_import_simplexml($this->dmdSec[$_dmdId]['xml']);718 $domNode = dom_import_simplexml($this->dmdSec[$dmdId]['xml']);
694719
695 $_domXPath = new DOMXPath($_domNode->ownerDocument);720 $domXPath = new DOMXPath($domNode->ownerDocument);
696721
697 $this->registerNamespaces($_domXPath);722 $this->registerNamespaces($domXPath);
698723
699 // OK, now make the XPath queries.724 // OK, now make the XPath queries.
700 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {725 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
701726
702 // Set metadata field's value(s).727 // Set metadata field's value(s).
703 if ($resArray['xpath'] && ($_values = $_domXPath->evaluate($resArray['xpath'], $_domNode))) {728 if ($resArray['xpath'] && ($values = $domXPath->evaluate($resArray['xpath'], $domNode))) {
704729
705 if ($_values instanceof DOMNodeList && $_values->length > 0) {730 if ($values instanceof DOMNodeList && $values->length > 0) {
706731
707 $_metadata[$resArray['index_name']] = array ();732 $metadata[$resArray['index_name']] = array ();
708733
709 foreach ($_values as $_value) {734 foreach ($values as $value) {
710735
711 $_metadata[$resArray['index_name']][] = trim((string) $_value->nodeValue);736 $metadata[$resArray['index_name']][] = trim((string) $value->nodeValue);
712737
713 }738 }
714739
715 } elseif (!($_values instanceof DOMNodeList)) {740 } elseif (!($values instanceof DOMNodeList)) {
716741
717 $_metadata[$resArray['index_name']] = array (trim((string) $_values));742 $metadata[$resArray['index_name']] = array (trim((string) $values));
718743
719 }744 }
720745
721 }746 }
722747
723 // Set default value if applicable.748 // Set default value if applicable.
724 if (empty($_metadata[$resArray['index_name']][0]) && $resArray['default_value']) {749 if (empty($metadata[$resArray['index_name']][0]) && $resArray['default_value']) {
725750
726 $_metadata[$resArray['index_name']] = array ($resArray['default_value']);751 $metadata[$resArray['index_name']] = array ($resArray['default_value']);
727752
728 }753 }
729754
730 // Set sorting value if applicable.755 // Set sorting value if applicable.
731 if (!empty($_metadata[$resArray['index_name']]) && $resArray['is_sortable']) {756 if (!empty($metadata[$resArray['index_name']]) && $resArray['is_sortable']) {
732757
733 if ($resArray['xpath_sorting'] && ($_values = $_domXPath->evaluate($resArray['xpath_sorting'], $_domNode))) {758 if ($resArray['xpath_sorting'] && ($values = $domXPath->evaluate($resArray['xpath_sorting'], $domNode))) {
734759
735 if ($_values instanceof DOMNodeList && $_values->length > 0) {760 if ($values instanceof DOMNodeList && $values->length > 0) {
736761
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);
738763
739 } elseif (!($_values instanceof DOMNodeList)) {764 } elseif (!($values instanceof DOMNodeList)) {
740765
741 $_metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $_values);766 $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values);
742767
743 }768 }
744769
745 }770 }
746771
747 if (empty($_metadata[$resArray['index_name'].'_sorting'][0])) {772 if (empty($metadata[$resArray['index_name'].'_sorting'][0])) {
748773
749 $_metadata[$resArray['index_name'].'_sorting'][0] = $_metadata[$resArray['index_name']][0];774 $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0];
750775
751 }776 }
752777
@@ -755,11 +780,11 @@
755 }780 }
756781
757 // Set title to empty string if not present.782 // Set title to empty string if not present.
758 if (empty($_metadata['title'][0])) {783 if (empty($metadata['title'][0])) {
759784
760 $_metadata['title'][0] = '';785 $metadata['title'][0] = '';
761786
762 $_metadata['title_sorting'][0] = '';787 $metadata['title_sorting'][0] = '';
763788
764 }789 }
765790
@@ -770,7 +795,7 @@
770795
771 }796 }
772797
773 return $_metadata;798 return $metadata;
774799
775 }800 }
776801
@@ -786,6 +811,9 @@
786 */811 */
787 public static function getTitle($uid, $recursive = FALSE) {812 public static function getTitle($uid, $recursive = FALSE) {
788813
814 // Save parameter for logging purposes.
815 $_uid = $uid;
816
789 $title = '';817 $title = '';
790818
791 // Sanitize input.819 // Sanitize input.
@@ -816,13 +844,21 @@
816844
817 } else {845 } else {
818846
819 trigger_error('No document with UID '.$uid.' found', E_USER_WARNING);847 if (TYPO3_DLOG) {
848
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);
850
851 }
820852
821 }853 }
822854
823 } else {855 } else {
824856
825 trigger_error('No UID given for document', E_USER_ERROR);857 if (TYPO3_DLOG) {
858
859 t3lib_div::devLog('[tx_dlf_document->getTitle('.$_uid.', ['.($recursive ? 'TRUE' : 'FALSE').'])] Invalid UID "'.$uid.'" for document', $this->extKey, SYSLOG_SEVERITY_ERROR);
860
861 }
826862
827 }863 }
828864
@@ -865,11 +901,11 @@
865 // Get METS node from XML file.901 // Get METS node from XML file.
866 $this->registerNamespaces($this->xml);902 $this->registerNamespaces($this->xml);
867903
868 $_mets = $this->xml->xpath('//mets:mets');904 $mets = $this->xml->xpath('//mets:mets');
869905
870 if ($_mets) {906 if ($mets) {
871907
872 $this->mets = $_mets[0];908 $this->mets = $mets[0];
873909
874 // Register namespaces.910 // Register namespaces.
875 $this->registerNamespaces($this->mets);911 $this->registerNamespaces($this->mets);
@@ -879,7 +915,11 @@
879915
880 } else {916 } else {
881917
882 trigger_error('No valid METS part found in document with UID '.$this->uid, E_USER_ERROR);918 if (TYPO3_DLOG) {
919
920 t3lib_div::devLog('[tx_dlf_document->init()] No METS part found in document with UID "'.$this->uid.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
921
922 }
883923
884 }924 }
885925
@@ -904,39 +944,48 @@
904 || version_compare(phpversion(), '5.3.3', '<')) {944 || version_compare(phpversion(), '5.3.3', '<')) {
905945
906 // Load extension configuration946 // Load extension configuration
907 $_extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']);947 $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']);
908948
909 // Set user-agent to identify self when fetching XML data.949 // Set user-agent to identify self when fetching XML data.
910 if (!empty($_extConf['useragent'])) {950 if (!empty($extConf['useragent'])) {
911951
912 @ini_set('user_agent', $_extConf['useragent']);952 @ini_set('user_agent', $extConf['useragent']);
913953
914 }954 }
915955
916 // Load XML from file...956 // Turn off libxml's error logging.
917 $_libxmlErrors = libxml_use_internal_errors(TRUE);957 $libxmlErrors = libxml_use_internal_errors(TRUE);
918958
919 $_xml = @simplexml_load_file($location);959 // Load XML from file.
920960 $xml = @simplexml_load_file($location);
921 libxml_use_internal_errors($_libxmlErrors);961
922962 // Reset libxml's error logging.
923 // ...and set some basic properties.963 libxml_use_internal_errors($libxmlErrors);
924 if ($_xml !== FALSE) {964
925965 // Set some basic properties.
926 $this->xml = $_xml;966 if ($xml !== FALSE) {
967
968 $this->xml = $xml;
927969
928 return TRUE;970 return TRUE;
929971
930 } else {972 } else {
931973
932 trigger_error('Could not load XML file from '.$location, E_USER_ERROR);974 if (TYPO3_DLOG) {
933 // TODO: libxml_get_errors() || libxml_get_last_error() || libxml_clear_errors()975
976 t3lib_div::devLog('[tx_dlf_document->load('.$location.')] Could not load XML file from "'.$location.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
977
978 }
934979
935 }980 }
936981
937 } else {982 } else {
938983
939 trigger_error('File location "'.$location.'" is not a valid URL', E_USER_ERROR);984 if (TYPO3_DLOG) {
985
986 t3lib_div::devLog('[tx_dlf_document->load('.$location.')] Invalid file location "'.$location.'" for document loading', $this->extKey, SYSLOG_SEVERITY_ERROR);
987
988 }
940989
941 }990 }
942991
@@ -956,8 +1005,8 @@
956 if (!$this->formatsLoaded) {1005 if (!$this->formatsLoaded) {
9571006
958 // Get available data formats from database.1007 // Get available data formats from database.
959 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(1008 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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',
961 'tx_dlf_formats',1010 'tx_dlf_formats',
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'),
963 '',1012 '',
@@ -965,27 +1014,14 @@
965 ''1014 ''
966 );1015 );
9671016
968 while ($_resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {1017 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
9691018
970 if (!$_resArray['other_type']) {1019 // Update format registry.
9711020 $this->formats[$resArray['type']] = array (
972 // Update format registry.1021 'rootElement' => $resArray['root'],
973 $this->formats[$_resArray['type']] = array (1022 'namespaceURI' => $resArray['namespace'],
974 'rootElement' => $_resArray['root'],1023 'class' => $resArray['class']
975 'namespaceURI' => $_resArray['namespace'],1024 );
976 'class' => $_resArray['class']
977 );
978
979 } else {
980
981 // Update format registry.
982 $this->formats['OTHER'][$_resArray['type']] = array (
983 'rootElement' => $_resArray['root'],
984 'namespaceURI' => $_resArray['namespace'],
985 'class' => $_resArray['class']
986 );
987
988 }
9891025
990 }1026 }
9911027
@@ -1011,43 +1047,28 @@
1011 // Do we have a SimpleXMLElement or DOMXPath object?1047 // Do we have a SimpleXMLElement or DOMXPath object?
1012 if ($obj instanceof SimpleXMLElement) {1048 if ($obj instanceof SimpleXMLElement) {
10131049
1014 $_method = 'registerXPathNamespace';1050 $method = 'registerXPathNamespace';
10151051
1016 } elseif ($obj instanceof DOMXPath) {1052 } elseif ($obj instanceof DOMXPath) {
10171053
1018 $_method = 'registerNamespace';1054 $method = 'registerNamespace';
10191055
1020 } else {1056 } else {
10211057
1022 trigger_error('No SimpleXMLElement or DOMXPath object given', E_USER_WARNING);1058 if (TYPO3_DLOG) {
1059
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);
1061
1062 }
10231063
1024 return;1064 return;
10251065
1026 }1066 }
10271067
1028 // Register mandatory METS' and XLINK's namespaces.
1029 $obj->$_method('mets', 'http://www.loc.gov/METS/');
1030
1031 // This one can become a problem, because MODS uses its own custom XLINK schema.
1032 // @see http://comments.gmane.org/gmane.comp.text.mods/1126
1033 $obj->$_method('xlink', 'http://www.w3.org/1999/xlink');
1034
1035 // Register metadata format's namespaces.1068 // Register metadata format's namespaces.
1036 foreach ($this->formats as $enc => $conf) {1069 foreach ($this->formats as $enc => $conf) {
10371070
1038 if ($enc != 'OTHER') {1071 $obj->$method(strtolower($enc), $conf['namespaceURI']);
1039
1040 $obj->$_method(strtolower($enc), $conf['namespaceURI']);
1041
1042 } else {
1043
1044 foreach ($conf as $otherEnc => $otherConf) {
1045
1046 $obj->$_method(strtolower($otherEnc), $otherConf['namespaceURI']);
1047
1048 }
1049
1050 }
10511072
1052 }1073 }
10531074
@@ -1065,9 +1086,18 @@
1065 */1086 */
1066 public function save($pid = 0, $core = 0) {1087 public function save($pid = 0, $core = 0) {
10671088
1089 // Save parameters for logging purposes.
1090 $_pid = $pid;
1091
1092 $_core = $core;
1093
1068 if (TYPO3_MODE !== 'BE') {1094 if (TYPO3_MODE !== 'BE') {
10691095
1070 trigger_error('Saving documents is only allowed in the backend!', E_USER_ERROR);1096 if (TYPO3_DLOG) {
1097
1098 t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] Saving a document is only allowed in the backend', $this->extKey, SYSLOG_SEVERITY_ERROR);
1099
1100 }
10711101
1072 return FALSE;1102 return FALSE;
10731103
@@ -1087,7 +1117,11 @@
10871117
1088 } elseif (!$pid) {1118 } elseif (!$pid) {
10891119
1090 trigger_error('Invalid PID ('.$pid.') given to save document', E_USER_WARNING);1120 if (TYPO3_DLOG) {
1121
1122 t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] Invalid PID "'.$pid.'" for document saving', $this->extKey, SYSLOG_SEVERITY_ERROR);
1123
1124 }
10911125
1092 return FALSE;1126 return FALSE;
10931127
@@ -1118,7 +1152,11 @@
1118 // Check for record identifier.1152 // Check for record identifier.
1119 if (empty($metadata['record_id'][0])) {1153 if (empty($metadata['record_id'][0])) {
11201154
1121 trigger_error('No record identifier found to avoid duplication', E_USER_WARNING);1155 if (TYPO3_DLOG) {
1156
1157 t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] No record identifier found to avoid duplication', $this->extKey, SYSLOG_SEVERITY_ERROR);
1158
1159 }
11221160
1123 return FALSE;1161 return FALSE;
11241162
@@ -1142,7 +1180,11 @@
11421180
1143 } else {1181 } else {
11441182
1145 trigger_error('Could not identify structure type', E_USER_ERROR);1183 if (TYPO3_DLOG) {
1184
1185 t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] Could not identify document/structure type', $this->extKey, SYSLOG_SEVERITY_ERROR);
1186
1187 }
11461188
1147 return FALSE;1189 return FALSE;
11481190
@@ -1166,23 +1208,23 @@
11661208
1167 $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);1209 $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
11681210
1169 $_collUid[$resArray['index_name']] = $resArray['uid'];1211 $collUid[$resArray['index_name']] = $resArray['uid'];
11701212
1171 }1213 }
11721214
1173 foreach ($metadata['collection'] as $collection) {1215 foreach ($metadata['collection'] as $collection) {
11741216
1175 if (!empty($_collUid[$collection])) {1217 if (!empty($collUid[$collection])) {
11761218
1177 // Add existing collection's UID.1219 // Add existing collection's UID.
1178 $collections[] = $_collUid[$collection];1220 $collections[] = $collUid[$collection];
11791221
1180 } else {1222 } else {
11811223
1182 // Insert new collection.1224 // Insert new collection.
1183 $_collNewUid = uniqid('NEW');1225 $collNewUid = uniqid('NEW');
11841226
1185 $_collData['tx_dlf_collections'][$_collNewUid] = array (1227 $collData['tx_dlf_collections'][$collNewUid] = array (
1186 'pid' => $pid,1228 'pid' => $pid,
1187 'label' => $collection,1229 'label' => $collection,
1188 'index_name' => $collection,1230 'index_name' => $collection,
@@ -1193,23 +1235,23 @@
1193 'status' => 0,1235 'status' => 0,
1194 );1236 );
11951237
1196 $_substUid = tx_dlf_helper::processDB($_collData);1238 $substUid = tx_dlf_helper::processDB($collData);
11971239
1198 // Prevent double insertion.1240 // Prevent double insertion.
1199 unset ($_collData);1241 unset ($collData);
12001242
1201 // Add new collection's UID.1243 // Add new collection's UID.
1202 $collections[] = $_substUid[$_collNewUid];1244 $collections[] = $substUid[$collNewUid];
12031245
1204 $_message = t3lib_div::makeInstance(1246 $message = t3lib_div::makeInstance(
1205 't3lib_FlashMessage',1247 't3lib_FlashMessage',
1206 htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.newCollection'), $collection, $_substUid[$_collNewUid])),1248 htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.newCollection'), $collection, $substUid[$collNewUid])),
1207 $GLOBALS['LANG']->getLL('flash.attention', TRUE),1249 $GLOBALS['LANG']->getLL('flash.attention', TRUE),
1208 t3lib_FlashMessage::INFO,1250 t3lib_FlashMessage::INFO,
1209 TRUE1251 TRUE
1210 );1252 );
12111253
1212 t3lib_FlashMessageQueue::addMessage($_message);1254 t3lib_FlashMessageQueue::addMessage($message);
12131255
1214 }1256 }
12151257
@@ -1254,9 +1296,9 @@
1254 } else {1296 } else {
12551297
1256 // Insert new library.1298 // Insert new library.
1257 $_libNewUid = uniqid('NEW');1299 $libNewUid = uniqid('NEW');
12581300
1259 $_libData['tx_dlf_libraries'][$_libNewUid] = array (1301 $libData['tx_dlf_libraries'][$libNewUid] = array (
1260 'pid' => $pid,1302 'pid' => $pid,
1261 'label' => $metadata['owner'][0],1303 'label' => $metadata['owner'][0],
1262 'index_name' => $metadata['owner'][0],1304 'index_name' => $metadata['owner'][0],
@@ -1271,20 +1313,20 @@
1271 'union_base' => '',1313 'union_base' => '',
1272 );1314 );
12731315
1274 $_substUid = tx_dlf_helper::processDB($_libData);1316 $substUid = tx_dlf_helper::processDB($libData);
12751317
1276 // Add new library's UID.1318 // Add new library's UID.
1277 $owner = $_substUid[$_libNewUid];1319 $owner = $substUid[$libNewUid];
12781320
1279 $_message = t3lib_div::makeInstance(1321 $message = t3lib_div::makeInstance(
1280 't3lib_FlashMessage',1322 't3lib_FlashMessage',
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])),
1282 $GLOBALS['LANG']->getLL('flash.attention', TRUE),1324 $GLOBALS['LANG']->getLL('flash.attention', TRUE),
1283 t3lib_FlashMessage::INFO,1325 t3lib_FlashMessage::INFO,
1284 TRUE1326 TRUE
1285 );1327 );
12861328
1287 t3lib_FlashMessageQueue::addMessage($_message);1329 t3lib_FlashMessageQueue::addMessage($message);
12881330
1289 }1331 }
12901332
@@ -1401,7 +1443,11 @@
14011443
1402 } else {1444 } else {
14031445
1404 trigger_error('Invalid UID for Solr core ('.$core.') given to index document', E_USER_NOTICE);1446 if (TYPO3_DLOG) {
1447
1448 t3lib_div::devLog('[tx_dlf_document->save('.$_pid.', '.$_core.')] Invalid UID "'.$core.'" for Solr core', $this->extKey, SYSLOG_SEVERITY_NOTICE);
1449
1450 }
14051451
1406 }1452 }
14071453
@@ -1437,49 +1483,39 @@
1437 $this->loadFormats();1483 $this->loadFormats();
14381484
1439 // Get dmdSec nodes from METS.1485 // Get dmdSec nodes from METS.
1440 $_dmdIds = $this->mets->xpath('./mets:dmdSec/@ID');1486 $dmdIds = $this->mets->xpath('./mets:dmdSec/@ID');
14411487
1442 foreach ($_dmdIds as $_dmdId) {1488 foreach ($dmdIds as $dmdId) {
14431489
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')) {
14451491
1446 if ($_type && !empty($this->formats[(string) $_type[0]]) && $_type[0] != 'OTHER') {1492 if (!empty($this->formats[(string) $type[0]])) {
14471493
1448 $_type = (string) $_type[0];1494 $type = (string) $type[0];
14491495
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']);
14511497
1452 if ($_xml) {1498 }
14531499
1454 $this->dmdSec[(string) $_dmdId]['type'] = $_type;1500 } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) {
14551501
1456 $this->dmdSec[(string) $_dmdId]['xml'] = $_xml[0];1502 if (!empty($this->formats[(string) $type[0]])) {
14571503
1458 $this->registerNamespaces($this->dmdSec[(string) $_dmdId]['xml']);1504 $type = (string) $type[0];
14591505
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']);
14611507
1462 } elseif ($_type && $_type[0] == 'OTHER') {1508 }
14631509
1464 $_otherType = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $_dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE');1510 }
14651511
1466 if ($_otherType && !empty($this->formats['OTHER'][(string) $_otherType[0]])) {1512 if ($xml) {
14671513
1468 $_otherType = (string) $_otherType[0];1514 $this->dmdSec[(string) $dmdId]['type'] = $type;
14691515
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];
14711517
1472 if ($_xml) {1518 $this->registerNamespaces($this->dmdSec[(string) $dmdId]['xml']);
1473
1474 $this->dmdSec[(string) $_dmdId]['type'] = $_otherType;
1475
1476 $this->dmdSec[(string) $_dmdId]['xml'] = $_xml[0];
1477
1478 $this->registerNamespaces($this->dmdSec[(string) $_dmdId]['xml']);
1479
1480 }
1481
1482 }
14831519
1484 }1520 }
14851521
@@ -1507,7 +1543,11 @@
15071543
1508 if (!$cPid) {1544 if (!$cPid) {
15091545
1510 trigger_error('No PID for metadata definitions found', E_USER_ERROR);1546 if (TYPO3_DLOG) {
1547
1548 t3lib_div::devLog('[tx_dlf_document->getMetadataArray()] Invalid PID "'.$cPid.'" for metadata definitions', $this->extKey, SYSLOG_SEVERITY_ERROR);
1549
1550 }
15111551
1512 return array ();1552 return array ();
15131553
@@ -1516,11 +1556,11 @@
1516 if (!$this->metadataArrayLoaded || $this->metadataArray[0] != $cPid) {1556 if (!$this->metadataArrayLoaded || $this->metadataArray[0] != $cPid) {
15171557
1518 // Get all logical structure nodes with metadata1558 // Get all logical structure nodes with metadata
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'))) {
15201560
1521 foreach ($_ids as $_id) {1561 foreach ($ids as $id) {
15221562
1523 $this->metadataArray[(string) $_id] = $this->getMetadata((string) $_id, $cPid);1563 $this->metadataArray[(string) $id] = $this->getMetadata((string) $id, $cPid);
15241564
1525 }1565 }
15261566
@@ -1591,26 +1631,26 @@
1591 if (!$this->physicalPagesLoaded) {1631 if (!$this->physicalPagesLoaded) {
15921632
1593 // Does the document have a structMap node of type "PHYSICAL"?1633 // Does the document have a structMap node of type "PHYSICAL"?
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"]');
15951635
1596 if ($_pageNodes) {1636 if ($pageNodes) {
15971637
1598 $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);1638 $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);
15991639
1600 $_useGrps = t3lib_div::trimExplode(',', $extConf['fileGrps']);1640 $useGrps = t3lib_div::trimExplode(',', $extConf['fileGrps']);
16011641
1602 // Yes. Get concordance of @FILEID and @USE attributes.1642 // Yes. Get concordance of @FILEID and @USE attributes.
1603 $_fileUse = array ();1643 $fileUse = array ();
16041644
1605 $_fileGrps = $this->mets->xpath('./mets:fileSec/mets:fileGrp');1645 $fileGrps = $this->mets->xpath('./mets:fileSec/mets:fileGrp');
16061646
1607 foreach ($_fileGrps as $_fileGrp) {1647 foreach ($fileGrps as $fileGrp) {
16081648
1609 if (in_array((string) $_fileGrp['USE'], $_useGrps)) {1649 if (in_array((string) $fileGrp['USE'], $useGrps)) {
16101650
1611 foreach ($_fileGrp->children('http://www.loc.gov/METS/')->file as $_file) {1651 foreach ($fileGrp->children('http://www.loc.gov/METS/')->file as $file) {
16121652
1613 $_fileUse[(string) $_file->attributes()->ID] = (string) $_fileGrp['USE'];1653 $fileUse[(string) $file->attributes()->ID] = (string) $fileGrp['USE'];
16141654
1615 }1655 }
16161656
@@ -1619,46 +1659,46 @@
1619 }1659 }
16201660
1621 // Get the physical sequence's metadata.1661 // Get the physical sequence's metadata.
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"]');
16231663
1624 $_physSeq[0] = (string) $_physNode[0]['ID'];1664 $physSeq[0] = (string) $physNode[0]['ID'];
16251665
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'] : '');
16271667
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'] : '');
16291669
1630 $this->physicalPagesInfo[$_physSeq[0]]['type'] = (string) $_physNode[0]['TYPE'];1670 $this->physicalPagesInfo[$physSeq[0]]['type'] = (string) $physNode[0]['TYPE'];
16311671
1632 // Get the file representations from fileSec node.1672 // Get the file representations from fileSec node.
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) {
16341674
1635 // Check if file has valid @USE attribute.1675 // Check if file has valid @USE attribute.
1636 if (!empty($_fileUse[(string) $_fptr->attributes()->FILEID])) {1676 if (!empty($fileUse[(string) $fptr->attributes()->FILEID])) {
16371677
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;
16391679
1640 }1680 }
16411681
1642 }1682 }
16431683
1644 // Build the physical pages' array from the physical structMap node.1684 // Build the physical pages' array from the physical structMap node.
1645 foreach ($_pageNodes as $_pageNode) {1685 foreach ($pageNodes as $pageNode) {
16461686
1647 $_pages[(int) $_pageNode['ORDER']] = (string) $_pageNode['ID'];1687 $pages[(int) $pageNode['ORDER']] = (string) $pageNode['ID'];
16481688
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'] : '');
16501690
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'] : '');
16521692
1653 $this->physicalPagesInfo[$_pages[(int) $_pageNode['ORDER']]]['type'] = (string) $_pageNode['TYPE'];1693 $this->physicalPagesInfo[$pages[(int) $pageNode['ORDER']]]['type'] = (string) $pageNode['TYPE'];
16541694
1655 // Get the file representations from fileSec node.1695 // Get the file representations from fileSec node.
1656 foreach ($_pageNode->children('http://www.loc.gov/METS/')->fptr as $_fptr) {1696 foreach ($pageNode->children('http://www.loc.gov/METS/')->fptr as $fptr) {
16571697
1658 // Check if file has valid @USE attribute.1698 // Check if file has valid @USE attribute.
1659 if (!empty($_fileUse[(string) $_fptr->attributes()->FILEID])) {1699 if (!empty($fileUse[(string) $fptr->attributes()->FILEID])) {
16601700
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;
16621702
1663 }1703 }
16641704
@@ -1667,13 +1707,13 @@
1667 }1707 }
16681708
1669 // Sort array by keys (= @ORDER).1709 // Sort array by keys (= @ORDER).
1670 if (ksort($_pages)) {1710 if (ksort($pages)) {
16711711
1672 // Set total number of pages.1712 // Set total number of pages.
1673 $this->numPages = count($_pages);1713 $this->numPages = count($pages);
16741714
1675 // Merge and re-index the array to get nice numeric indexes.1715 // Merge and re-index the array to get nice numeric indexes.
1676 $this->physicalPages = array_merge($_physSeq, $_pages);1716 $this->physicalPages = array_merge($physSeq, $pages);
16771717
1678 }1718 }
16791719
@@ -1905,22 +1945,25 @@
1905 // Cast to string for safety reasons.1945 // Cast to string for safety reasons.
1906 $location = (string) $uid;1946 $location = (string) $uid;
19071947
1908 // Get record identifier to check with database.1948 // Turn off libxml's error logging.
1909 $_libxmlErrors = libxml_use_internal_errors(TRUE);1949 $libxmlErrors = libxml_use_internal_errors(TRUE);
19101950
1951 // Load XML file.
1911 $xml = @simplexml_load_file($location);1952 $xml = @simplexml_load_file($location);
19121953
1913 libxml_use_internal_errors($_libxmlErrors);1954 // Reset libxml's error logging.
1955 libxml_use_internal_errors($libxmlErrors);
19141956
1915 if ($xml !== FALSE) {1957 if ($xml !== FALSE) {
19161958
1917 $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/');1959 $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/');
19181960
1919 $_objId = $xml->xpath('//mets:mets');1961 // Check for @OBJID in order to use it as record identifier.
19201962 $objId = $xml->xpath('//mets:mets');
1921 if (!empty($_objId[0]['OBJID'])) {1963
19221964 if (!empty($objId[0]['OBJID'])) {
1923 $this->recordid = (string) $_objId[0]['OBJID'];1965
1966 $this->recordid = (string) $objId[0]['OBJID'];
19241967
1925 }1968 }
19261969
@@ -1955,12 +1998,12 @@
1955 // Check for PID if needed.1998 // Check for PID if needed.
1956 if ($pid) {1999 if ($pid) {
19572000
1958 $whereClause .= ' AND tx_dlf_documents.pid='.$pid;2001 $whereClause .= ' AND tx_dlf_documents.pid='.intval($pid);
19592002
1960 }2003 }
19612004
1962 // Get document PID and location from database.2005 // Get document PID and location from database.
1963 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(2006 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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',
1965 'tx_dlf_documents',2008 'tx_dlf_documents',
1966 $whereClause,2009 $whereClause,
@@ -1969,9 +2012,9 @@
1969 '1'2012 '1'
1970 );2013 );
19712014
1972 if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) {2015 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
19732016
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);
19752018
1976 // Load XML file...2019 // Load XML file...
1977 if ($this->load($location)) {2020 if ($this->load($location)) {
@@ -1995,7 +2038,11 @@
19952038
1996 } else {2039 } else {
19972040
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) {
2042
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);
2044
2045 }
19992046
2000 }2047 }
20012048
@@ -2012,17 +2059,21 @@
2012 */2059 */
2013 public function __get($var) {2060 public function __get($var) {
20142061
2015 $_method = '_get'.ucfirst($var);2062 $method = '_get'.ucfirst($var);
20162063
2017 if (!property_exists($this, $var) || !method_exists($this, $_method)) {2064 if (!property_exists($this, $var) || !method_exists($this, $method)) {
20182065
2019 trigger_error('There is no get function for property '.$var, E_USER_ERROR);2066 if (TYPO3_DLOG) {
2067
2068 t3lib_div::devLog('[tx_dlf_document->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
2069
2070 }
20202071
2021 return;2072 return;
20222073
2023 } else {2074 } else {
20242075
2025 return $this->$_method();2076 return $this->$method();
20262077
2027 }2078 }
20282079
@@ -2040,15 +2091,19 @@
2040 */2091 */
2041 public function __set($var, $value) {2092 public function __set($var, $value) {
20422093
2043 $_method = '_set'.ucfirst($var);2094 $method = '_set'.ucfirst($var);
20442095
2045 if (!property_exists($this, $var) || !method_exists($this, $_method)) {2096 if (!property_exists($this, $var) || !method_exists($this, $method)) {
20462097
2047 trigger_error('There is no set function for property '.$var, E_USER_ERROR);2098 if (TYPO3_DLOG) {
2099
2100 t3lib_div::devLog('[tx_dlf_document->__set('.$var.', '.$value.')] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
2101
2102 }
20482103
2049 } else {2104 } else {
20502105
2051 $this->$_method($value);2106 $this->$method($value);
20522107
2053 }2108 }
20542109
@@ -2080,13 +2135,13 @@
2080 */2135 */
2081 public function __toString() {2136 public function __toString() {
20822137
2083 $_xml = new DOMDocument('1.0', 'utf-8');2138 $xml = new DOMDocument('1.0', 'utf-8');
20842139
2085 $_xml->appendChild($_xml->importNode(dom_import_simplexml($this->mets), TRUE));2140 $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), TRUE));
20862141
2087 $_xml->formatOutput = TRUE;2142 $xml->formatOutput = TRUE;
20882143
2089 return $_xml->saveXML();2144 return $xml->saveXML();
20902145
2091 }2146 }
20922147
@@ -2100,26 +2155,31 @@
2100 */2155 */
2101 public function __wakeup() {2156 public function __wakeup() {
21022157
2103 $_libxmlErrors = libxml_use_internal_errors(TRUE);2158 // Turn off libxml's error logging.
21042159 $libxmlErrors = libxml_use_internal_errors(TRUE);
2105 // Reload XML from string...2160
2106 $_xml = @simplexml_load_string($this->asXML);2161 // Reload XML from string.
21072162 $xml = @simplexml_load_string($this->asXML);
2108 libxml_use_internal_errors($_libxmlErrors);2163
21092164 // Reset libxml's error logging.
2110 if ($_xml !== FALSE) {2165 libxml_use_internal_errors($libxmlErrors);
2166
2167 if ($xml !== FALSE) {
21112168
2112 $this->asXML = '';2169 $this->asXML = '';
21132170
2114 $this->xml = $_xml;2171 $this->xml = $xml;
21152172
2116 // ...and rebuild the unserializable properties.2173 // Rebuild the unserializable properties.
2117 $this->init();2174 $this->init();
21182175
2119 } else {2176 } else {
21202177
2121 trigger_error('Could not reload XML from session', E_USER_ERROR);2178 if (TYPO3_DLOG) {
2122 // TODO: libxml_get_errors() || libxml_get_last_error() || libxml_clear_errors()2179
2180 t3lib_div::devLog('[tx_dlf_document->__wakeup()] Could not load XML after deserialization', $this->extKey, SYSLOG_SEVERITY_ERROR);
2181
2182 }
21232183
2124 }2184 }
21252185
21262186
=== modified file 'dlf/common/class.tx_dlf_helper.php'
--- dlf/common/class.tx_dlf_helper.php 2012-08-06 15:18:18 +0000
+++ dlf/common/class.tx_dlf_helper.php 2012-08-17 07:00:27 +0000
@@ -231,15 +231,25 @@
231 // Check for PHP extension "mcrypt".231 // Check for PHP extension "mcrypt".
232 if (!extension_loaded('mcrypt')) {232 if (!extension_loaded('mcrypt')) {
233233
234 trigger_error('PHP extension "mcrypt" not available', E_USER_WARNING);234 if (TYPO3_DLOG) {
235235
236 return NULL;236 t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] PHP extension "mcrypt" not available', $this->extKey, SYSLOG_SEVERITY_WARNING);
237
238 }
239
240 return;
237241
238 }242 }
239243
240 if (empty($encrypted) || empty($hash)) {244 if (empty($encrypted) || empty($hash)) {
241245
242 return NULL;246 if (TYPO3_DLOG) {
247
248 t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] Invalid parameters given for decryption', $this->extKey, SYSLOG_SEVERITY_ERROR);
249
250 }
251
252 return;
243253
244 }254 }
245255
@@ -253,7 +263,13 @@
253263
254 if ($hashed !== $hash) {264 if ($hashed !== $hash) {
255265
256 return NULL;266 if (TYPO3_DLOG) {
267
268 t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] Invalid hash "'.$hash.'" given for decryption', $this->extKey, SYSLOG_SEVERITY_WARNING);
269
270 }
271
272 return;
257273
258 }274 }
259275
@@ -276,9 +292,13 @@
276 // Check for PHP extension "mcrypt".292 // Check for PHP extension "mcrypt".
277 if (!extension_loaded('mcrypt')) {293 if (!extension_loaded('mcrypt')) {
278294
279 trigger_error('PHP extension "mcrypt" not available', E_USER_WARNING);295 if (TYPO3_DLOG) {
280296
281 return NULL;297 t3lib_div::devLog('[tx_dlf_helper->encrypt('.$string.')] PHP extension "mcrypt" not available', $this->extKey, SYSLOG_SEVERITY_WARNING);
298
299 }
300
301 return;
282302
283 }303 }
284304
@@ -305,22 +325,50 @@
305325
306 if (TYPO3_MODE === 'FE') {326 if (TYPO3_MODE === 'FE') {
307327
308 // TODO: Anpassen! (aus typo3/init.php übernommen)328 // Check for existing backend login.
309 $userObj = t3lib_div::makeInstance('t3lib_beUserAuth');329 if ($GLOBALS['TSFE']->beUserLogin > 0 && isset($GLOBALS['BE_USER'])) {
310330
311 $userObj->start();331 return $GLOBALS['BE_USER'];
312332
313 $userObj->backendCheckLogin();333 } elseif (!isset($_COOKIE['be_typo_user'])) {
314334
315 return $userObj;335 // Initialize backend session with CLI user's rights.
336 $userObj = t3lib_div::makeInstance('t3lib_beUserAuth');
337
338 $userObj->dontSetCookie = TRUE;
339
340 $userObj->start();
341
342 $userObj->setBeUserByName('_cli_dlf');
343
344 $userObj->backendCheckLogin();
345
346 return $userObj;
347
348 } else {
349
350 if (TYPO3_DLOG) {
351
352 t3lib_div::devLog('[tx_dlf_helper->getBeUser()] Could not determine current user\'s login status', $this->extKey, SYSLOG_SEVERITY_ERROR);
353
354 }
355
356 return;
357
358 }
316359
317 } elseif (TYPO3_MODE === 'BE') {360 } elseif (TYPO3_MODE === 'BE') {
318361
362 // Return current backend user.
319 return $GLOBALS['BE_USER'];363 return $GLOBALS['BE_USER'];
320364
321 } else {365 } else {
322366
323 trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING);367 if (TYPO3_DLOG) {
368
369 t3lib_div::devLog('[tx_dlf_helper->getBeUser()] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
370
371 }
324372
325 return;373 return;
326374
@@ -341,11 +389,21 @@
341 */389 */
342 public static function getIndexName($uid, $table, $pid = -1) {390 public static function getIndexName($uid, $table, $pid = -1) {
343391
392 // Save parameters for logging purposes.
393 $_uid = $uid;
394
395 $_pid = $pid;
396
397 // Sanitize input.
344 $uid = max(intval($uid), 0);398 $uid = max(intval($uid), 0);
345399
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'))) {
347401
348 trigger_error('At least one argument is not valid: UID='.$uid.' or TABLE='.$table, E_USER_WARNING);402 if (TYPO3_DLOG) {
403
404 t3lib_div::devLog('[tx_dlf_helper->getIndexName('.$_uid.', '.$table.', '.$_pid.')] Invalid UID "'.$uid.'" or table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
405
406 }
349407
350 return '';408 return '';
351409
@@ -353,6 +411,7 @@
353411
354 $where = '';412 $where = '';
355413
414 // Should we check for a specific PID, too?
356 if ($pid !== -1) {415 if ($pid !== -1) {
357416
358 $pid = max(intval($pid), 0);417 $pid = max(intval($pid), 0);
@@ -361,7 +420,8 @@
361420
362 }421 }
363422
364 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(423 // Get index_name from database.
424 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
365 $table.'.index_name AS index_name',425 $table.'.index_name AS index_name',
366 $table,426 $table,
367 $table.'.uid='.$uid.$where.self::whereClause($table),427 $table.'.uid='.$uid.$where.self::whereClause($table),
@@ -370,18 +430,24 @@
370 '1'430 '1'
371 );431 );
372432
373 if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) {433 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
374434
375 $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);435 $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
376436
377 return $resArray['index_name'];437 return $resArray['index_name'];
378438
439 } else {
440
441 if (TYPO3_DLOG) {
442
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);
444
445 }
446
447 return '';
448
379 }449 }
380450
381 trigger_error('No "index_name" with UID '.$uid.' found for PID '.$pid.' in TABLE '.$table, E_USER_WARNING);
382
383 return '';
384
385 }451 }
386452
387 /**453 /**
@@ -395,45 +461,52 @@
395 */461 */
396 public static function getLanguageName($code) {462 public static function getLanguageName($code) {
397463
398 $_code = strtolower(trim($code));464 // Analyze code and set appropriate ISO table.
399465 $isoCode = strtolower(trim($code));
400 if (preg_match('/^[a-z]{3}$/', $_code)) {466
401467 if (preg_match('/^[a-z]{3}$/', $isoCode)) {
402 $_file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-2b.xml';468
403469 $file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-2b.xml';
404 } elseif (preg_match('/^[a-z]{2}$/', $_code)) {470
405471 } elseif (preg_match('/^[a-z]{2}$/', $isoCode)) {
406 $_file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-1.xml';472
473 $file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-1.xml';
407474
408 } else {475 } else {
409476
477 // No ISO code, return unchanged.
410 return $code;478 return $code;
411479
412 }480 }
413481
482 // Load ISO table and get localized full name of language.
414 if (TYPO3_MODE === 'FE') {483 if (TYPO3_MODE === 'FE') {
415484
416 $iso639 = $GLOBALS['TSFE']->readLLfile($_file);485 $iso639 = $GLOBALS['TSFE']->readLLfile($file);
417486
418 if (!empty($iso639['default'][$_code])) {487 if (!empty($iso639['default'][$isoCode])) {
419488
420 $lang = $GLOBALS['TSFE']->getLLL($_code, $iso639);489 $lang = $GLOBALS['TSFE']->getLLL($isoCode, $iso639);
421490
422 }491 }
423492
424 } elseif (TYPO3_MODE === 'BE') {493 } elseif (TYPO3_MODE === 'BE') {
425494
426 $iso639 = $GLOBALS['LANG']->includeLLFile($_file, FALSE, TRUE);495 $iso639 = $GLOBALS['LANG']->includeLLFile($file, FALSE, TRUE);
427496
428 if (!empty($iso639['default'][$_code])) {497 if (!empty($iso639['default'][$isoCode])) {
429498
430 $lang = $GLOBALS['LANG']->getLLL($_code, $iso639, FALSE);499 $lang = $GLOBALS['LANG']->getLLL($isoCode, $iso639, FALSE);
431500
432 }501 }
433502
434 } else {503 } else {
435504
436 trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING);505 if (TYPO3_DLOG) {
506
507 t3lib_div::devLog('[tx_dlf_helper->getLanguageName('.$code.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
508
509 }
437510
438 return $code;511 return $code;
439512
@@ -445,7 +518,11 @@
445518
446 } else {519 } else {
447520
448 trigger_error('Language code "'.$code.'" not found', E_USER_WARNING);521 if (TYPO3_DLOG) {
522
523 t3lib_div::devLog('[tx_dlf_helper->getLanguageName('.$code.')] Language code "'.$code.'" not found in ISO-639 table', $this->extKey, SYSLOG_SEVERITY_NOTICE);
524
525 }
449526
450 return $code;527 return $code;
451528
@@ -466,7 +543,7 @@
466 */543 */
467 public static function getURN($base, $id) {544 public static function getURN($base, $id) {
468545
469 $concordance = array(546 $concordance = array (
470 '0' => 1,547 '0' => 1,
471 '1' => 2,548 '1' => 2,
472 '2' => 3,549 '2' => 3,
@@ -511,7 +588,11 @@
511588
512 if (preg_match('/[^a-z0-9:-]/', $urn)) {589 if (preg_match('/[^a-z0-9:-]/', $urn)) {
513590
514 trigger_error('Invalid chars in URN', E_USER_WARNING);591 if (TYPO3_DLOG) {
592
593 t3lib_div::devLog('[tx_dlf_helper->getURN('.$base.', '.$id.')] Invalid chars in given parameters', $this->extKey, SYSLOG_SEVERITY_WARNING);
594
595 }
515596
516 return '';597 return '';
517598
@@ -559,23 +640,31 @@
559 *640 *
560 * @access public641 * @access public
561 *642 *
562 * @param string $key: Session key for retrieval643 * @param string $key: Session data key for retrieval
563 *644 *
564 * @return mixed Session value for given key or NULL on failure645 * @return mixed Session value for given key or NULL on failure
565 */646 */
566 public static function loadFromSession($key) {647 public static function loadFromSession($key) {
567648
649 // Save parameter for logging purposes.
650 $_key = $key;
651
568 // Cast to string for security reasons.652 // Cast to string for security reasons.
569 $key = (string) $key;653 $key = (string) $key;
570654
571 if (!$key) {655 if (!$key) {
572656
573 trigger_error('No session key given', E_USER_WARNING);657 if (TYPO3_DLOG) {
658
659 t3lib_div::devLog('[tx_dlf_helper->loadFromSession('.$_key.')] Invalid key "'.$key.'" for session data retrieval', $this->extKey, SYSLOG_SEVERITY_WARNING);
660
661 }
574662
575 return;663 return;
576664
577 }665 }
578666
667 // Get the session data.
579 if (TYPO3_MODE === 'FE') {668 if (TYPO3_MODE === 'FE') {
580669
581 return $GLOBALS['TSFE']->fe_user->getKey('ses', $key);670 return $GLOBALS['TSFE']->fe_user->getKey('ses', $key);
@@ -586,7 +675,11 @@
586675
587 } else {676 } else {
588677
589 trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING);678 if (TYPO3_DLOG) {
679
680 t3lib_div::devLog('[tx_dlf_helper->loadFromSession('.$_key.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
681
682 }
590683
591 return;684 return;
592685
@@ -647,23 +740,31 @@
647 * @access public740 * @access public
648 *741 *
649 * @param string $value: Value to save742 * @param string $value: Value to save
650 * @param string $key: Session key for retrieval743 * @param string $key: Session data key for saving
651 *744 *
652 * @return boolean TRUE on success, FALSE on failure745 * @return boolean TRUE on success, FALSE on failure
653 */746 */
654 public static function saveToSession($value, $key) {747 public static function saveToSession($value, $key) {
655748
749 // Save parameter for logging purposes.
750 $_key = $key;
751
656 // Cast to string for security reasons.752 // Cast to string for security reasons.
657 $key = (string) $key;753 $key = (string) $key;
658754
659 if (!$key) {755 if (!$key) {
660756
661 trigger_error('No session key given', E_USER_WARNING);757 if (TYPO3_DLOG) {
758
759 t3lib_div::devLog('[tx_dlf_helper->saveToSession('.$value.', '.$_key.')] Invalid key "'.$key.'" for session data saving', $this->extKey, SYSLOG_SEVERITY_WARNING);
760
761 }
662762
663 return FALSE;763 return FALSE;
664764
665 }765 }
666766
767 // Save value in session data.
667 if (TYPO3_MODE === 'FE') {768 if (TYPO3_MODE === 'FE') {
668769
669 $GLOBALS['TSFE']->fe_user->setKey('ses', $key, $value);770 $GLOBALS['TSFE']->fe_user->setKey('ses', $key, $value);
@@ -680,7 +781,11 @@
680781
681 } else {782 } else {
682783
683 trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING);784 if (TYPO3_DLOG) {
785
786 t3lib_div::devLog('[tx_dlf_helper->saveToSession('.$value.', '.$_key.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
787
788 }
684789
685 return FALSE;790 return FALSE;
686791
@@ -689,82 +794,6 @@
689 }794 }
690795
691 /**796 /**
692 * This validates a METS file against its schemas
693 * TODO: nicht funktionstüchtig!
694 *
695 * @access public
696 *
697 * @param SimpleXMLElement $xml:
698 *
699 * @return void
700 */
701 public static function schemaValidate(SimpleXMLElement $xml) {
702
703 $_libxmlErrors = libxml_use_internal_errors(TRUE);
704
705 // Get schema locations.
706 $xml->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
707
708 $_schemaLocations = $xml->xpath('//*[@xsi:schemaLocation]');
709
710 foreach ($_schemaLocations as $_schemaLocation) {
711
712 $_schemas = explode(' ', (string) $_schemaLocation->attributes('http://www.w3.org/2001/XMLSchema-instance')->schemaLocation);
713
714 for ($i = 1, $j = count($_schemas); $i <= $j; $i++) {
715
716 if ($_schemas[$i] == 'http://www.loc.gov/METS/') {
717
718 $schema['mets'] = $_schemas[$i + 1];
719
720 } elseif ($_schemas[$i] == 'http://www.loc.gov/mods/v3') {
721
722 $schema['mods'] = $_schemas[$i + 1];
723
724 }
725
726 }
727
728 }
729 // TODO: Error-Handling (keine Schemas gefunden)
730
731 // Validate METS part against schema.
732 $dom = new DOMDocument('1.0', 'UTF-8');
733
734 $dom->appendChild($dom->importNode(dom_import_simplexml($this->mets), TRUE));
735
736 $dom->schemaValidate($schema['mets']);
737
738 // TODO: Error-Handling (invalider METS-Part)
739 // libxml_get_last_error() || libxml_get_errors() || libxml_clear_errors()
740
741 // Validate dmdSec parts against schema.
742 foreach ($this->dmdSec as $dmdSec) {
743
744 switch ($dmdSec['type']) {
745
746 case 'MODS':
747
748 $dom = new DOMDocument('1.0', 'UTF-8');
749
750 $dom->appendChild($dom->importNode(dom_import_simplexml($dmdSec['xml']), TRUE));
751
752 $dom->schemaValidate($schema['mods']);
753
754 // TODO: Error-Handling (invalider MODS-Part)
755 // libxml_get_last_error() || libxml_get_errors() || libxml_clear_errors()
756
757 break;
758
759 }
760
761 }
762
763 libxml_use_internal_errors($_libxmlErrors);
764
765 }
766
767 /**
768 * This translates an internal "index_name"797 * This translates an internal "index_name"
769 *798 *
770 * @access public799 * @access public
@@ -777,13 +806,24 @@
777 */806 */
778 public static function translate($index_name, $table, $pid) {807 public static function translate($index_name, $table, $pid) {
779808
809 // Save parameters for logging purposes.
810 $_index_name = $index_name;
811
812 $_pid = $pid;
813
814 // Load labels into static variable for future use.
780 static $labels = array ();815 static $labels = array ();
781816
817 // Sanitize input.
782 $pid = max(intval($pid), 0);818 $pid = max(intval($pid), 0);
783819
784 if (!$pid) {820 if (!$pid) {
785821
786 trigger_error('No PID given for translations', E_USER_WARNING);822 if (TYPO3_DLOG) {
823
824 t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] Invalid PID "'.$pid.'" for translation', $this->extKey, SYSLOG_SEVERITY_WARNING);
825
826 }
787827
788 return $index_name;828 return $index_name;
789829
@@ -811,7 +851,7 @@
811 }851 }
812852
813 // Get labels from database.853 // Get labels from database.
814 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(854 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
815 '*',855 '*',
816 $table,856 $table,
817 'pid='.$pid.$additionalWhere.self::whereClause($table),857 'pid='.$pid.$additionalWhere.self::whereClause($table),
@@ -820,9 +860,9 @@
820 ''860 ''
821 );861 );
822862
823 if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) {863 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
824864
825 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {865 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
826866
827 // Overlay localized labels if available.867 // Overlay localized labels if available.
828 if ($GLOBALS['TSFE']->sys_language_content > 0) {868 if ($GLOBALS['TSFE']->sys_language_content > 0) {
@@ -841,13 +881,21 @@
841881
842 } else {882 } else {
843883
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) {
885
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);
887
888 }
845889
846 }890 }
847891
848 } else {892 } else {
849893
850 trigger_error('The table '.$table.' is not allowed for translation', E_USER_ERROR);894 if (TYPO3_DLOG) {
895
896 t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] No translations available for table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
897
898 }
851899
852 }900 }
853901
@@ -916,7 +964,11 @@
916964
917 } else {965 } else {
918966
919 trigger_error('Unexpected TYPO3_MODE', E_USER_ERROR);967 if (TYPO3_DLOG) {
968
969 t3lib_div::devLog('[tx_dlf_helper->whereClause('.$table.', ['.($showHidden ? 'TRUE' : 'FALSE').'])] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
970
971 }
920972
921 return ' AND 1=-1';973 return ' AND 1=-1';
922974
923975
=== modified file 'dlf/common/class.tx_dlf_indexing.php'
--- dlf/common/class.tx_dlf_indexing.php 2012-08-09 10:31:57 +0000
+++ dlf/common/class.tx_dlf_indexing.php 2012-08-17 07:00:27 +0000
@@ -38,15 +38,6 @@
38class tx_dlf_indexing {38class tx_dlf_indexing {
3939
40 /**40 /**
41 * Array of autocompletable metadata
42 * @see loadIndexConf()
43 *
44 * @var array
45 * @access protected
46 */
47 protected static $autocompleted = array ();
48
49 /**
50 * The extension key41 * The extension key
51 *42 *
52 * @var string43 * @var string
@@ -55,31 +46,21 @@
55 public static $extKey = 'dlf';46 public static $extKey = 'dlf';
5647
57 /**48 /**
58 * Array of facets49 * Array of metadata fields' configuration
59 * @see loadIndexConf()50 * @see loadIndexConf()
60 *51 *
61 * @var array52 * @var array
62 * @access protected53 * @access protected
63 */54 */
64 protected static $facets = array ();55 protected static $fields = array (
6556 'autocompleted' => array (),
66 /**57 'facets' => array (),
67 * Array of fields' boost values58 'sortables' => array (),
68 * @see loadIndexConf()59 'indexed' => array (),
69 *60 'stored' => array (),
70 * @var array61 'tokenized' => array (),
71 * @access protected62 'fieldboost' => array ()
72 */63 );
73 protected static $fieldboost = array ();
74
75 /**
76 * Array of indexed metadata
77 * @see loadIndexConf()
78 *
79 * @var array
80 * @access protected
81 */
82 protected static $indexed = array ();
8364
84 /**65 /**
85 * List of already processed documents66 * List of already processed documents
@@ -98,33 +79,6 @@
98 protected static $solr;79 protected static $solr;
9980
100 /**81 /**
101 * Array of sortable metadata
102 * @see loadIndexConf()
103 *
104 * @var array
105 * @access protected
106 */
107 protected static $sortables = array ();
108
109 /**
110 * Array of stored metadata
111 * @see loadIndexConf()
112 *
113 * @var array
114 * @access protected
115 */
116 protected static $stored = array ();
117
118 /**
119 * Array of tokenized metadata
120 * @see loadIndexConf()
121 *
122 * @var array
123 * @access protected
124 */
125 protected static $tokenized = array ();
126
127 /**
128 * Array of toplevel structure elements82 * Array of toplevel structure elements
129 * @see loadIndexConf()83 * @see loadIndexConf()
130 *84 *
@@ -164,7 +118,11 @@
164118
165 } else {119 } else {
166120
167 trigger_error('Could not load multi-volume work with UID '.$doc->parentid, E_USER_ERROR);121 if (TYPO3_DLOG) {
122
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);
124
125 }
168126
169 return 1;127 return 1;
170128
@@ -195,7 +153,7 @@
195 self::$solr->commit();153 self::$solr->commit();
196154
197 // Get document title from database.155 // Get document title from database.
198 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(156 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
199 'tx_dlf_documents.title AS title',157 'tx_dlf_documents.title AS title',
200 'tx_dlf_documents',158 'tx_dlf_documents',
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'),
@@ -204,11 +162,11 @@
204 '1'162 '1'
205 );163 );
206164
207 $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);165 $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
208166
209 if (!defined('TYPO3_cliMode')) {167 if (!defined('TYPO3_cliMode')) {
210168
211 $_message = t3lib_div::makeInstance(169 $message = t3lib_div::makeInstance(
212 't3lib_FlashMessage',170 't3lib_FlashMessage',
213 htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)),171 htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)),
214 $GLOBALS['LANG']->getLL('flash.done', TRUE),172 $GLOBALS['LANG']->getLL('flash.done', TRUE),
@@ -216,7 +174,7 @@
216 TRUE174 TRUE
217 );175 );
218176
219 t3lib_FlashMessageQueue::addMessage($_message);177 t3lib_FlashMessageQueue::addMessage($message);
220178
221 }179 }
222180
@@ -226,7 +184,7 @@
226184
227 if (!defined('TYPO3_cliMode')) {185 if (!defined('TYPO3_cliMode')) {
228186
229 $_message = t3lib_div::makeInstance(187 $message = t3lib_div::makeInstance(
230 't3lib_FlashMessage',188 't3lib_FlashMessage',
231 $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),189 $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
232 $GLOBALS['LANG']->getLL('flash.error', TRUE),190 $GLOBALS['LANG']->getLL('flash.error', TRUE),
@@ -234,11 +192,15 @@
234 TRUE192 TRUE
235 );193 );
236194
237 t3lib_FlashMessageQueue::addMessage($_message);195 t3lib_FlashMessageQueue::addMessage($message);
238196
239 }197 }
240198
241 trigger_error('Apache Solr exception thrown: '.$e->getMessage(), E_USER_ERROR);199 if (TYPO3_DLOG) {
200
201 t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Apache Solr threw exception: "'.$e->getMessage().'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
202
203 }
242204
243 return 1;205 return 1;
244206
@@ -248,7 +210,7 @@
248210
249 if (!defined('TYPO3_cliMode')) {211 if (!defined('TYPO3_cliMode')) {
250212
251 $_message = t3lib_div::makeInstance(213 $message = t3lib_div::makeInstance(
252 't3lib_FlashMessage',214 't3lib_FlashMessage',
253 $GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE),215 $GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE),
254 $GLOBALS['LANG']->getLL('flash.warning', TRUE),216 $GLOBALS['LANG']->getLL('flash.warning', TRUE),
@@ -256,11 +218,15 @@
256 TRUE218 TRUE
257 );219 );
258220
259 t3lib_FlashMessageQueue::addMessage($_message);221 t3lib_FlashMessageQueue::addMessage($message);
260222
261 }223 }
262224
263 trigger_error('Could not connect to Apache Solr server', E_USER_WARNING);225 if (TYPO3_DLOG) {
226
227 t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not connect to Apache Solr server', $this->extKey, SYSLOG_SEVERITY_ERROR);
228
229 }
264230
265 return 1;231 return 1;
266232
@@ -279,6 +245,9 @@
279 */245 */
280 public static function delete($uid) {246 public static function delete($uid) {
281247
248 // Save parameter for logging purposes.
249 $_uid = $uid;
250
282 // Sanitize input.251 // Sanitize input.
283 $uid = max(intval($uid), 0);252 $uid = max(intval($uid), 0);
284253
@@ -310,7 +279,7 @@
310279
311 if (!defined('TYPO3_cliMode')) {280 if (!defined('TYPO3_cliMode')) {
312281
313 $_message = t3lib_div::makeInstance(282 $message = t3lib_div::makeInstance(
314 't3lib_FlashMessage',283 't3lib_FlashMessage',
315 $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),284 $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
316 $GLOBALS['LANG']->getLL('flash.error', TRUE),285 $GLOBALS['LANG']->getLL('flash.error', TRUE),
@@ -318,11 +287,15 @@
318 TRUE287 TRUE
319 );288 );
320289
321 t3lib_FlashMessageQueue::addMessage($_message);290 t3lib_FlashMessageQueue::addMessage($message);
322291
323 }292 }
324293
325 trigger_error('Apache Solr exception thrown: '.$e->getMessage(), E_USER_ERROR);294 if (TYPO3_DLOG) {
295
296 t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Apache Solr threw exception: "'.$e->getMessage().'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
297
298 }
326299
327 return 1;300 return 1;
328301
@@ -332,7 +305,7 @@
332305
333 if (!defined('TYPO3_cliMode')) {306 if (!defined('TYPO3_cliMode')) {
334307
335 $_message = t3lib_div::makeInstance(308 $message = t3lib_div::makeInstance(
336 't3lib_FlashMessage',309 't3lib_FlashMessage',
337 $GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE),310 $GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE),
338 $GLOBALS['LANG']->getLL('flash.error', TRUE),311 $GLOBALS['LANG']->getLL('flash.error', TRUE),
@@ -340,11 +313,15 @@
340 TRUE313 TRUE
341 );314 );
342315
343 t3lib_FlashMessageQueue::addMessage($_message);316 t3lib_FlashMessageQueue::addMessage($message);
344317
345 }318 }
346319
347 trigger_error('Could not connect to Apache Solr server', E_USER_ERROR);320 if (TYPO3_DLOG) {
321
322 t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Could not connect to Apache Solr server', $this->extKey, SYSLOG_SEVERITY_ERROR);
323
324 }
348325
349 return 1;326 return 1;
350327
@@ -352,7 +329,7 @@
352329
353 if (!defined('TYPO3_cliMode')) {330 if (!defined('TYPO3_cliMode')) {
354331
355 $_message = t3lib_div::makeInstance(332 $message = t3lib_div::makeInstance(
356 't3lib_FlashMessage',333 't3lib_FlashMessage',
357 htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentDeleted'), $title, $uid)),334 htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentDeleted'), $title, $uid)),
358 $GLOBALS['LANG']->getLL('flash.done', TRUE),335 $GLOBALS['LANG']->getLL('flash.done', TRUE),
@@ -360,7 +337,7 @@
360 TRUE337 TRUE
361 );338 );
362339
363 t3lib_FlashMessageQueue::addMessage($_message);340 t3lib_FlashMessageQueue::addMessage($message);
364341
365 }342 }
366343
@@ -368,7 +345,11 @@
368345
369 } else {346 } else {
370347
371 trigger_error('Could not find document with UID '.$uid, E_USER_ERROR);348 if (TYPO3_DLOG) {
349
350 t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Invalid UID "'.$uid.'" for document deletion', $this->extKey, SYSLOG_SEVERITY_ERROR);
351
352 }
372353
373 return 1;354 return 1;
374355
@@ -388,7 +369,7 @@
388 protected static function loadIndexConf($pid) {369 protected static function loadIndexConf($pid) {
389370
390 // Get the list of toplevel structures.371 // Get the list of toplevel structures.
391 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(372 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
392 'tx_dlf_structures.index_name AS index_name',373 'tx_dlf_structures.index_name AS index_name',
393 'tx_dlf_structures',374 'tx_dlf_structures',
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'),
@@ -397,14 +378,14 @@
397 ''378 ''
398 );379 );
399380
400 while ($_toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {381 while ($toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
401382
402 self::$toplevel[] = $_toplevel['index_name'];383 self::$toplevel[] = $toplevel['index_name'];
403384
404 }385 }
405386
406 // Get the metadata indexing options.387 // Get the metadata indexing options.
407 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(388 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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',
409 'tx_dlf_metadata',390 'tx_dlf_metadata',
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'),
@@ -413,51 +394,51 @@
413 ''394 ''
414 );395 );
415396
416 while ($_indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {397 while ($indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
417398
418 if ($_indexing['tokenized']) {399 if ($indexing['tokenized']) {
419400
420 self::$tokenized[] = $_indexing['index_name'];401 self::$fields['tokenized'][] = $indexing['index_name'];
421402
422 }403 }
423404
424 if ($_indexing['stored'] || $_indexing['is_listed']) {405 if ($indexing['stored'] || $indexing['is_listed']) {
425406
426 self::$stored[] = $_indexing['index_name'];407 self::$fields['stored'][] = $indexing['index_name'];
427408
428 }409 }
429410
430 if ($_indexing['indexed']) {411 if ($indexing['indexed']) {
431412
432 self::$indexed[] = $_indexing['index_name'];413 self::$fields['indexed'][] = $indexing['index_name'];
433414
434 }415 }
435416
436 if ($_indexing['is_sortable']) {417 if ($indexing['is_sortable']) {
437418
438 self::$sortables[] = $_indexing['index_name'];419 self::$fields['sortables'][] = $indexing['index_name'];
439420
440 }421 }
441422
442 if ($_indexing['is_facet']) {423 if ($indexing['is_facet']) {
443424
444 self::$facets[] = $_indexing['index_name'];425 self::$fields['facets'][] = $indexing['index_name'];
445426
446 }427 }
447428
448 if ($_indexing['autocomplete']) {429 if ($indexing['autocomplete']) {
449430
450 self::$autocompleted[] = $_indexing['index_name'];431 self::$fields['autocompleted'][] = $indexing['index_name'];
451432
452 }433 }
453434
454 if ($_indexing['boost'] > 0.0) {435 if ($indexing['boost'] > 0.0) {
455436
456 self::$fieldboost[$_indexing['index_name']] = floatval($_indexing['boost']);437 self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['boost']);
457438
458 } else {439 } else {
459440
460 self::$fieldboost[$_indexing['index_name']] = FALSE;441 self::$fields['fieldboost'][$indexing['index_name']] = FALSE;
461442
462 }443 }
463444
@@ -513,39 +494,39 @@
513494
514 $solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel));495 $solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel));
515496
516 $solrDoc->setField('type', $logicalUnit['type'], self::$fieldboost['type']);497 $solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']);
517498
518 $solrDoc->setField('title', $metadata['title'][0], self::$fieldboost['title']);499 $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']);
519500
520 $solrDoc->setField('volume', $metadata['volume'][0], self::$fieldboost['volume']);501 $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']);
521502
522 foreach ($metadata as $index_name => $data) {503 foreach ($metadata as $index_name => $data) {
523504
524 if (!empty($data) && substr($index_name, -8) !== '_sorting') {505 if (!empty($data) && substr($index_name, -8) !== '_sorting') {
525506
526 $suffix = (in_array($index_name, self::$tokenized) ? 't' : 'u');507 $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u');
527508
528 $suffix .= (in_array($index_name, self::$stored) ? 's' : 'u');509 $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u');
529510
530 $suffix .= (in_array($index_name, self::$indexed) ? 'i' : 'u');511 $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u');
531512
532 $solrDoc->setField($index_name.'_'.$suffix, $data, self::$fieldboost[$index_name]);513 $solrDoc->setField($index_name.'_'.$suffix, $data, self::$fields['fieldboost'][$index_name]);
533514
534 if (in_array($index_name, self::$sortables)) {515 if (in_array($index_name, self::$fields['sortables'])) {
535516
536 // Add sortable fields to index.517 // Add sortable fields to index.
537 $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]);518 $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]);
538519
539 }520 }
540521
541 if (in_array($index_name, self::$facets)) {522 if (in_array($index_name, self::$fields['facets'])) {
542523
543 // Add facets to index.524 // Add facets to index.
544 $solrDoc->setField($index_name.'_faceting', $data);525 $solrDoc->setField($index_name.'_faceting', $data);
545526
546 }527 }
547528
548 if (in_array($index_name, self::$autocompleted)) {529 if (in_array($index_name, self::$fields['autocompleted'])) {
549530
550 // Add autocomplete values to index.531 // Add autocomplete values to index.
551 $solrDoc->setField($index_name.'_suggest', $data);532 $solrDoc->setField($index_name.'_suggest', $data);
@@ -564,7 +545,7 @@
564545
565 if (!defined('TYPO3_cliMode')) {546 if (!defined('TYPO3_cliMode')) {
566547
567 $_message = t3lib_div::makeInstance(548 $message = t3lib_div::makeInstance(
568 't3lib_FlashMessage',549 't3lib_FlashMessage',
569 $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),550 $GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
570 $GLOBALS['LANG']->getLL('flash.error', TRUE),551 $GLOBALS['LANG']->getLL('flash.error', TRUE),
@@ -572,7 +553,7 @@
572 TRUE553 TRUE
573 );554 );
574555
575 t3lib_FlashMessageQueue::addMessage($_message);556 t3lib_FlashMessageQueue::addMessage($message);
576557
577 }558 }
578559
579560
=== modified file 'dlf/common/class.tx_dlf_list.php'
--- dlf/common/class.tx_dlf_list.php 2012-08-06 15:19:06 +0000
+++ dlf/common/class.tx_dlf_list.php 2012-08-17 07:00:27 +0000
@@ -92,11 +92,18 @@
92 */92 */
93 public function remove($position) {93 public function remove($position) {
9494
95 // Save parameter for logging purposes.
96 $_position = $position;
97
95 $position = intval($position);98 $position = intval($position);
9699
97 if ($position < 0 || $position >= $this->count) {100 if ($position < 0 || $position >= $this->count) {
98101
99 trigger_error('No valid list position for removal', E_USER_WARNING);102 if (TYPO3_DLOG) {
103
104 t3lib_div::devLog('[tx_dlf_list->remove('.$_position.')] Invalid position "'.$position.'" for element removing', $this->extKey, SYSLOG_SEVERITY_WARNING);
105
106 }
100107
101 return;108 return;
102109
@@ -122,12 +129,21 @@
122 */129 */
123 public function move($position, $steps) {130 public function move($position, $steps) {
124131
132 // Save parameters for logging purposes.
133 $_position = $position;
134
135 $_steps = $steps;
136
125 $position = intval($position);137 $position = intval($position);
126138
127 // Check if list position is valid.139 // Check if list position is valid.
128 if ($position < 0 || $position >= $this->count) {140 if ($position < 0 || $position >= $this->count) {
129141
130 trigger_error('Invalid list position '.$position, E_USER_WARNING);142 if (TYPO3_DLOG) {
143
144 t3lib_div::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid position "'.$position.'" for element moving', $this->extKey, SYSLOG_SEVERITY_WARNING);
145
146 }
131147
132 return;148 return;
133149
@@ -138,7 +154,11 @@
138 // Check if moving given amount of steps is possible.154 // Check if moving given amount of steps is possible.
139 if (($position + $steps) < 0 || ($position + $steps) >= $this->count) {155 if (($position + $steps) < 0 || ($position + $steps) >= $this->count) {
140156
141 trigger_error('Element at position '.$position.' can not be moved '.$steps.' steps', E_USER_WARNING);157 if (TYPO3_DLOG) {
158
159 t3lib_div::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid steps "'.$steps.'" for moving element at position "'.$position.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
160
161 }
142162
143 return;163 return;
144164
@@ -273,6 +293,14 @@
273293
274 $this->elements = $newOrder;294 $this->elements = $newOrder;
275295
296 } else {
297
298 if (TYPO3_DLOG) {
299
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);
301
302 }
303
276 }304 }
277305
278 }306 }
@@ -400,17 +428,21 @@
400 */428 */
401 public function __get($var) {429 public function __get($var) {
402430
403 $_method = '_get'.ucfirst($var);431 $method = '_get'.ucfirst($var);
404432
405 if (!property_exists($this, $var) || !method_exists($this, $_method)) {433 if (!property_exists($this, $var) || !method_exists($this, $method)) {
406434
407 trigger_error('There is no get function for property '.$var, E_USER_ERROR);435 if (TYPO3_DLOG) {
436
437 t3lib_div::devLog('[tx_dlf_list->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
438
439 }
408440
409 return;441 return;
410442
411 } else {443 } else {
412444
413 return $this->$_method();445 return $this->$method();
414446
415 }447 }
416448
@@ -428,15 +460,19 @@
428 */460 */
429 public function __set($var, $value) {461 public function __set($var, $value) {
430462
431 $_method = '_set'.ucfirst($var);463 $method = '_set'.ucfirst($var);
432464
433 if (!property_exists($this, $var) || !method_exists($this, $_method)) {465 if (!property_exists($this, $var) || !method_exists($this, $method)) {
434466
435 trigger_error('There is no set function for property '.$var, E_USER_ERROR);467 if (TYPO3_DLOG) {
468
469 t3lib_div::devLog('[tx_dlf_list->__set('.$var.', '.$value.')] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
470
471 }
436472
437 } else {473 } else {
438474
439 $this->$_method($value);475 $this->$method($value);
440476
441 }477 }
442478
443479
=== modified file 'dlf/common/class.tx_dlf_mods.php'
--- dlf/common/class.tx_dlf_mods.php 2012-08-07 14:39:23 +0000
+++ dlf/common/class.tx_dlf_mods.php 2012-08-17 07:00:27 +0000
@@ -107,12 +107,6 @@
107107
108 $metadata['author'][$i] = trim(implode(', ', $name));108 $metadata['author'][$i] = trim(implode(', ', $name));
109109
110 if (!$metadata['author_sorting'][0]) {
111
112 $metadata['author_sorting'][0] = trim(implode(', ', $name));
113
114 }
115
116 }110 }
117111
118 // Check if there is a display form.112 // Check if there is a display form.
@@ -120,12 +114,6 @@
120114
121 $metadata['author'][$i] = (string) $displayForm[0];115 $metadata['author'][$i] = (string) $displayForm[0];
122116
123 if (!$metadata['author_sorting'][0]) {
124
125 $metadata['author_sorting'][0] = (string) $displayForm[0];
126
127 }
128
129 }117 }
130118
131 }119 }
132120
=== modified file 'dlf/common/class.tx_dlf_module.php'
--- dlf/common/class.tx_dlf_module.php 2012-08-07 14:39:23 +0000
+++ dlf/common/class.tx_dlf_module.php 2012-08-17 07:00:27 +0000
@@ -147,13 +147,13 @@
147 // Set $this->MOD_MENU array here or leave empty.147 // Set $this->MOD_MENU array here or leave empty.
148148
149 /* Example code:149 /* Example code:
150 $this->MOD_MENU = array (150 $this->MOD_MENU = array (
151 'function' => array (151 'function' => array (
152 '1' => $GLOBALS['LANG']->getLL('function1'),152 '1' => $GLOBALS['LANG']->getLL('function1'),
153 '2' => $GLOBALS['LANG']->getLL('function2'),153 '2' => $GLOBALS['LANG']->getLL('function2'),
154 '3' => $GLOBALS['LANG']->getLL('function3'),154 '3' => $GLOBALS['LANG']->getLL('function3'),
155 )155 )
156 ); */156 ); */
157157
158 }158 }
159159
@@ -182,17 +182,15 @@
182 <script type="text/javascript">182 <script type="text/javascript">
183 script_ended = 0;183 script_ended = 0;
184 function jumpToUrl(URL) {184 function jumpToUrl(URL) {
185 document.location = URL;185 document.location = URL;
186 }186 }
187 </script>187 </script>';
188 ';
189188
190 // Add Javascript for convenient module switch.189 // Add Javascript for convenient module switch.
191 $this->doc->postCode .= '190 $this->doc->postCode .= '
192 <script type="text/javascript">191 <script type="text/javascript">
193 script_ended = 1;192 script_ended = 1;
194 </script>193 </script>';
195 ';
196194
197 // Render output.195 // Render output.
198 $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));196 $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
@@ -233,7 +231,7 @@
233}231}
234232
235/* No xclasses for abstract classes!233/* No xclasses for abstract classes!
236 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']) {234if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']) {
237include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']);235include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']);
238}236}
239*/237*/
240238
=== modified file 'dlf/common/class.tx_dlf_plugin.php'
--- dlf/common/class.tx_dlf_plugin.php 2012-08-07 14:39:23 +0000
+++ dlf/common/class.tx_dlf_plugin.php 2012-08-17 07:00:27 +0000
@@ -155,7 +155,11 @@
155 if (!$this->doc->ready) {155 if (!$this->doc->ready) {
156156
157 // Destroy the incomplete object.157 // Destroy the incomplete object.
158 trigger_error('Failed to load document with UID '.$this->piVars['id'], E_USER_ERROR);158 if (TYPO3_DLOG) {
159
160 t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with UID "'.$this->piVars['id'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
161
162 }
159163
160 $this->doc = NULL;164 $this->doc = NULL;
161165
@@ -170,12 +174,12 @@
170174
171 // Get UID of document with given record identifier.175 // Get UID of document with given record identifier.
172 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(176 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
173 'tx_dlf_documents.uid',177 'tx_dlf_documents.uid',
174 'tx_dlf_documents',178 'tx_dlf_documents',
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'),
176 '',180 '',
177 '',181 '',
178 '1'182 '1'
179 );183 );
180184
181 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) {185 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) {
@@ -193,13 +197,21 @@
193197
194 } else {198 } else {
195199
196 trigger_error('Failed to load document with record ID '.$this->piVars['recordId'], E_USER_ERROR);200 if (TYPO3_DLOG) {
201
202 t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with record ID "'.$this->piVars['recordId'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
203
204 }
197205
198 }206 }
199207
200 } else {208 } else {
201209
202 trigger_error('No UID or PID given for document', E_USER_ERROR);210 if (TYPO3_DLOG) {
211
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);
213
214 }
203215
204 }216 }
205217
@@ -304,7 +316,7 @@
304}316}
305317
306/* No xclasses for abstract classes!318/* No xclasses for abstract classes!
307 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']) {319if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']) {
308include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']);320include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']);
309}321}
310*/322*/
311323
=== modified file 'dlf/common/class.tx_dlf_solr.php'
--- dlf/common/class.tx_dlf_solr.php 2012-08-07 14:39:23 +0000
+++ dlf/common/class.tx_dlf_solr.php 2012-08-17 07:00:27 +0000
@@ -93,6 +93,9 @@
93 */93 */
94 public static function solrConnect($core = 0) {94 public static function solrConnect($core = 0) {
9595
96 // Save parameter for logging purposes.
97 $_core = $core;
98
96 // Load class.99 // Load class.
97 if (!class_exists('Apache_Solr_Service')) {100 if (!class_exists('Apache_Solr_Service')) {
98101
@@ -122,7 +125,11 @@
122125
123 if (empty($core)) {126 if (empty($core)) {
124127
125 trigger_error('Could not find Solr core with UID '.$core, E_USER_NOTICE);128 if (TYPO3_DLOG) {
129
130 t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Invalid UID "'.$_core.'" for Apache Solr core', $this->extKey, SYSLOG_SEVERITY_ERROR);
131
132 }
126133
127 return;134 return;
128135
@@ -146,7 +153,11 @@
146153
147 } else {154 } else {
148155
149 trigger_error('Could not connect to Solr server with core "'.$core.'"', E_USER_ERROR);156 if (TYPO3_DLOG) {
157
158 t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Could not connect to Apache Solr server with core "'.$core.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
159
160 }
150161
151 return;162 return;
152163
@@ -191,7 +202,7 @@
191}202}
192203
193/* No xclasses for static classes!204/* No xclasses for static classes!
194 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']) {205if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']) {
195include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']);206include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']);
196}207}
197*/208*/
198209
=== modified file 'dlf/ext_autoload.php'
--- dlf/ext_autoload.php 2012-08-07 14:39:23 +0000
+++ dlf/ext_autoload.php 2012-08-17 07:00:27 +0000
@@ -25,36 +25,36 @@
25$extensionPath = t3lib_extMgm::extPath('dlf');25$extensionPath = t3lib_extMgm::extPath('dlf');
2626
27return array (27return array (
28 'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php',28 'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php',
29 'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php',29 'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php',
30 'tx_dlf_format' => $extensionPath.'common/class.tx_dlf_format.php',30 'tx_dlf_format' => $extensionPath.'common/class.tx_dlf_format.php',
31 'tx_dlf_helper' => $extensionPath.'common/class.tx_dlf_helper.php',31 'tx_dlf_helper' => $extensionPath.'common/class.tx_dlf_helper.php',
32 'tx_dlf_indexing' => $extensionPath.'common/class.tx_dlf_indexing.php',32 'tx_dlf_indexing' => $extensionPath.'common/class.tx_dlf_indexing.php',
33 'tx_dlf_list' => $extensionPath.'common/class.tx_dlf_list.php',33 'tx_dlf_list' => $extensionPath.'common/class.tx_dlf_list.php',
34 'tx_dlf_mods' => $extensionPath.'common/class.tx_dlf_mods.php',34 'tx_dlf_mods' => $extensionPath.'common/class.tx_dlf_mods.php',
35 'tx_dlf_module' => $extensionPath.'common/class.tx_dlf_module.php',35 'tx_dlf_module' => $extensionPath.'common/class.tx_dlf_module.php',
36 'tx_dlf_plugin' => $extensionPath.'common/class.tx_dlf_plugin.php',36 'tx_dlf_plugin' => $extensionPath.'common/class.tx_dlf_plugin.php',
37 'tx_dlf_solr' => $extensionPath.'common/class.tx_dlf_solr.php',37 'tx_dlf_solr' => $extensionPath.'common/class.tx_dlf_solr.php',
38 'tx_dlf_em' => $extensionPath.'hooks/class.tx_dlf_em.php',38 'tx_dlf_em' => $extensionPath.'hooks/class.tx_dlf_em.php',
39 'tx_dlf_hacks' => $extensionPath.'hooks/class.tx_dlf_hacks.php',39 'tx_dlf_hacks' => $extensionPath.'hooks/class.tx_dlf_hacks.php',
40 'tx_dlf_tceforms' => $extensionPath.'hooks/class.tx_dlf_tceforms.php',40 'tx_dlf_tceforms' => $extensionPath.'hooks/class.tx_dlf_tceforms.php',
41 'tx_dlf_tcemain' => $extensionPath.'hooks/class.tx_dlf_tcemain.php',41 'tx_dlf_tcemain' => $extensionPath.'hooks/class.tx_dlf_tcemain.php',
42 'tx_dlf_modIndexing' => $extensionPath.'modules/indexing/index.php',42 'tx_dlf_modIndexing' => $extensionPath.'modules/indexing/index.php',
43 'tx_dlf_modNewclient' => $extensionPath.'modules/newclient/index.php',43 'tx_dlf_modNewclient' => $extensionPath.'modules/newclient/index.php',
44 'tx_dlf_collection' => $extensionPath.'plugins/collection/class.tx_dlf_collection.php',44 'tx_dlf_collection' => $extensionPath.'plugins/collection/class.tx_dlf_collection.php',
45 'tx_dlf_feeds' => $extensionPath.'plugins/feeds/class.tx_dlf_feeds.php',45 'tx_dlf_feeds' => $extensionPath.'plugins/feeds/class.tx_dlf_feeds.php',
46 'tx_dlf_listview' => $extensionPath.'plugins/listview/class.tx_dlf_listview.php',46 'tx_dlf_listview' => $extensionPath.'plugins/listview/class.tx_dlf_listview.php',
47 'tx_dlf_metadata' => $extensionPath.'plugins/metadata/class.tx_dlf_metadata.php',47 'tx_dlf_metadata' => $extensionPath.'plugins/metadata/class.tx_dlf_metadata.php',
48 'tx_dlf_navigation' => $extensionPath.'plugins/navigation/class.tx_dlf_navigation.php',48 'tx_dlf_navigation' => $extensionPath.'plugins/navigation/class.tx_dlf_navigation.php',
49 'tx_dlf_oai' => $extensionPath.'plugins/oai/class.tx_dlf_oai.php',49 'tx_dlf_oai' => $extensionPath.'plugins/oai/class.tx_dlf_oai.php',
50 'tx_dlf_pageview' => $extensionPath.'plugins/pageview/class.tx_dlf_pageview.php',50 'tx_dlf_pageview' => $extensionPath.'plugins/pageview/class.tx_dlf_pageview.php',
51 'tx_dlf_search' => $extensionPath.'plugins/search/class.tx_dlf_search.php',51 'tx_dlf_search' => $extensionPath.'plugins/search/class.tx_dlf_search.php',
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',
53 'tx_dlf_statistics' => $extensionPath.'plugins/statistics/class.tx_dlf_statistics.php',53 'tx_dlf_statistics' => $extensionPath.'plugins/statistics/class.tx_dlf_statistics.php',
54 'tx_dlf_toc' => $extensionPath.'plugins/toc/class.tx_dlf_toc.php',54 'tx_dlf_toc' => $extensionPath.'plugins/toc/class.tx_dlf_toc.php',
55 'tx_dlf_toolbox' => $extensionPath.'plugins/toolbox/class.tx_dlf_toolbox.php',55 'tx_dlf_toolbox' => $extensionPath.'plugins/toolbox/class.tx_dlf_toolbox.php',
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',
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'
58);58);
5959
60?>60?>
61\ No newline at end of file61\ No newline at end of file
6262
=== modified file 'dlf/ext_emconf.php'
--- dlf/ext_emconf.php 2012-08-09 12:13:34 +0000
+++ dlf/ext_emconf.php 2012-08-17 07:00:27 +0000
@@ -23,6 +23,7 @@
23***************************************************************/23***************************************************************/
2424
25$EM_CONF[$_EXTKEY] = array(25$EM_CONF[$_EXTKEY] = array(
26<<<<<<< TREE
26 'title' => 'Goobi.Presentation',27 'title' => 'Goobi.Presentation',
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.',
28 'category' => 'fe',29 'category' => 'fe',
@@ -53,6 +54,38 @@
53 ),54 ),
54 ),55 ),
55 '_md5_values_when_last_written' => '',56 '_md5_values_when_last_written' => '',
57=======
58 'title' => 'Goobi.Presentation',
59 'description' => 'Base plugins, modules, services and API of the Digital Library Framework. It is part of the community-based Goobi Digitization Suite.',
60 'category' => 'fe',
61 'author' => 'Sebastian Meyer',
62 'author_email' => 'sebastian.meyer@slub-dresden.de',
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>',
64 'shy' => '',
65 'priority' => '',
66 'module' => '',
67 'state' => 'stable',
68 'internal' => '',
69 'uploadfolder' => TRUE,
70 'createDirs' => '',
71 'modify_tables' => '',
72 'clearCacheOnLoad' => FALSE,
73 'lockType' => '',
74 'version' => '1.1.3',
75 'constraints' => array(
76 'depends' => array(
77 'php' => '5.3.0-',
78 'typo3' => '4.5.0-',
79 ),
80 'conflicts' => array(
81 ),
82 'suggests' => array(
83 'realurl' => '',
84 't3jquery' => '',
85 ),
86 ),
87 '_md5_values_when_last_written' => '',
88>>>>>>> MERGE-SOURCE
56);89);
5790
58?>91?>
59\ No newline at end of file92\ No newline at end of file
6093
=== modified file 'dlf/ext_tables.php'
--- dlf/ext_tables.php 2012-08-07 14:39:23 +0000
+++ dlf/ext_tables.php 2012-08-17 07:00:27 +0000
@@ -26,173 +26,174 @@
2626
27// Register database tables.27// Register database tables.
28$TCA['tx_dlf_documents'] = array (28$TCA['tx_dlf_documents'] = array (
29 'ctrl' => array (29 'ctrl' => array (
30 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents',30 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents',
31 'label' => 'title',31 'label' => 'title',
32 'tstamp' => 'tstamp',32 'tstamp' => 'tstamp',
33 'crdate' => 'crdate',33 'crdate' => 'crdate',
34 'cruser_id' => 'cruser_id',34 'cruser_id' => 'cruser_id',
35 'default_sortby' => 'ORDER BY title_sorting',35 'default_sortby' => 'ORDER BY title_sorting',
36 'delete' => 'deleted',36 'delete' => 'deleted',
37 'enablecolumns' => array (37 'enablecolumns' => array (
38 'disabled' => 'hidden',38 'disabled' => 'hidden',
39 'fe_group' => 'fe_group',39 'starttime' => 'starttime',
40 ),40 'endtime' => 'endtime',
41 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',41 'fe_group' => 'fe_group',
42 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfdocuments.png',
43 'rootLevel' => 0,
44 'dividers2tabs' => 2,
45 'searchFields' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn',
46 ),42 ),
47 'feInterface' => array (43 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
48 'fe_admin_fieldList' => '',44 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfdocuments.png',
49 )45 'rootLevel' => 0,
46 'dividers2tabs' => 2,
47 'searchFields' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn',
48 ),
49 'feInterface' => array (
50 'fe_admin_fieldList' => '',
51 )
50);52);
5153
52$TCA['tx_dlf_structures'] = array (54$TCA['tx_dlf_structures'] = array (
53 'ctrl' => array (55 'ctrl' => array (
54 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures',56 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures',
55 'label' => 'label',57 'label' => 'label',
56 'tstamp' => 'tstamp',58 'tstamp' => 'tstamp',
57 'crdate' => 'crdate',59 'crdate' => 'crdate',
58 'cruser_id' => 'cruser_id',60 'cruser_id' => 'cruser_id',
59 'languageField' => 'sys_language_uid',61 'languageField' => 'sys_language_uid',
60 'transOrigPointerField' => 'l18n_parent',62 'transOrigPointerField' => 'l18n_parent',
61 'transOrigDiffSourceField' => 'l18n_diffsource',63 'transOrigDiffSourceField' => 'l18n_diffsource',
62 'default_sortby' => 'ORDER BY label',64 'default_sortby' => 'ORDER BY label',
63 'delete' => 'deleted',65 'delete' => 'deleted',
64 'enablecolumns' => array (66 'enablecolumns' => array (
65 'disabled' => 'hidden',67 'disabled' => 'hidden',
66 ),
67 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
68 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfstructures.png',
69 'rootLevel' => 0,
70 'dividers2tabs' => 2,
71 'searchFields' => 'label,index_name,oai_name',
72 ),68 ),
73 'feInterface' => array (69 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
74 'fe_admin_fieldList' => '',70 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfstructures.png',
75 )71 'rootLevel' => 0,
72 'dividers2tabs' => 2,
73 'searchFields' => 'label,index_name,oai_name',
74 ),
75 'feInterface' => array (
76 'fe_admin_fieldList' => '',
77 )
76);78);
7779
78$TCA['tx_dlf_metadata'] = array (80$TCA['tx_dlf_metadata'] = array (
79 'ctrl' => array (81 'ctrl' => array (
80 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata',82 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata',
81 'label' => 'label',83 'label' => 'label',
82 'tstamp' => 'tstamp',84 'tstamp' => 'tstamp',
83 'crdate' => 'crdate',85 'crdate' => 'crdate',
84 'cruser_id' => 'cruser_id',86 'cruser_id' => 'cruser_id',
85 'languageField' => 'sys_language_uid',87 'languageField' => 'sys_language_uid',
86 'transOrigPointerField' => 'l18n_parent',88 'transOrigPointerField' => 'l18n_parent',
87 'transOrigDiffSourceField' => 'l18n_diffsource',89 'transOrigDiffSourceField' => 'l18n_diffsource',
88 'sortby' => 'sorting',90 'sortby' => 'sorting',
89 'delete' => 'deleted',91 'delete' => 'deleted',
90 'enablecolumns' => array (92 'enablecolumns' => array (
91 'disabled' => 'hidden',93 'disabled' => 'hidden',
92 ),
93 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
94 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfmetadata.png',
95 'rootLevel' => 0,
96 'dividers2tabs' => 2,
97 'searchFields' => 'label,index_name,encoding,xpath,xpath_sorting,default',
98 'requestUpdate' => 'is_sortable',
99 ),94 ),
100 'feInterface' => array (95 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
101 'fe_admin_fieldList' => '',96 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfmetadata.png',
102 )97 'rootLevel' => 0,
98 'dividers2tabs' => 2,
99 'searchFields' => 'label,index_name,encoding,xpath,xpath_sorting,default',
100 'requestUpdate' => 'is_sortable',
101 ),
102 'feInterface' => array (
103 'fe_admin_fieldList' => '',
104 )
103);105);
104106
105$TCA['tx_dlf_formats'] = array (107$TCA['tx_dlf_formats'] = array (
106 'ctrl' => array (108 'ctrl' => array (
107 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats',109 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats',
108 'label' => 'type',110 'label' => 'type',
109 'tstamp' => 'tstamp',111 'tstamp' => 'tstamp',
110 'crdate' => 'crdate',112 'crdate' => 'crdate',
111 'cruser_id' => 'cruser_id',113 'cruser_id' => 'cruser_id',
112 'default_sortby' => 'ORDER BY type',114 'default_sortby' => 'ORDER BY type',
113 'delete' => 'deleted',115 'delete' => 'deleted',
114 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',116 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
115 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfformats.png',117 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfformats.png',
116 'rootLevel' => 1,118 'rootLevel' => 1,
117 'dividers2tabs' => 2,119 'dividers2tabs' => 2,
118 'searchFields' => 'type,class',120 'searchFields' => 'type,class',
119 ),121 ),
120 'feInterface' => array (122 'feInterface' => array (
121 'fe_admin_fieldList' => '',123 'fe_admin_fieldList' => '',
122 )124 )
123);125);
124126
125$TCA['tx_dlf_solrcores'] = array (127$TCA['tx_dlf_solrcores'] = array (
126 'ctrl' => array (128 'ctrl' => array (
127 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_solrcores',129 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_solrcores',
128 'label' => 'label',130 'label' => 'label',
129 'tstamp' => 'tstamp',131 'tstamp' => 'tstamp',
130 'crdate' => 'crdate',132 'crdate' => 'crdate',
131 'cruser_id' => 'cruser_id',133 'cruser_id' => 'cruser_id',
132 'default_sortby' => 'ORDER BY label',134 'default_sortby' => 'ORDER BY label',
133 'delete' => 'deleted',135 'delete' => 'deleted',
134 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',136 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
135 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfsolrcores.png',137 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfsolrcores.png',
136 'rootLevel' => -1,138 'rootLevel' => -1,
137 'adminOnly' => 1,139 'dividers2tabs' => 2,
138 'dividers2tabs' => 2,140 'searchFields' => 'label,index_name',
139 'searchFields' => 'label,index_name',141 ),
140 ),142 'feInterface' => array (
141 'feInterface' => array (143 'fe_admin_fieldList' => '',
142 'fe_admin_fieldList' => '',144 )
143 )
144);145);
145146
146$TCA['tx_dlf_collections'] = array (147$TCA['tx_dlf_collections'] = array (
147 'ctrl' => array (148 'ctrl' => array (
148 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_collections',149 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_collections',
149 'label' => 'label',150 'label' => 'label',
150 'tstamp' => 'tstamp',151 'tstamp' => 'tstamp',
151 'crdate' => 'crdate',152 'crdate' => 'crdate',
152 'cruser_id' => 'cruser_id',153 'cruser_id' => 'cruser_id',
153 'fe_cruser_id' => 'fe_cruser_id',154 'fe_cruser_id' => 'fe_cruser_id',
154 'fe_admin_lock' => 'fe_admin_lock',155 'fe_admin_lock' => 'fe_admin_lock',
155 'languageField' => 'sys_language_uid',156 'languageField' => 'sys_language_uid',
156 'transOrigPointerField' => 'l18n_parent',157 'transOrigPointerField' => 'l18n_parent',
157 'transOrigDiffSourceField' => 'l18n_diffsource',158 'transOrigDiffSourceField' => 'l18n_diffsource',
158 'default_sortby' => 'ORDER BY label',159 'default_sortby' => 'ORDER BY label',
159 'delete' => 'deleted',160 'delete' => 'deleted',
160 'enablecolumns' => array (161 'enablecolumns' => array (
161 'disabled' => 'hidden',162 'disabled' => 'hidden',
162 'fe_group' => 'fe_group',163 'fe_group' => 'fe_group',
163 ),
164 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
165 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfcollections.png',
166 'rootLevel' => 0,
167 'dividers2tabs' => 2,
168 'searchFields' => 'label,index_name,oai_name,fe_cruser_id',
169 ),164 ),
170 'feInterface' => array (165 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
171 'fe_admin_fieldList' => 'label,description,documents',166 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfcollections.png',
172 )167 'rootLevel' => 0,
168 'dividers2tabs' => 2,
169 'searchFields' => 'label,index_name,oai_name,fe_cruser_id',
170 ),
171 'feInterface' => array (
172 'fe_admin_fieldList' => 'label,description,documents',
173 )
173);174);
174175
175$TCA['tx_dlf_libraries'] = array (176$TCA['tx_dlf_libraries'] = array (
176 'ctrl' => array (177 'ctrl' => array (
177 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_libraries',178 'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_libraries',
178 'label' => 'label',179 'label' => 'label',
179 'tstamp' => 'tstamp',180 'tstamp' => 'tstamp',
180 'crdate' => 'crdate',181 'crdate' => 'crdate',
181 'cruser_id' => 'cruser_id',182 'cruser_id' => 'cruser_id',
182 'languageField' => 'sys_language_uid',183 'languageField' => 'sys_language_uid',
183 'transOrigPointerField' => 'l18n_parent',184 'transOrigPointerField' => 'l18n_parent',
184 'transOrigDiffSourceField' => 'l18n_diffsource',185 'transOrigDiffSourceField' => 'l18n_diffsource',
185 'default_sortby' => 'ORDER BY label',186 'default_sortby' => 'ORDER BY label',
186 'delete' => 'deleted',187 'delete' => 'deleted',
187 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',188 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
188 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlflibraries.png',189 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlflibraries.png',
189 'rootLevel' => 0,190 'rootLevel' => 0,
190 'dividers2tabs' => 2,191 'dividers2tabs' => 2,
191 'searchFields' => 'label,website,contact',192 'searchFields' => 'label,website,contact',
192 ),193 ),
193 'feInterface' => array (194 'feInterface' => array (
194 'fe_admin_fieldList' => '',195 'fe_admin_fieldList' => '',
195 )196 )
196);197);
197198
198// Register static typoscript.199// Register static typoscript.
199200
=== modified file 'dlf/ext_tables.sql'
--- dlf/ext_tables.sql 2012-08-09 10:31:57 +0000
+++ dlf/ext_tables.sql 2012-08-17 07:00:27 +0000
@@ -9,6 +9,8 @@
9 cruser_id int(11) DEFAULT '0' NOT NULL,9 cruser_id int(11) DEFAULT '0' NOT NULL,
10 deleted tinyint(4) DEFAULT '0' NOT NULL,10 deleted tinyint(4) DEFAULT '0' NOT NULL,
11 hidden tinyint(4) DEFAULT '0' NOT NULL,11 hidden tinyint(4) DEFAULT '0' NOT NULL,
12 starttime int(11) DEFAULT '0' NOT NULL,
13 endtime int(11) DEFAULT '0' NOT NULL,
12 fe_group varchar(100) DEFAULT '' NOT NULL,14 fe_group varchar(100) DEFAULT '' NOT NULL,
13 prod_id tinytext NOT NULL,15 prod_id tinytext NOT NULL,
14 location text NOT NULL,16 location text NOT NULL,
@@ -109,7 +111,6 @@
109 cruser_id int(11) DEFAULT '0' NOT NULL,111 cruser_id int(11) DEFAULT '0' NOT NULL,
110 deleted tinyint(4) DEFAULT '0' NOT NULL,112 deleted tinyint(4) DEFAULT '0' NOT NULL,
111 type tinytext NOT NULL,113 type tinytext NOT NULL,
112 other_type tinyint(4) DEFAULT '0' NOT NULL,
113 root tinytext NOT NULL,114 root tinytext NOT NULL,
114 namespace text NOT NULL,115 namespace text NOT NULL,
115 class text NOT NULL,116 class text NOT NULL,
116117
=== modified file 'dlf/ext_tables_static+adt.sql'
--- dlf/ext_tables_static+adt.sql 2012-04-30 16:05:21 +0000
+++ dlf/ext_tables_static+adt.sql 2012-08-17 07:00:27 +0000
@@ -9,7 +9,6 @@
9 cruser_id int(11) DEFAULT '0' NOT NULL,9 cruser_id int(11) DEFAULT '0' NOT NULL,
10 deleted tinyint(4) DEFAULT '0' NOT NULL,10 deleted tinyint(4) DEFAULT '0' NOT NULL,
11 type tinytext NOT NULL,11 type tinytext NOT NULL,
12 other_type tinyint(4) DEFAULT '0' NOT NULL,
13 root tinytext NOT NULL,12 root tinytext NOT NULL,
14 namespace text NOT NULL,13 namespace text NOT NULL,
15 class text NOT NULL,14 class text NOT NULL,
@@ -18,4 +17,4 @@
18 KEY parent (pid)17 KEY parent (pid)
19);18);
2019
21INSERT INTO tx_dlf_formats VALUES ('1', '0', '0', '0', '0', '0', 'MODS', '0', 'mods', 'http://www.loc.gov/mods/v3', 'tx_dlf_mods');20INSERT INTO tx_dlf_formats VALUES ('1', '0', '0', '0', '0', '0', 'MODS', 'mods', 'http://www.loc.gov/mods/v3', 'tx_dlf_mods');
2221
=== modified file 'dlf/hooks/class.tx_dlf_em.php'
--- dlf/hooks/class.tx_dlf_em.php 2012-08-07 14:39:23 +0000
+++ dlf/hooks/class.tx_dlf_em.php 2012-08-17 07:00:27 +0000
@@ -84,10 +84,10 @@
84 $url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores';84 $url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores';
8585
86 $context = stream_context_create(array (86 $context = stream_context_create(array (
87 'http' => array (87 'http' => array (
88 'method' => 'GET',88 'method' => 'GET',
89 'user_agent' => (!empty($conf['useragent']) ? $conf['useragent'] : ini_get('user_agent'))89 'user_agent' => (!empty($conf['useragent']) ? $conf['useragent'] : ini_get('user_agent'))
90 )90 )
91 ));91 ));
9292
93 // Try to connect to Solr server.93 // Try to connect to Solr server.
@@ -101,11 +101,11 @@
101 if (is_array($status)) {101 if (is_array($status)) {
102102
103 $message = t3lib_div::makeInstance(103 $message = t3lib_div::makeInstance(
104 't3lib_FlashMessage',104 't3lib_FlashMessage',
105 sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]),105 sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]),
106 $GLOBALS['LANG']->getLL('solr.connected'),106 $GLOBALS['LANG']->getLL('solr.connected'),
107 ($status[0] == 0 ? t3lib_FlashMessage::OK : t3lib_FlashMessage::WARNING),107 ($status[0] == 0 ? t3lib_FlashMessage::OK : t3lib_FlashMessage::WARNING),
108 FALSE108 FALSE
109 );109 );
110110
111 $this->content .= $message->render();111 $this->content .= $message->render();
@@ -117,11 +117,11 @@
117 }117 }
118118
119 $message = t3lib_div::makeInstance(119 $message = t3lib_div::makeInstance(
120 't3lib_FlashMessage',120 't3lib_FlashMessage',
121 sprintf($GLOBALS['LANG']->getLL('solr.error'), $url),121 sprintf($GLOBALS['LANG']->getLL('solr.error'), $url),
122 $GLOBALS['LANG']->getLL('solr.notConnected'),122 $GLOBALS['LANG']->getLL('solr.notConnected'),
123 t3lib_FlashMessage::WARNING,123 t3lib_FlashMessage::WARNING,
124 FALSE124 FALSE
125 );125 );
126126
127 $this->content .= $message->render();127 $this->content .= $message->render();
@@ -147,9 +147,9 @@
147147
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.
149 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(149 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
150 'uid,admin,usergroup',150 'uid,admin,usergroup',
151 'be_users',151 'be_users',
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')
153 );153 );
154154
155 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {155 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
@@ -160,25 +160,25 @@
160 $resArray['usergroup'] = explode(',', $resArray['usergroup']);160 $resArray['usergroup'] = explode(',', $resArray['usergroup']);
161161
162 // Check if user is not disabled.162 // Check if user is not disabled.
163 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(163 $result2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
164 '1',164 '1',
165 'be_users',165 'be_users',
166 'uid='.intval($resArray['uid']).t3lib_BEfunc::BEenableFields('be_users')166 'uid='.intval($resArray['uid']).t3lib_BEfunc::BEenableFields('be_users')
167 );167 );
168168
169 // Check if user is configured properly.169 // Check if user is configured properly.
170 if (count(array_diff(array ($groupUid), $resArray['usergroup'])) == 0170 if (count(array_diff(array ($groupUid), $resArray['usergroup'])) == 0
171 && !$resArray['admin']171 && !$resArray['admin']
172 && $GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) {172 && $GLOBALS['TYPO3_DB']->sql_num_rows($result2) > 0) {
173173
174 $usrUid = $resArray['uid'];174 $usrUid = $resArray['uid'];
175175
176 $message = t3lib_div::makeInstance(176 $message = t3lib_div::makeInstance(
177 't3lib_FlashMessage',177 't3lib_FlashMessage',
178 $GLOBALS['LANG']->getLL('cliUserGroup.usrOkayMsg'),178 $GLOBALS['LANG']->getLL('cliUserGroup.usrOkayMsg'),
179 $GLOBALS['LANG']->getLL('cliUserGroup.usrOkay'),179 $GLOBALS['LANG']->getLL('cliUserGroup.usrOkay'),
180 t3lib_FlashMessage::OK,180 t3lib_FlashMessage::OK,
181 FALSE181 FALSE
182 );182 );
183183
184 } else {184 } else {
@@ -186,15 +186,15 @@
186 if (!$checkOnly && $groupUid) {186 if (!$checkOnly && $groupUid) {
187187
188 // Keep exisiting values and add the new ones.188 // Keep exisiting values and add the new ones.
189 $_usergroup = array_unique(array_merge(array ($groupUid), $resArray['usergroup']));189 $usergroup = array_unique(array_merge(array ($groupUid), $resArray['usergroup']));
190190
191 // Try to configure user.191 // Try to configure user.
192 $data['be_users'][$resArray['uid']] = array (192 $data['be_users'][$resArray['uid']] = array (
193 'admin' => 0,193 'admin' => 0,
194 'usergroup' => implode(',', $_usergroup),194 'usergroup' => implode(',', $usergroup),
195 $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['disabled'] => 0,195 $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['disabled'] => 0,
196 $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['starttime'] => 0,196 $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['starttime'] => 0,
197 $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['endtime'] => 0197 $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['endtime'] => 0
198 );198 );
199199
200 tx_dlf_helper::processDB($data);200 tx_dlf_helper::processDB($data);
@@ -205,33 +205,33 @@
205 $usrUid = $resArray['uid'];205 $usrUid = $resArray['uid'];
206206
207 $message = t3lib_div::makeInstance(207 $message = t3lib_div::makeInstance(
208 't3lib_FlashMessage',208 't3lib_FlashMessage',
209 $GLOBALS['LANG']->getLL('cliUserGroup.usrConfiguredMsg'),209 $GLOBALS['LANG']->getLL('cliUserGroup.usrConfiguredMsg'),
210 $GLOBALS['LANG']->getLL('cliUserGroup.usrConfigured'),210 $GLOBALS['LANG']->getLL('cliUserGroup.usrConfigured'),
211 t3lib_FlashMessage::INFO,211 t3lib_FlashMessage::INFO,
212 FALSE212 FALSE
213 );213 );
214214
215 } else {215 } else {
216216
217 $message = t3lib_div::makeInstance(217 $message = t3lib_div::makeInstance(
218 't3lib_FlashMessage',
219 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
220 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
221 t3lib_FlashMessage::ERROR,
222 FALSE
223 );
224
225 }
226
227 } else {
228
229 $message = t3lib_div::makeInstance(
230 't3lib_FlashMessage',218 't3lib_FlashMessage',
231 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),219 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
232 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),220 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
233 t3lib_FlashMessage::ERROR,221 t3lib_FlashMessage::ERROR,
234 FALSE222 FALSE
223 );
224
225 }
226
227 } else {
228
229 $message = t3lib_div::makeInstance(
230 't3lib_FlashMessage',
231 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
232 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
233 t3lib_FlashMessage::ERROR,
234 FALSE
235 );235 );
236236
237 }237 }
@@ -243,51 +243,51 @@
243 if (!$checkOnly && $groupUid) {243 if (!$checkOnly && $groupUid) {
244244
245 // Try to create user.245 // Try to create user.
246 $_tempUid = uniqid('NEW');246 $tempUid = uniqid('NEW');
247247
248 $data['be_users'][$_tempUid] = array (248 $data['be_users'][$tempUid] = array (
249 'pid' => 0,249 'pid' => 0,
250 'username' => '_cli_dlf',250 'username' => '_cli_dlf',
251 'password' => md5($_tempUid),251 'password' => md5($tempUid),
252 'realName' => $GLOBALS['LANG']->getLL('cliUserGroup.usrRealName'),252 'realName' => $GLOBALS['LANG']->getLL('cliUserGroup.usrRealName'),
253 'usergroup' => intval($groupUid)253 'usergroup' => intval($groupUid)
254 );254 );
255255
256 $_substUid = tx_dlf_helper::processDB($data);256 $substUid = tx_dlf_helper::processDB($data);
257257
258 // Check if creation was successful.258 // Check if creation was successful.
259 if (!empty($_substUid[$_tempUid])) {259 if (!empty($substUid[$tempUid])) {
260260
261 $usrUid = $_substUid[$_tempUid];261 $usrUid = $substUid[$tempUid];
262262
263 $message = t3lib_div::makeInstance(263 $message = t3lib_div::makeInstance(
264 't3lib_FlashMessage',264 't3lib_FlashMessage',
265 $GLOBALS['LANG']->getLL('cliUserGroup.usrCreatedMsg'),265 $GLOBALS['LANG']->getLL('cliUserGroup.usrCreatedMsg'),
266 $GLOBALS['LANG']->getLL('cliUserGroup.usrCreated'),266 $GLOBALS['LANG']->getLL('cliUserGroup.usrCreated'),
267 t3lib_FlashMessage::INFO,267 t3lib_FlashMessage::INFO,
268 FALSE268 FALSE
269 );269 );
270270
271 } else {271 } else {
272272
273 $message = t3lib_div::makeInstance(273 $message = t3lib_div::makeInstance(
274 't3lib_FlashMessage',
275 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
276 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
277 t3lib_FlashMessage::ERROR,
278 FALSE
279 );
280
281 }
282
283 } else {
284
285 $message = t3lib_div::makeInstance(
286 't3lib_FlashMessage',274 't3lib_FlashMessage',
287 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),275 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
288 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),276 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
289 t3lib_FlashMessage::ERROR,277 t3lib_FlashMessage::ERROR,
290 FALSE278 FALSE
279 );
280
281 }
282
283 } else {
284
285 $message = t3lib_div::makeInstance(
286 't3lib_FlashMessage',
287 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
288 $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
289 t3lib_FlashMessage::ERROR,
290 FALSE
291 );291 );
292292
293 }293 }
@@ -319,21 +319,21 @@
319 if (empty($settings)) {319 if (empty($settings)) {
320320
321 $settings = array (321 $settings = array (
322 'non_exclude_fields' => array (),322 'non_exclude_fields' => array (),
323 'tables_select' => array (323 'tables_select' => array (
324 'tx_dlf_documents',324 'tx_dlf_documents',
325 'tx_dlf_collections',325 'tx_dlf_collections',
326 'tx_dlf_libraries',326 'tx_dlf_libraries',
327 'tx_dlf_structures',327 'tx_dlf_structures',
328 'tx_dlf_metadata',328 'tx_dlf_metadata',
329 'tx_dlf_formats',329 'tx_dlf_formats',
330 'tx_dlf_solrcores'330 'tx_dlf_solrcores'
331 ),331 ),
332 'tables_modify' => array (332 'tables_modify' => array (
333 'tx_dlf_documents',333 'tx_dlf_documents',
334 'tx_dlf_collections',334 'tx_dlf_collections',
335 'tx_dlf_libraries'335 'tx_dlf_libraries'
336 )336 )
337 );337 );
338338
339 // Set allowed exclude fields.339 // Set allowed exclude fields.
@@ -357,9 +357,9 @@
357357
358 // Check if group "_cli_dlf" exists and is not disabled.358 // Check if group "_cli_dlf" exists and is not disabled.
359 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(359 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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'],
361 'be_groups',361 'be_groups',
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')
363 );363 );
364364
365 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {365 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
@@ -383,11 +383,11 @@
383 $grpUid = $resArray['uid'];383 $grpUid = $resArray['uid'];
384384
385 $message = t3lib_div::makeInstance(385 $message = t3lib_div::makeInstance(
386 't3lib_FlashMessage',386 't3lib_FlashMessage',
387 $GLOBALS['LANG']->getLL('cliUserGroup.grpOkayMsg'),387 $GLOBALS['LANG']->getLL('cliUserGroup.grpOkayMsg'),
388 $GLOBALS['LANG']->getLL('cliUserGroup.grpOkay'),388 $GLOBALS['LANG']->getLL('cliUserGroup.grpOkay'),
389 t3lib_FlashMessage::OK,389 t3lib_FlashMessage::OK,
390 FALSE390 FALSE
391 );391 );
392392
393 } else {393 } else {
@@ -395,19 +395,19 @@
395 if (!$checkOnly) {395 if (!$checkOnly) {
396396
397 // Keep exisiting values and add the new ones.397 // Keep exisiting values and add the new ones.
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']));
399399
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']));
401401
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']));
403403
404 // Try to configure usergroup.404 // Try to configure usergroup.
405 $data['be_groups'][$resArray['uid']] = array (405 $data['be_groups'][$resArray['uid']] = array (
406 'non_exclude_fields' => implode(',', $_non_exclude_fields),406 'non_exclude_fields' => implode(',', $non_exclude_fields),
407 'tables_select' => implode(',', $_tables_select),407 'tables_select' => implode(',', $tables_select),
408 'tables_modify' => implode(',', $_tables_modify),408 'tables_modify' => implode(',', $tables_modify),
409 'inc_access_lists' => 1,409 'inc_access_lists' => 1,
410 $GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'] => 0410 $GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'] => 0
411 );411 );
412412
413 tx_dlf_helper::processDB($data);413 tx_dlf_helper::processDB($data);
@@ -418,33 +418,33 @@
418 $grpUid = $resArray['uid'];418 $grpUid = $resArray['uid'];
419419
420 $message = t3lib_div::makeInstance(420 $message = t3lib_div::makeInstance(
421 't3lib_FlashMessage',421 't3lib_FlashMessage',
422 $GLOBALS['LANG']->getLL('cliUserGroup.grpConfiguredMsg'),422 $GLOBALS['LANG']->getLL('cliUserGroup.grpConfiguredMsg'),
423 $GLOBALS['LANG']->getLL('cliUserGroup.grpConfigured'),423 $GLOBALS['LANG']->getLL('cliUserGroup.grpConfigured'),
424 t3lib_FlashMessage::INFO,424 t3lib_FlashMessage::INFO,
425 FALSE425 FALSE
426 );426 );
427427
428 } else {428 } else {
429429
430 $message = t3lib_div::makeInstance(430 $message = t3lib_div::makeInstance(
431 't3lib_FlashMessage',
432 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
433 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
434 t3lib_FlashMessage::ERROR,
435 FALSE
436 );
437
438 }
439
440 } else {
441
442 $message = t3lib_div::makeInstance(
443 't3lib_FlashMessage',431 't3lib_FlashMessage',
444 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),432 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
445 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),433 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
446 t3lib_FlashMessage::ERROR,434 t3lib_FlashMessage::ERROR,
447 FALSE435 FALSE
436 );
437
438 }
439
440 } else {
441
442 $message = t3lib_div::makeInstance(
443 't3lib_FlashMessage',
444 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
445 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
446 t3lib_FlashMessage::ERROR,
447 FALSE
448 );448 );
449449
450 }450 }
@@ -456,53 +456,53 @@
456 if (!$checkOnly) {456 if (!$checkOnly) {
457457
458 // Try to create usergroup.458 // Try to create usergroup.
459 $_tempUid = uniqid('NEW');459 $tempUid = uniqid('NEW');
460460
461 $data['be_groups'][$_tempUid] = array (461 $data['be_groups'][$tempUid] = array (
462 'pid' => 0,462 'pid' => 0,
463 'title' => '_cli_dlf',463 'title' => '_cli_dlf',
464 'description' => $GLOBALS['LANG']->getLL('cliUserGroup.grpDescription'),464 'description' => $GLOBALS['LANG']->getLL('cliUserGroup.grpDescription'),
465 'non_exclude_fields' => implode(',', $settings['non_exclude_fields']),465 'non_exclude_fields' => implode(',', $settings['non_exclude_fields']),
466 'tables_select' => implode(',', $settings['tables_select']),466 'tables_select' => implode(',', $settings['tables_select']),
467 'tables_modify' => implode(',', $settings['tables_modify']),467 'tables_modify' => implode(',', $settings['tables_modify']),
468 'inc_access_lists' => 1468 'inc_access_lists' => 1
469 );469 );
470470
471 $_substUid = tx_dlf_helper::processDB($data);471 $substUid = tx_dlf_helper::processDB($data);
472472
473 // Check if creation was successful.473 // Check if creation was successful.
474 if (!empty($_substUid[$_tempUid])) {474 if (!empty($substUid[$tempUid])) {
475475
476 $grpUid = $_substUid[$_tempUid];476 $grpUid = $substUid[$tempUid];
477477
478 $message = t3lib_div::makeInstance(478 $message = t3lib_div::makeInstance(
479 't3lib_FlashMessage',479 't3lib_FlashMessage',
480 $GLOBALS['LANG']->getLL('cliUserGroup.grpCreatedMsg'),480 $GLOBALS['LANG']->getLL('cliUserGroup.grpCreatedMsg'),
481 $GLOBALS['LANG']->getLL('cliUserGroup.grpCreated'),481 $GLOBALS['LANG']->getLL('cliUserGroup.grpCreated'),
482 t3lib_FlashMessage::INFO,482 t3lib_FlashMessage::INFO,
483 FALSE483 FALSE
484 );484 );
485485
486 } else {486 } else {
487487
488 $message = t3lib_div::makeInstance(488 $message = t3lib_div::makeInstance(
489 't3lib_FlashMessage',
490 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
491 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
492 t3lib_FlashMessage::ERROR,
493 FALSE
494 );
495
496 }
497
498 } else {
499
500 $message = t3lib_div::makeInstance(
501 't3lib_FlashMessage',489 't3lib_FlashMessage',
502 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),490 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
503 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),491 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
504 t3lib_FlashMessage::ERROR,492 t3lib_FlashMessage::ERROR,
505 FALSE493 FALSE
494 );
495
496 }
497
498 } else {
499
500 $message = t3lib_div::makeInstance(
501 't3lib_FlashMessage',
502 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
503 $GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
504 t3lib_FlashMessage::ERROR,
505 FALSE
506 );506 );
507507
508 }508 }
@@ -549,21 +549,21 @@
549 if (is_executable(PATH_typo3.'cli_dispatch.phpsh')) {549 if (is_executable(PATH_typo3.'cli_dispatch.phpsh')) {
550550
551 $message = t3lib_div::makeInstance(551 $message = t3lib_div::makeInstance(
552 't3lib_FlashMessage',552 't3lib_FlashMessage',
553 $GLOBALS['LANG']->getLL('cliUserGroup.cliOkayMsg'),553 $GLOBALS['LANG']->getLL('cliUserGroup.cliOkayMsg'),
554 $GLOBALS['LANG']->getLL('cliUserGroup.cliOkay'),554 $GLOBALS['LANG']->getLL('cliUserGroup.cliOkay'),
555 t3lib_FlashMessage::OK,555 t3lib_FlashMessage::OK,
556 FALSE556 FALSE
557 );557 );
558558
559 } else {559 } else {
560560
561 $message = t3lib_div::makeInstance(561 $message = t3lib_div::makeInstance(
562 't3lib_FlashMessage',562 't3lib_FlashMessage',
563 $GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkayMsg'),563 $GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkayMsg'),
564 $GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkay'),564 $GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkay'),
565 t3lib_FlashMessage::ERROR,565 t3lib_FlashMessage::ERROR,
566 FALSE566 FALSE
567 );567 );
568568
569 }569 }
570570
=== modified file 'dlf/hooks/class.tx_dlf_hacks.php'
--- dlf/hooks/class.tx_dlf_hacks.php 2012-08-07 14:39:23 +0000
+++ dlf/hooks/class.tx_dlf_hacks.php 2012-08-17 07:00:27 +0000
@@ -55,23 +55,23 @@
5555
56 $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');56 $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');
5757
58 if (($_divs = $xml->xpath('//mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]'))) {58 if (($divs = $xml->xpath('//mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]'))) {
5959
60 $_smLinks = $xml->xpath('//mets:structLink/mets:smLink');60 $smLinks = $xml->xpath('//mets:structLink/mets:smLink');
6161
62 if ($_smLinks) {62 if ($smLinks) {
6363
64 foreach ($_smLinks as $_smLink) {64 foreach ($smLinks as $smLink) {
6565
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;
6767
68 }68 }
6969
70 foreach ($_divs as $_div) {70 foreach ($divs as $div) {
7171
72 if (!empty($_links[(string) $_div['ID']])) {72 if (!empty($links[(string) $div['ID']])) {
7373
74 $_id = (string) $_div['DMDID'];74 $id = (string) $div['DMDID'];
7575
76 break;76 break;
7777
@@ -81,17 +81,17 @@
8181
82 }82 }
8383
84 if (empty($_id)) {84 if (empty($id)) {
8585
86 $_id = (string) $_divs[0]['DMDID'];86 $id = (string) $divs[0]['DMDID'];
8787
88 }88 }
8989
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');
9191
92 if (!empty($_recordId[0])) {92 if (!empty($recordIds[0])) {
9393
94 return (string) $_recordId[0];94 return (string) $recordIds[0];
9595
96 }96 }
9797
9898
=== modified file 'dlf/hooks/class.tx_dlf_tceforms.php'
--- dlf/hooks/class.tx_dlf_tceforms.php 2012-08-07 14:39:23 +0000
+++ dlf/hooks/class.tx_dlf_tceforms.php 2012-08-17 07:00:27 +0000
@@ -59,21 +59,21 @@
59 // i.e. instead of "18" it reads "pages_18|Title"59 // i.e. instead of "18" it reads "pages_18|Title"
60 if (!t3lib_div::testInt($pages)) {60 if (!t3lib_div::testInt($pages)) {
6161
62 $_parts = explode('|', $pages);62 $parts = explode('|', $pages);
6363
64 $pages = array_pop(explode('_', $_parts[0]));64 $pages = array_pop(explode('_', $parts[0]));
6565
66 }66 }
6767
68 if ($pages > 0) {68 if ($pages > 0) {
6969
70 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(70 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
71 'label,uid',71 'label,uid',
72 'tx_dlf_collections',72 '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'),73 'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_collections'),
74 '',74 '',
75 'label',75 'label',
76 ''76 ''
77 );77 );
7878
79 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {79 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
@@ -114,21 +114,21 @@
114 // i.e. instead of "18" it reads "pages_18|Title"114 // i.e. instead of "18" it reads "pages_18|Title"
115 if (!t3lib_div::testInt($pages)) {115 if (!t3lib_div::testInt($pages)) {
116116
117 $_parts = explode('|', $pages);117 $parts = explode('|', $pages);
118118
119 $pages = array_pop(explode('_', $_parts[0]));119 $pages = array_pop(explode('_', $parts[0]));
120120
121 }121 }
122122
123 if ($pages > 0) {123 if ($pages > 0) {
124124
125 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(125 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
126 'label,uid',126 'label,uid',
127 'tx_dlf_libraries',127 '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'),128 'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_libraries'),
129 '',129 '',
130 'label',130 'label',
131 ''131 ''
132 );132 );
133133
134 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {134 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
@@ -169,21 +169,21 @@
169 // i.e. instead of "18" it reads "pages_18|Title"169 // i.e. instead of "18" it reads "pages_18|Title"
170 if (!t3lib_div::testInt($pages)) {170 if (!t3lib_div::testInt($pages)) {
171171
172 $_parts = explode('|', $pages);172 $parts = explode('|', $pages);
173173
174 $pages = array_pop(explode('_', $_parts[0]));174 $pages = array_pop(explode('_', $parts[0]));
175175
176 }176 }
177177
178 if ($pages > 0) {178 if ($pages > 0) {
179179
180 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(180 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
181 'label,uid',181 'label,uid',
182 'tx_dlf_solrcores',182 'tx_dlf_solrcores',
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'),
184 '',184 '',
185 'label',185 'label',
186 ''186 ''
187 );187 );
188188
189 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {189 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
190190
=== modified file 'dlf/hooks/class.tx_dlf_tcemain.php'
--- dlf/hooks/class.tx_dlf_tcemain.php 2012-08-07 14:39:23 +0000
+++ dlf/hooks/class.tx_dlf_tcemain.php 2012-08-17 07:00:27 +0000
@@ -59,37 +59,13 @@
59 // Field post-processing for table "tx_dlf_documents".59 // Field post-processing for table "tx_dlf_documents".
60 case 'tx_dlf_documents':60 case 'tx_dlf_documents':
6161
62 // Set sorting fields if empty.62 // Set sorting field if empty.
63 if (empty($fieldArray['title_sorting']) && !empty($fieldArray['title'])) {63 if (empty($fieldArray['title_sorting']) && !empty($fieldArray['title'])) {
6464
65 $fieldArray['title_sorting'] = $fieldArray['title'];65 $fieldArray['title_sorting'] = $fieldArray['title'];
6666
67 }67 }
6868
69 if (empty($fieldArray['author_sorting']) && !empty($fieldArray['author'])) {
70
71 $fieldArray['author_sorting'] = $fieldArray['author'];
72
73 }
74
75 if (empty($fieldArray['year_sorting']) && !empty($fieldArray['year'])) {
76
77 $fieldArray['year_sorting'] = str_ireplace('x', '5', preg_replace('/[^\d.x]/i', '', (string) $fieldArray['year']));
78
79 if (strpos($fieldArray['year_sorting'], '.') || strlen($fieldArray['year_sorting']) < 3) {
80
81 $fieldArray['year_sorting'] = ((intval(trim($fieldArray['year_sorting'], '.')) - 1) * 100) + 50;
82
83 }
84
85 }
86
87 if (empty($fieldArray['place_sorting']) && !empty($fieldArray['place'])) {
88
89 $fieldArray['place_sorting'] = preg_replace('/[[:punct:]]/', '', (string) $fieldArray['place']);
90
91 }
92
93 break;69 break;
9470
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".
@@ -119,12 +95,12 @@
11995
120 // Get number of existing cores.96 // Get number of existing cores.
121 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(97 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
122 '*',98 '*',
123 'tx_dlf_solrcores',99 'tx_dlf_solrcores',
124 '',100 '',
125 '',101 '',
126 '',102 '',
127 ''103 ''
128 );104 );
129105
130 // Get first unused core number.106 // Get first unused core number.
@@ -155,10 +131,10 @@
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;
156132
157 $context = stream_context_create(array (133 $context = stream_context_create(array (
158 'http' => array (134 'http' => array (
159 'method' => 'GET',135 'method' => 'GET',
160 'user_agent' => ($conf['useragent'] ? $conf['useragent'] : ini_get('user_agent'))136 'user_agent' => ($conf['useragent'] ? $conf['useragent'] : ini_get('user_agent'))
161 )137 )
162 ));138 ));
163139
164 $response = @simplexml_load_string(file_get_contents($url, FALSE, $context));140 $response = @simplexml_load_string(file_get_contents($url, FALSE, $context));
@@ -178,7 +154,11 @@
178154
179 }155 }
180156
181 trigger_error('Could not create new Solr core "dlfCore'.$coreNumber.'"', E_USER_WARNING);157 if (TYPO3_DLOG) {
158
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);
160
161 }
182162
183 $fieldArray = NULL;163 $fieldArray = NULL;
184164
@@ -206,12 +186,12 @@
206186
207 // Get current index name.187 // Get current index name.
208 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(188 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
209 $table.'.index_name AS index_name',189 $table.'.index_name AS index_name',
210 $table,190 $table,
211 $table.'.uid='.intval($id).tx_dlf_helper::whereClause($table),191 $table.'.uid='.intval($id).tx_dlf_helper::whereClause($table),
212 '',192 '',
213 '',193 '',
214 '1'194 '1'
215 );195 );
216196
217 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {197 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
@@ -225,7 +205,11 @@
225205
226 }206 }
227207
228 trigger_error('Prevented change of "index_name" for UID '.intval($id).' in table "'.htmlspecialchars($table).'"', E_USER_NOTICE);208 if (TYPO3_DLOG) {
209
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);
211
212 }
229213
230 }214 }
231215
@@ -252,7 +236,7 @@
252 */236 */
253 public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, $pObj) {237 public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, $pObj) {
254238
255 if ($status == "update") {239 if ($status == 'update') {
256240
257 switch ($table) {241 switch ($table) {
258242
@@ -264,12 +248,12 @@
264248
265 // Get Solr core.249 // Get Solr core.
266 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(250 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
267 'tx_dlf_solrcores.uid',251 'tx_dlf_solrcores.uid',
268 'tx_dlf_solrcores,tx_dlf_documents',252 'tx_dlf_solrcores,tx_dlf_documents',
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'),
270 '',254 '',
271 '',255 '',
272 '1'256 '1'
273 );257 );
274258
275 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {259 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
@@ -299,7 +283,11 @@
299283
300 } else {284 } else {
301285
302 trigger_error('Failed to reindex document with UID '.$id, E_USER_WARNING);286 if (TYPO3_DLOG) {
287
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);
289
290 }
303291
304 }292 }
305293
@@ -336,12 +324,12 @@
336324
337 // Get Solr core.325 // Get Solr core.
338 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(326 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
339 'tx_dlf_solrcores.uid',327 'tx_dlf_solrcores.uid',
340 'tx_dlf_solrcores,tx_dlf_documents',328 'tx_dlf_solrcores,tx_dlf_documents',
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'),
342 '',330 '',
343 '',331 '',
344 '1'332 '1'
345 );333 );
346334
347 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {335 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
@@ -380,7 +368,11 @@
380368
381 } else {369 } else {
382370
383 trigger_error('Failed to reindex document with UID '.$id, E_USER_WARNING);371 if (TYPO3_DLOG) {
372
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);
374
375 }
384376
385 }377 }
386378
387379
=== modified file 'dlf/locallang.xml'
--- dlf/locallang.xml 2012-08-09 10:31:57 +0000
+++ dlf/locallang.xml 2012-08-17 07:00:27 +0000
@@ -64,7 +64,6 @@
64 <label index="tx_dlf_metadata.tab3">Access</label>64 <label index="tx_dlf_metadata.tab3">Access</label>
65 <label index="tx_dlf_formats">Data Formats</label>65 <label index="tx_dlf_formats">Data Formats</label>
66 <label index="tx_dlf_formats.type">METS Name</label>66 <label index="tx_dlf_formats.type">METS Name</label>
67 <label index="tx_dlf_formats.other_type">Is it @MDTYPE="OTHER" in METS?</label>
68 <label index="tx_dlf_formats.root">Root Element</label>67 <label index="tx_dlf_formats.root">Root Element</label>
69 <label index="tx_dlf_formats.namespace">Namespace URI</label>68 <label index="tx_dlf_formats.namespace">Namespace URI</label>
70 <label index="tx_dlf_formats.class">Class Name</label>69 <label index="tx_dlf_formats.class">Class Name</label>
@@ -219,7 +218,6 @@
219 <label index="tx_dlf_metadata.tab3">Zugriff</label>218 <label index="tx_dlf_metadata.tab3">Zugriff</label>
220 <label index="tx_dlf_formats">Datenformate</label>219 <label index="tx_dlf_formats">Datenformate</label>
221 <label index="tx_dlf_formats.type">Bezeichnung in METS</label>220 <label index="tx_dlf_formats.type">Bezeichnung in METS</label>
222 <label index="tx_dlf_formats.other_type">@MDTYPE="OTHER" in METS?</label>
223 <label index="tx_dlf_formats.root">Root-Element</label>221 <label index="tx_dlf_formats.root">Root-Element</label>
224 <label index="tx_dlf_formats.namespace">Namensraum URI</label>222 <label index="tx_dlf_formats.namespace">Namensraum URI</label>
225 <label index="tx_dlf_formats.class">Klassenname</label>223 <label index="tx_dlf_formats.class">Klassenname</label>
226224
=== modified file 'dlf/modules/indexing/index.php'
--- dlf/modules/indexing/index.php 2012-07-13 07:54:25 +0000
+++ dlf/modules/indexing/index.php 2012-08-17 07:00:27 +0000
@@ -70,7 +70,7 @@
70 $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery(70 $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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',
72 'tx_dlf_solrcores',72 'tx_dlf_solrcores',
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'),
74 '',74 '',
75 '',75 '',
76 ''76 ''
@@ -134,7 +134,7 @@
134 $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery(134 $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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',
136 'tx_dlf_solrcores',136 'tx_dlf_solrcores',
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'),
138 '',138 '',
139 '',139 '',
140 ''140 ''
141141
=== modified file 'dlf/modules/newclient/index.php'
--- dlf/modules/newclient/index.php 2012-08-07 14:39:23 +0000
+++ dlf/modules/newclient/index.php 2012-08-17 07:00:27 +0000
@@ -127,6 +127,7 @@
127 'is_sortable' => $values['is_sortable'],127 'is_sortable' => $values['is_sortable'],
128 'is_facet' => $values['is_facet'],128 'is_facet' => $values['is_facet'],
129 'is_listed' => $values['is_listed'],129 'is_listed' => $values['is_listed'],
130 'autocomplete' => $value['autocomplete'],
130 );131 );
131132
132 }133 }
133134
=== modified file 'dlf/modules/newclient/metadata.inc.php'
--- dlf/modules/newclient/metadata.inc.php 2012-08-07 14:39:23 +0000
+++ dlf/modules/newclient/metadata.inc.php 2012-08-17 07:00:27 +0000
@@ -39,6 +39,7 @@
39 'is_sortable' => 0,39 'is_sortable' => 0,
40 'is_facet' => 0,40 'is_facet' => 0,
41 'is_listed' => 0,41 'is_listed' => 0,
42 'autocomplete' => 0,
42 ),43 ),
43 'record_id' => array (44 'record_id' => array (
44 'encoded' => 1,45 'encoded' => 1,
@@ -53,6 +54,7 @@
53 'is_sortable' => 0,54 'is_sortable' => 0,
54 'is_facet' => 0,55 'is_facet' => 0,
55 'is_listed' => 0,56 'is_listed' => 0,
57 'autocomplete' => 0,
56 ),58 ),
57 'union_id' => array (59 'union_id' => array (
58 'encoded' => 1,60 'encoded' => 1,
@@ -67,6 +69,7 @@
67 'is_sortable' => 0,69 'is_sortable' => 0,
68 'is_facet' => 0,70 'is_facet' => 0,
69 'is_listed' => 0,71 'is_listed' => 0,
72 'autocomplete' => 0,
70 ),73 ),
71 'opac_id' => array (74 'opac_id' => array (
72 'encoded' => 1,75 'encoded' => 1,
@@ -81,13 +84,14 @@
81 'is_sortable' => 0,84 'is_sortable' => 0,
82 'is_facet' => 0,85 'is_facet' => 0,
83 'is_listed' => 0,86 'is_listed' => 0,
87 'autocomplete' => 0,
84 ),88 ),
85 'urn' => array (89 'urn' => array (
86 'encoded' => 1,90 'encoded' => 1,
87 'xpath' => './mods:identifier[@type="urn"]',91 'xpath' => './mods:identifier[@type="urn"]',
88 'xpath_sorting' => '',92 'xpath_sorting' => '',
89 'default_value' => '',93 'default_value' => '',
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>",
91 'tokenized' => 0,95 'tokenized' => 0,
92 'stored' => 0,96 'stored' => 0,
93 'indexed' => 1,97 'indexed' => 1,
@@ -95,13 +99,14 @@
95 'is_sortable' => 0,99 'is_sortable' => 0,
96 'is_facet' => 0,100 'is_facet' => 0,
97 'is_listed' => 0,101 'is_listed' => 0,
102 'autocomplete' => 0,
98 ),103 ),
99 'purl' => array (104 'purl' => array (
100 'encoded' => 1,105 'encoded' => 1,
101 'xpath' => './mods:identifier[@type="purl"]',106 'xpath' => './mods:identifier[@type="purl"]',
102 'xpath_sorting' => '',107 'xpath_sorting' => '',
103 'default_value' => '',108 'default_value' => '',
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>",
105 'tokenized' => 0,110 'tokenized' => 0,
106 'stored' => 0,111 'stored' => 0,
107 'indexed' => 0,112 'indexed' => 0,
@@ -109,6 +114,7 @@
109 'is_sortable' => 0,114 'is_sortable' => 0,
110 'is_facet' => 0,115 'is_facet' => 0,
111 'is_listed' => 0,116 'is_listed' => 0,
117 'autocomplete' => 0,
112 ),118 ),
113 'owner' => array (119 'owner' => array (
114 'encoded' => 1,120 'encoded' => 1,
@@ -123,6 +129,7 @@
123 'is_sortable' => 0,129 'is_sortable' => 0,
124 'is_facet' => 1,130 'is_facet' => 1,
125 'is_listed' => 0,131 'is_listed' => 0,
132 'autocomplete' => 0,
126 ),133 ),
127 'collection' => array (134 'collection' => array (
128 'encoded' => 1,135 'encoded' => 1,
@@ -137,6 +144,7 @@
137 'is_sortable' => 0,144 'is_sortable' => 0,
138 'is_facet' => 1,145 'is_facet' => 1,
139 'is_listed' => 0,146 'is_listed' => 0,
147 'autocomplete' => 0,
140 ),148 ),
141 'language' => array (149 'language' => array (
142 'encoded' => 1,150 'encoded' => 1,
@@ -151,6 +159,7 @@
151 'is_sortable' => 0,159 'is_sortable' => 0,
152 'is_facet' => 1,160 'is_facet' => 1,
153 'is_listed' => 0,161 'is_listed' => 0,
162 'autocomplete' => 0,
154 ),163 ),
155 'year' => array (164 'year' => array (
156 'encoded' => 1,165 'encoded' => 1,
@@ -165,6 +174,7 @@
165 'is_sortable' => 1,174 'is_sortable' => 1,
166 'is_facet' => 1,175 'is_facet' => 1,
167 'is_listed' => 1,176 'is_listed' => 1,
177 'autocomplete' => 0,
168 ),178 ),
169 'place' => array (179 'place' => array (
170 'encoded' => 1,180 'encoded' => 1,
@@ -179,6 +189,7 @@
179 'is_sortable' => 1,189 'is_sortable' => 1,
180 'is_facet' => 1,190 'is_facet' => 1,
181 'is_listed' => 1,191 'is_listed' => 1,
192 'autocomplete' => 0,
182 ),193 ),
183 'author' => array (194 'author' => array (
184 'encoded' => 1,195 'encoded' => 1,
@@ -193,6 +204,7 @@
193 'is_sortable' => 1,204 'is_sortable' => 1,
194 'is_facet' => 1,205 'is_facet' => 1,
195 'is_listed' => 1,206 'is_listed' => 1,
207 'autocomplete' => 1,
196 ),208 ),
197 'volume' => array (209 'volume' => array (
198 'encoded' => 1,210 'encoded' => 1,
@@ -207,6 +219,7 @@
207 'is_sortable' => 1,219 'is_sortable' => 1,
208 'is_facet' => 0,220 'is_facet' => 0,
209 'is_listed' => 1,221 'is_listed' => 1,
222 'autocomplete' => 0,
210 ),223 ),
211 'title' => array (224 'title' => array (
212 'encoded' => 1,225 'encoded' => 1,
@@ -221,13 +234,14 @@
221 'is_sortable' => 1,234 'is_sortable' => 1,
222 'is_facet' => 0,235 'is_facet' => 0,
223 'is_listed' => 1,236 'is_listed' => 1,
237 'autocomplete' => 1,
224 ),238 ),
225 'type' => array (239 'type' => array (
226 'encoded' => 0,240 'encoded' => 0,
227 'xpath' => '',241 'xpath' => '',
228 'xpath_sorting' => '',242 'xpath_sorting' => '',
229 'default_value' => '',243 'default_value' => '',
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' => '',
231 'tokenized' => 0,245 'tokenized' => 0,
232 'stored' => 1,246 'stored' => 1,
233 'indexed' => 0,247 'indexed' => 0,
@@ -235,6 +249,7 @@
235 'is_sortable' => 1,249 'is_sortable' => 1,
236 'is_facet' => 1,250 'is_facet' => 1,
237 'is_listed' => 1,251 'is_listed' => 1,
252 'autocomplete' => 0,
238 )253 )
239);254);
240255
241256
=== modified file 'dlf/plugins/collection/class.tx_dlf_collection.php'
--- dlf/plugins/collection/class.tx_dlf_collection.php 2012-08-07 14:42:49 +0000
+++ dlf/plugins/collection/class.tx_dlf_collection.php 2012-08-17 07:00:27 +0000
@@ -56,7 +56,11 @@
56 // Quit without doing anything if required configuration variables are not set.56 // Quit without doing anything if required configuration variables are not set.
57 if (empty($this->conf['pages'])) {57 if (empty($this->conf['pages'])) {
5858
59 trigger_error('Incomplete configuration for plugin '.get_class($this), E_USER_NOTICE);59 if (TYPO3_DLOG) {
60
61 t3lib_div::devLog('[tx_dlf_collection->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
62
63 }
6064
61 return $content;65 return $content;
6266
@@ -201,9 +205,9 @@
201 // Add feed link if applicable.205 // Add feed link if applicable.
202 if (!empty($this->conf['targetFeed'])) {206 if (!empty($this->conf['targetFeed'])) {
203207
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).'" />';
205209
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']);
207211
208 } else {212 } else {
209213
@@ -215,21 +219,21 @@
215 $markerArray[$resArray['uid']]['###DESCRIPTION###'] = $this->pi_RTEcssText($resArray['description']);219 $markerArray[$resArray['uid']]['###DESCRIPTION###'] = $this->pi_RTEcssText($resArray['description']);
216220
217 // Build statistic's output.221 // Build statistic's output.
218 $_labelTitles = $this->pi_getLL(($resArray['titles'] > 1 ? 'titles' : 'title'), '', FALSE);222 $labelTitles = $this->pi_getLL(($resArray['titles'] > 1 ? 'titles' : 'title'), '', FALSE);
219223
220 $markerArray[$resArray['uid']]['###COUNT_TITLES###'] = htmlspecialchars($resArray['titles'].$_labelTitles);224 $markerArray[$resArray['uid']]['###COUNT_TITLES###'] = htmlspecialchars($resArray['titles'].$labelTitles);
221225
222 $_labelVolumes = $this->pi_getLL(($volumes[$resArray['uid']] > 1 ? 'volumes' : 'volume'), '', FALSE);226 $labelVolumes = $this->pi_getLL(($volumes[$resArray['uid']] > 1 ? 'volumes' : 'volume'), '', FALSE);
223227
224 $markerArray[$resArray['uid']]['###COUNT_VOLUMES###'] = htmlspecialchars($volumes[$resArray['uid']].$_labelVolumes);228 $markerArray[$resArray['uid']]['###COUNT_VOLUMES###'] = htmlspecialchars($volumes[$resArray['uid']].$labelVolumes);
225229
226 }230 }
227231
228 $entry = $this->cObj->getSubpart($this->template, '###ENTRY###');232 $entry = $this->cObj->getSubpart($this->template, '###ENTRY###');
229233
230 foreach ($markerArray as $_markerArray) {234 foreach ($markerArray as $marker) {
231235
232 $content .= $this->cObj->substituteMarkerArray($entry, $_markerArray);236 $content .= $this->cObj->substituteMarkerArray($entry, $marker);
233237
234 }238 }
235239
@@ -271,9 +275,9 @@
271 // Process results.275 // Process results.
272 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {276 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
273277
274 if (empty($_metadata)) {278 if (empty($listMetadata)) {
275279
276 $_metadata = array (280 $listMetadata = array (
277 'label' => htmlspecialchars($resArray['collLabel']),281 'label' => htmlspecialchars($resArray['collLabel']),
278 'description' => $this->pi_RTEcssText($resArray['collDesc']),282 'description' => $this->pi_RTEcssText($resArray['collDesc']),
279 'options' => array (283 'options' => array (
@@ -379,7 +383,7 @@
379383
380 $list->add(array_values($toplevel));384 $list->add(array_values($toplevel));
381385
382 $list->metadata = $_metadata;386 $list->metadata = $listMetadata;
383387
384 $list->save();388 $list->save();
385389
386390
=== modified file 'dlf/plugins/feeds/class.tx_dlf_feeds.php'
--- dlf/plugins/feeds/class.tx_dlf_feeds.php 2012-03-24 09:05:28 +0000
+++ dlf/plugins/feeds/class.tx_dlf_feeds.php 2012-08-17 07:00:27 +0000
@@ -77,7 +77,7 @@
7777
78 }78 }
7979
80 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(80 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
81 'tx_dlf_libraries.label AS label',81 'tx_dlf_libraries.label AS label',
82 'tx_dlf_libraries',82 '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'),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'),
@@ -86,11 +86,11 @@
86 '1'86 '1'
87 );87 );
8888
89 if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {89 if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
9090
91 $_resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);91 $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
9292
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')));
9494
95 }95 }
9696
9797
=== modified file 'dlf/plugins/listview/class.tx_dlf_listview.php'
--- dlf/plugins/listview/class.tx_dlf_listview.php 2012-08-07 15:30:34 +0000
+++ dlf/plugins/listview/class.tx_dlf_listview.php 2012-08-17 07:00:27 +0000
@@ -162,71 +162,71 @@
162162
163 $element = $this->list->elements[$number];163 $element = $this->list->elements[$number];
164164
165 foreach ($this->metadata as $_index_name => $_metaConf) {165 foreach ($this->metadata as $index_name => $metaConf) {
166166
167 $value = '';167 $parsedValue = '';
168168
169 $fieldwrap = $this->parseTS($_metaConf['wrap']);169 $fieldwrap = $this->parseTS($metaConf['wrap']);
170170
171 do {171 do {
172172
173 $_value = @array_shift($element['metadata'][$_index_name]);173 $value = @array_shift($element['metadata'][$index_name]);
174174
175 // Link title to pageview.175 // Link title to pageview.
176 if ($_index_name == 'title') {176 if ($index_name == 'title') {
177177
178 // Get title of parent document if needed.178 // Get title of parent document if needed.
179 if (empty($_value) && $this->conf['getTitle']) {179 if (empty($value) && $this->conf['getTitle']) {
180180
181 $_value = '['.tx_dlf_document::getTitle($element['uid'], TRUE).']';181 $value = '['.tx_dlf_document::getTitle($element['uid'], TRUE).']';
182182
183 }183 }
184184
185 // Set fake title if still not present.185 // Set fake title if still not present.
186 if (empty($_value)) {186 if (empty($value)) {
187187
188 $_value = $this->pi_getLL('noTitle');188 $value = $this->pi_getLL('noTitle');
189189
190 }190 }
191191
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']);
193193
194 // Translate name of holding library.194 // Translate name of holding library.
195 } elseif ($_index_name == 'owner' && !empty($_value)) {195 } elseif ($index_name == 'owner' && !empty($value)) {
196196
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']));
198198
199 // Translate document type.199 // Translate document type.
200 } elseif ($_index_name == 'type' && !empty($_value)) {200 } elseif ($index_name == 'type' && !empty($value)) {
201201
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']));
203203
204 // Translate ISO 639 language code.204 // Translate ISO 639 language code.
205 } elseif ($_index_name == 'language' && !empty($_value)) {205 } elseif ($index_name == 'language' && !empty($value)) {
206206
207 $_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value));207 $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
208208
209 } elseif (!empty($_value)) {209 } elseif (!empty($value)) {
210210
211 $_value = htmlspecialchars($_value);211 $value = htmlspecialchars($value);
212212
213 }213 }
214214
215 $_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']);215 $value = $this->cObj->stdWrap($value, $fieldwrap['value.']);
216216
217 if (!empty($_value)) {217 if (!empty($value)) {
218218
219 $value .= $_value;219 $parsedValue .= $value;
220220
221 }221 }
222222
223 } while (count($element['metadata'][$_index_name]));223 } while (count($element['metadata'][$index_name]));
224224
225 if (!empty($value)) {225 if (!empty($parsedValue)) {
226226
227 $field = $this->cObj->stdWrap(htmlspecialchars($_metaConf['label']), $fieldwrap['key.']);227 $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']);
228228
229 $field .= $value;229 $field .= $parsedValue;
230230
231 $markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);231 $markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
232232
@@ -276,13 +276,20 @@
276276
277 }277 }
278278
279 $_uniqId = uniqid($prefix.'-');279 $uniqId = uniqid($prefix.'-');
280280
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();">';
282
283 // Add relevance sorting if this is a search result list.
284 if ($this->list->metadata['options']['source'] == 'search') {
285
286 $sorting .= '<option value="relevance"'.(($this->list->metadata['options']['order'] == 'relevance') ? ' selected="selected"' : '').'>'.$this->pi_getLL('relevance', '', TRUE).'</option>';
287
288 }
282289
283 foreach ($this->sortables as $index_name => $label) {290 foreach ($this->sortables as $index_name => $label) {
284291
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>';
286293
287 }294 }
288295
@@ -310,71 +317,71 @@
310317
311 $markerArray['###SUBMETADATA###'] = '';318 $markerArray['###SUBMETADATA###'] = '';
312319
313 foreach ($this->metadata as $_index_name => $_metaConf) {320 foreach ($this->metadata as $index_name => $metaConf) {
314321
315 $value = '';322 $parsedValue = '';
316323
317 $fieldwrap = $this->parseTS($_metaConf['wrap']);324 $fieldwrap = $this->parseTS($metaConf['wrap']);
318325
319 do {326 do {
320327
321 $_value = @array_shift($subpart['metadata'][$_index_name]);328 $value = @array_shift($subpart['metadata'][$index_name]);
322329
323 // Link title to pageview.330 // Link title to pageview.
324 if ($_index_name == 'title') {331 if ($index_name == 'title') {
325332
326 // Get title of parent document if needed.333 // Get title of parent document if needed.
327 if (empty($_value) && $this->conf['getTitle']) {334 if (empty($value) && $this->conf['getTitle']) {
328335
329 $_value = '['.tx_dlf_document::getTitle($subpart['uid'], TRUE).']';336 $value = '['.tx_dlf_document::getTitle($subpart['uid'], TRUE).']';
330337
331 }338 }
332339
333 // Set fake title if still not present.340 // Set fake title if still not present.
334 if (empty($_value)) {341 if (empty($value)) {
335342
336 $_value = $this->pi_getLL('noTitle');343 $value = $this->pi_getLL('noTitle');
337344
338 }345 }
339346
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']);
341348
342 // Translate name of holding library.349 // Translate name of holding library.
343 } elseif ($_index_name == 'owner' && !empty($_value)) {350 } elseif ($index_name == 'owner' && !empty($value)) {
344351
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']));
346353
347 // Translate document type.354 // Translate document type.
348 } elseif ($_index_name == 'type' && !empty($_value)) {355 } elseif ($index_name == 'type' && !empty($value)) {
349356
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);
351358
352 // Translate ISO 639 language code.359 // Translate ISO 639 language code.
353 } elseif ($_index_name == 'language' && !empty($_value)) {360 } elseif ($index_name == 'language' && !empty($value)) {
354361
355 $_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value));362 $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
356363
357 } elseif (!empty($_value)) {364 } elseif (!empty($value)) {
358365
359 $_value = htmlspecialchars($_value);366 $value = htmlspecialchars($value);
360367
361 }368 }
362369
363 $_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']);370 $value = $this->cObj->stdWrap($value, $fieldwrap['value.']);
364371
365 if (!empty($_value)) {372 if (!empty($value)) {
366373
367 $value .= $_value;374 $parsedValue .= $value;
368375
369 }376 }
370377
371 } while (count($subpart['metadata'][$_index_name]));378 } while (count($subpart['metadata'][$index_name]));
372379
373 if (!empty($value)) {380 if (!empty($parsedValue)) {
374381
375 $field = $this->cObj->stdWrap(htmlspecialchars($_metaConf['label']), $fieldwrap['key.']);382 $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']);
376383
377 $field .= $value;384 $field .= $parsedValue;
378385
379 $markerArray['###SUBMETADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);386 $markerArray['###SUBMETADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
380387
@@ -399,7 +406,7 @@
399 */406 */
400 protected function loadConfig() {407 protected function loadConfig() {
401408
402 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(409 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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',
404 'tx_dlf_metadata',411 'tx_dlf_metadata',
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'),
@@ -408,7 +415,7 @@
408 ''415 ''
409 );416 );
410417
411 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {418 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
412419
413 if ($resArray['is_listed']) {420 if ($resArray['is_listed']) {
414421
@@ -456,11 +463,11 @@
456 $this->list->sort($this->piVars['order'], TRUE);463 $this->list->sort($this->piVars['order'], TRUE);
457464
458 // Update list's metadata.465 // Update list's metadata.
459 $_metadata = $this->list->metadata;466 $listMetadata = $this->list->metadata;
460467
461 $_metadata['options']['order'] = $this->piVars['order'];468 $listMetadata['options']['order'] = $this->piVars['order'];
462469
463 $this->list->metadata = $_metadata;470 $this->list->metadata = $listMetadata;
464471
465 // Save updated list.472 // Save updated list.
466 $this->list->save();473 $this->list->save();
467474
=== modified file 'dlf/plugins/listview/locallang.xml'
--- dlf/plugins/listview/locallang.xml 2011-11-10 16:20:57 +0000
+++ dlf/plugins/listview/locallang.xml 2012-08-17 07:00:27 +0000
@@ -19,6 +19,7 @@
19 <label index="separator"> - </label>19 <label index="separator"> - </label>
20 <label index="skip">...</label>20 <label index="skip">...</label>
21 <label index="orderBy">Order by: </label>21 <label index="orderBy">Order by: </label>
22 <label index="relevance">relevance</label>
22 <label index="noTitle">[no title]</label>23 <label index="noTitle">[no title]</label>
23 </languageKey>24 </languageKey>
24 <languageKey index="de" type="array">25 <languageKey index="de" type="array">
@@ -35,6 +36,7 @@
35 <label index="separator"> - </label>36 <label index="separator"> - </label>
36 <label index="skip">...</label>37 <label index="skip">...</label>
37 <label index="orderBy">Sortieren nach: </label>38 <label index="orderBy">Sortieren nach: </label>
39 <label index="relevance">Relevanz</label>
38 <label index="noTitle">[kein Titel]</label>40 <label index="noTitle">[kein Titel]</label>
39 </languageKey>41 </languageKey>
40 </data>42 </data>
4143
=== modified file 'dlf/plugins/metadata/class.tx_dlf_metadata.php'
--- dlf/plugins/metadata/class.tx_dlf_metadata.php 2012-08-07 15:15:45 +0000
+++ dlf/plugins/metadata/class.tx_dlf_metadata.php 2012-08-17 07:00:27 +0000
@@ -68,36 +68,36 @@
68 if ($this->conf['rootline'] < 2) {68 if ($this->conf['rootline'] < 2) {
6969
70 // Get current structure's @ID.70 // Get current structure's @ID.
71 $_ids = array ();71 $ids = array ();
7272
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']]])) {
7474
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) {
7676
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::*'));
7878
79 $_ids[$_count][] = $_logId;79 $ids[$count][] = $logId;
8080
81 }81 }
8282
83 }83 }
8484
85 ksort($_ids);85 ksort($ids);
8686
87 reset($_ids);87 reset($ids);
8888
89 // Check if we should display all metadata up to the root.89 // Check if we should display all metadata up to the root.
90 if ($this->conf['rootline'] == 1) {90 if ($this->conf['rootline'] == 1) {
9191
92 foreach ($_ids as $_id) {92 foreach ($ids as $id) {
9393
94 foreach ($_id as $id) {94 foreach ($id as $sid) {
9595
96 $_data = $this->doc->getMetadata($id, $this->conf['pages']);96 $data = $this->doc->getMetadata($sid, $this->conf['pages']);
9797
98 $_data['_id'] = $id;98 $data['_id'] = $sid;
9999
100 $metadata[] = $_data;100 $metadata[] = $data;
101101
102 }102 }
103103
@@ -105,17 +105,17 @@
105105
106 } else {106 } else {
107107
108 $_id = array_pop($_ids);108 $id = array_pop($ids);
109109
110 if (is_array($_id)) {110 if (is_array($id)) {
111111
112 foreach ($_id as $id) {112 foreach ($id as $sid) {
113113
114 $_data = $this->doc->getMetadata($id, $this->conf['pages']);114 $data = $this->doc->getMetadata($sid, $this->conf['pages']);
115115
116 $_data['_id'] = $id;116 $data['_id'] = $sid;
117117
118 $metadata[] = $_data;118 $metadata[] = $data;
119119
120 }120 }
121121
@@ -128,17 +128,21 @@
128 // Get titledata?128 // Get titledata?
129 if (empty($metadata)) {129 if (empty($metadata)) {
130130
131 $_data = $this->doc->getTitleData($this->conf['pages']);131 $data = $this->doc->getTitleData($this->conf['pages']);
132132
133 $_data['_id'] = '';133 $data['_id'] = $this->doc->toplevelId;
134134
135 $metadata[] = $_data;135 $metadata[] = $data;
136136
137 }137 }
138138
139 if (empty($metadata)) {139 if (empty($metadata)) {
140140
141 trigger_error('No metadata found', E_USER_WARNING);141 if (TYPO3_DLOG) {
142
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);
144
145 }
142146
143 return $content;147 return $content;
144148
@@ -157,11 +161,11 @@
157 *161 *
158 * @access protected162 * @access protected
159 *163 *
160 * @param array $metadata: The metadata array164 * @param array $metadataArray: The metadata array
161 *165 *
162 * @return string The metadata array ready for output166 * @return string The metadata array ready for output
163 */167 */
164 protected function printMetadata(array $metadata) {168 protected function printMetadata(array $metadataArray) {
165169
166 // Load template file.170 // Load template file.
167 if (!empty($this->conf['templateFile'])) {171 if (!empty($this->conf['templateFile'])) {
@@ -181,7 +185,7 @@
181 // Get list of metadata to show.185 // Get list of metadata to show.
182 $metaList = array ();186 $metaList = array ();
183187
184 $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(188 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
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',
186 'tx_dlf_metadata',190 'tx_dlf_metadata',
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'),
@@ -190,7 +194,7 @@
190 ''194 ''
191 );195 );
192196
193 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {197 while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
194198
195 if ($this->conf['showFull'] || $resArray['is_listed']) {199 if ($this->conf['showFull'] || $resArray['is_listed']) {
196200
@@ -207,7 +211,7 @@
207 $cObjData = $this->cObj->data;211 $cObjData = $this->cObj->data;
208212
209 // Parse the metadata arrays.213 // Parse the metadata arrays.
210 foreach ($metadata as $_metadata) {214 foreach ($metadataArray as $metadata) {
211215
212 $markerArray['###METADATA###'] = '';216 $markerArray['###METADATA###'] = '';
213217
@@ -215,92 +219,92 @@
215 $this->cObj->data = $cObjData;219 $this->cObj->data = $cObjData;
216220
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.
218 foreach ($_metadata as $_index_name => $_value) {222 foreach ($metadata as $index_name => $value) {
219223
220 if (is_array($_value)) {224 if (is_array($value)) {
221225
222 $this->cObj->data[$_index_name] = implode($this->conf['separator'], $_value);226 $this->cObj->data[$index_name] = implode($this->conf['separator'], $value);
223227
224 } else {228 } else {
225229
226 $this->cObj->data[$_index_name] = $_value;230 $this->cObj->data[$index_name] = $value;
227231
228 }232 }
229233
230 }234 }
231235
232 // Process each metadate.236 // Process each metadate.
233 foreach ($metaList as $_index_name => $_metaConf) {237 foreach ($metaList as $index_name => $metaConf) {
234238
235 $value = '';239 $parsedValue = '';
236240
237 $fieldwrap = $this->parseTS($_metaConf['wrap']);241 $fieldwrap = $this->parseTS($metaConf['wrap']);
238242
239 do {243 do {
240244
241 $_value = @array_shift($_metadata[$_index_name]);245 $value = @array_shift($metadata[$index_name]);
242246
243 if ($_index_name == 'title') {247 if ($index_name == 'title') {
244248
245 // Get title of parent document if needed.249 // Get title of parent document if needed.
246 if (empty($_value) && $this->conf['getTitle'] && $this->doc->parentid) {250 if (empty($value) && $this->conf['getTitle'] && $this->doc->parentid) {
247251
248 $_value = '['.tx_dlf_document::getTitle($this->doc->parentid, TRUE).']';252 $value = '['.tx_dlf_document::getTitle($this->doc->parentid, TRUE).']';
249253
250 }254 }
251255
252 if (!empty($_value)) {256 if (!empty($value)) {
253257
254 $_value = htmlspecialchars($_value);258 $value = htmlspecialchars($value);
255259
256 // Link title to pageview.260 // Link title to pageview.
257 if ($this->conf['linkTitle'] && $_metadata['_id']) {261 if ($this->conf['linkTitle'] && $metadata['_id']) {
258262
259 $details = $this->doc->getLogicalStructure($_metadata['_id']);263 $details = $this->doc->getLogicalStructure($metadata['_id']);
260264
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']);
262266
263 }267 }
264268
265 }269 }
266270
267 } elseif ($_index_name == 'owner' && !empty($_value)) {271 } elseif ($index_name == 'owner' && !empty($value)) {
268272
269 // Translate name of holding library.273 // Translate name of holding library.
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']));
271275
272 } elseif ($_index_name == 'type' && !empty($_value)) {276 } elseif ($index_name == 'type' && !empty($value)) {
273277
274 // Translate document type.278 // Translate document type.
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']));
276280
277 } elseif ($_index_name == 'language' && !empty($_value)) {281 } elseif ($index_name == 'language' && !empty($value)) {
278282
279 // Translate ISO 639 language code.283 // Translate ISO 639 language code.
280 $_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value));284 $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
281285
282 } elseif (!empty($_value)) {286 } elseif (!empty($value)) {
283287
284 // Sanitize value for output.288 // Sanitize value for output.
285 $_value = htmlspecialchars($_value);
286
287 }
288
289 $_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']);
290
291 if (!empty($_value)) {
292
293 $value .= $_value;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: