@@ -224,7 +224,7 @@ |
||
| 224 | 224 | $result = $queryBuilder |
| 225 | 225 | ->select('COLUMN_NAME') |
| 226 | 226 | ->from('INFORMATION_SCHEMA.COLUMNS') |
| 227 | - ->where('TABLE_NAME="tx_dlf_documents" AND TABLE_SCHEMA="' . $database . '" AND COLUMN_NAME="document_format"') |
|
| 227 | + ->where('TABLE_NAME="tx_dlf_documents" AND TABLE_SCHEMA="'.$database.'" AND COLUMN_NAME="document_format"') |
|
| 228 | 228 | ->execute(); |
| 229 | 229 | while ($resArray = $result->fetch()) { |
| 230 | 230 | if ($resArray['COLUMN_NAME'] === 'document_format') { |
@@ -62,11 +62,11 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | return new ExpressionFunction( |
| 64 | 64 | 'getDocumentType', |
| 65 | - function () |
|
| 65 | + function() |
|
| 66 | 66 | { |
| 67 | 67 | // Not implemented, we only use the evaluator |
| 68 | 68 | }, |
| 69 | - function ($arguments, $cPid) |
|
| 69 | + function($arguments, $cPid) |
|
| 70 | 70 | { |
| 71 | 71 | /** @var RequestWrapper $requestWrapper */ |
| 72 | 72 | $requestWrapper = $arguments['request']; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | if ($doc->ready) { |
| 117 | 117 | return $doc; |
| 118 | 118 | } else { |
| 119 | - $this->logger->warning('Failed to load document with UID ' . $piVars['id']); |
|
| 119 | + $this->logger->warning('Failed to load document with UID '.$piVars['id']); |
|
| 120 | 120 | } |
| 121 | 121 | } elseif (!empty($piVars['recordId'])) { |
| 122 | 122 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // Try to load document. |
| 138 | 138 | return $this->loadDocument(['id' => $resArray['uid']]); |
| 139 | 139 | } else { |
| 140 | - $this->logger->warning('Failed to load document with record ID "' . $piVars['recordId'] . '"'); |
|
| 140 | + $this->logger->warning('Failed to load document with record ID "'.$piVars['recordId'].'"'); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -46,8 +46,7 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * @return ExpressionFunction[] An array of Function instances |
| 48 | 48 | */ |
| 49 | - public function getFunctions() |
|
| 50 | - { |
|
| 49 | + public function getFunctions() { |
|
| 51 | 50 | return [ |
| 52 | 51 | $this->getDocumentTypeFunction(), |
| 53 | 52 | ]; |
@@ -62,12 +61,10 @@ discard block |
||
| 62 | 61 | { |
| 63 | 62 | return new ExpressionFunction( |
| 64 | 63 | 'getDocumentType', |
| 65 | - function () |
|
| 66 | - { |
|
| 64 | + function () { |
|
| 67 | 65 | // Not implemented, we only use the evaluator |
| 68 | 66 | }, |
| 69 | - function ($arguments, $cPid) |
|
| 70 | - { |
|
| 67 | + function ($arguments, $cPid) { |
|
| 71 | 68 | /** @var RequestWrapper $requestWrapper */ |
| 72 | 69 | $requestWrapper = $arguments['request']; |
| 73 | 70 | $queryParams = $requestWrapper->getQueryParams(); |
@@ -107,8 +104,7 @@ discard block |
||
| 107 | 104 | * |
| 108 | 105 | * @return \Kitodo\Dlf\Common\Document Instance of the current document |
| 109 | 106 | */ |
| 110 | - protected function loadDocument(array $piVars) |
|
| 111 | - { |
|
| 107 | + protected function loadDocument(array $piVars) { |
|
| 112 | 108 | // Check for required variable. |
| 113 | 109 | if (!empty($piVars['id'])) { |
| 114 | 110 | // Get instance of document. |
@@ -28,16 +28,14 @@ |
||
| 28 | 28 | * @subpackage dlf |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class SearchSuggest |
|
| 32 | -{ |
|
| 31 | +class SearchSuggest { |
|
| 33 | 32 | /** |
| 34 | 33 | * The main method of the eID script |
| 35 | 34 | * |
| 36 | 35 | * @param ServerRequestInterface $request |
| 37 | 36 | * @return ResponseInterface XML response of search suggestions |
| 38 | 37 | */ |
| 39 | - public function main(ServerRequestInterface $request) |
|
| 40 | - { |
|
| 38 | + public function main(ServerRequestInterface $request) { |
|
| 41 | 39 | $output = []; |
| 42 | 40 | // Get input parameters and decrypt core name. |
| 43 | 41 | $parameters = $request->getParsedBody(); |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | } elseif (!empty($this->conf['placeholder'])) { |
| 66 | 66 | $thumbnailFile = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['placeholder']); |
| 67 | 67 | } else { |
| 68 | - $thumbnailFile = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Images/PageGridPlaceholder.jpg'; |
|
| 68 | + $thumbnailFile = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Images/PageGridPlaceholder.jpg'; |
|
| 69 | 69 | } |
| 70 | - $thumbnail = '<img alt="' . $markerArray['###PAGINATION###'] . '" src="' . $thumbnailFile . '" />'; |
|
| 70 | + $thumbnail = '<img alt="'.$markerArray['###PAGINATION###'].'" src="'.$thumbnailFile.'" />'; |
|
| 71 | 71 | // Get new plugin variables for typolink. |
| 72 | 72 | $piVars = $this->piVars; |
| 73 | 73 | // Unset no longer needed plugin variables. |
@@ -105,22 +105,22 @@ discard block |
||
| 105 | 105 | $separator = htmlspecialchars($this->pi_getLL('separator', ' - ')); |
| 106 | 106 | // Add link to previous page. |
| 107 | 107 | if ($this->piVars['pointer'] > 0) { |
| 108 | - $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], true) . $separator; |
|
| 108 | + $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], true).$separator; |
|
| 109 | 109 | } else { |
| 110 | - $output = '<span class="prev-page not-active">' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator; |
|
| 110 | + $output = '<span class="prev-page not-active">'.htmlspecialchars($this->pi_getLL('prevPage', '<')).'</span>'.$separator; |
|
| 111 | 111 | } |
| 112 | 112 | $i = 0; |
| 113 | 113 | // Add links to pages. |
| 114 | 114 | while ($i < $maxPages) { |
| 115 | 115 | if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
| 116 | 116 | if ($this->piVars['pointer'] != $i) { |
| 117 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true) . $separator; |
|
| 117 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true).$separator; |
|
| 118 | 118 | } else { |
| 119 | - $output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator; |
|
| 119 | + $output .= '<span class="active">'.htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)).'</span>'.$separator; |
|
| 120 | 120 | } |
| 121 | 121 | $skip = true; |
| 122 | 122 | } elseif ($skip == true) { |
| 123 | - $output .= '<span class="skipped">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator; |
|
| 123 | + $output .= '<span class="skipped">'.htmlspecialchars($this->pi_getLL('skip', '...')).'</span>'.$separator; |
|
| 124 | 124 | $skip = false; |
| 125 | 125 | } |
| 126 | 126 | $i++; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | if ($this->piVars['pointer'] < $maxPages - 1) { |
| 130 | 130 | $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1, 'page' => ($this->piVars['pointer'] + 1) * $this->conf['limit'] + 1], true); |
| 131 | 131 | } else { |
| 132 | - $output .= '<span class="next-page not-active">' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>'; |
|
| 132 | + $output .= '<span class="next-page not-active">'.htmlspecialchars($this->pi_getLL('nextPage', '>')).'</span>'; |
|
| 133 | 133 | } |
| 134 | 134 | return $output; |
| 135 | 135 | } |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | $additionalWhere = ''; |
| 89 | 89 | // Check for pre-selected collections. |
| 90 | 90 | if (!empty($this->piVars['collection'])) { |
| 91 | - $additionalWhere = 'tx_dlf_collections.uid=' . intval($this->piVars['collection']); |
|
| 91 | + $additionalWhere = 'tx_dlf_collections.uid='.intval($this->piVars['collection']); |
|
| 92 | 92 | } elseif (!empty($this->conf['collections'])) { |
| 93 | - $additionalWhere = 'tx_dlf_collections.uid IN (' . implode(',', GeneralUtility::intExplode(',', $this->conf['collections'])) . ')'; |
|
| 93 | + $additionalWhere = 'tx_dlf_collections.uid IN ('.implode(',', GeneralUtility::intExplode(',', $this->conf['collections'])).')'; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | ) { |
| 146 | 146 | $superiorTitle = Document::getTitle($resArray['partof'], true); |
| 147 | 147 | if (!empty($superiorTitle)) { |
| 148 | - $title .= '[' . $superiorTitle . ']'; |
|
| 148 | + $title .= '['.$superiorTitle.']'; |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | // Get title of document. |
| 152 | 152 | if (!empty($resArray['title'])) { |
| 153 | - $title .= ' ' . $resArray['title']; |
|
| 153 | + $title .= ' '.$resArray['title']; |
|
| 154 | 154 | } |
| 155 | 155 | // Set default title if empty. |
| 156 | 156 | if (empty($title)) { |
@@ -158,13 +158,13 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | // Append volume information. |
| 160 | 160 | if (!empty($resArray['volume'])) { |
| 161 | - $title .= ', ' . $this->pi_getLL('volume') . ' ' . $resArray['volume']; |
|
| 161 | + $title .= ', '.$this->pi_getLL('volume').' '.$resArray['volume']; |
|
| 162 | 162 | } |
| 163 | 163 | // Is this document new or updated? |
| 164 | 164 | if ($resArray['crdate'] == $resArray['tstamp']) { |
| 165 | - $title = $this->pi_getLL('new') . ' ' . trim($title); |
|
| 165 | + $title = $this->pi_getLL('new').' '.trim($title); |
|
| 166 | 166 | } else { |
| 167 | - $title = $this->pi_getLL('update') . ' ' . trim($title); |
|
| 167 | + $title = $this->pi_getLL('update').' '.trim($title); |
|
| 168 | 168 | } |
| 169 | 169 | $item->appendChild($rss->createElement('title', htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8'))); |
| 170 | 170 | // Add link. |
@@ -196,10 +196,10 @@ discard block |
||
| 196 | 196 | // Send headers. |
| 197 | 197 | header('HTTP/1.1 200 OK'); |
| 198 | 198 | header('Cache-Control: no-cache'); |
| 199 | - header('Content-Length: ' . strlen($content)); |
|
| 199 | + header('Content-Length: '.strlen($content)); |
|
| 200 | 200 | header('Content-Type: application/rss+xml; charset=utf-8'); |
| 201 | - header('Date: ' . date('r', $GLOBALS['EXEC_TIME'])); |
|
| 202 | - header('Expires: ' . date('r', $GLOBALS['EXEC_TIME'])); |
|
| 201 | + header('Date: '.date('r', $GLOBALS['EXEC_TIME'])); |
|
| 202 | + header('Expires: '.date('r', $GLOBALS['EXEC_TIME'])); |
|
| 203 | 203 | echo $content; |
| 204 | 204 | exit; |
| 205 | 205 | } |
@@ -157,13 +157,13 @@ discard block |
||
| 157 | 157 | $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc'); |
| 158 | 158 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/'); |
| 159 | 159 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
| 160 | - $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'] . ' ' . $this->formats['oai_dc']['schema']); |
|
| 160 | + $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'].' '.$this->formats['oai_dc']['schema']); |
|
| 161 | 161 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['record_id'], ENT_NOQUOTES, 'UTF-8'))); |
| 162 | 162 | if (!empty($metadata['purl'])) { |
| 163 | 163 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['purl'], ENT_NOQUOTES, 'UTF-8'))); |
| 164 | 164 | } |
| 165 | 165 | if (!empty($metadata['prod_id'])) { |
| 166 | - $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', 'kitodo:production:' . htmlspecialchars($metadata['prod_id'], ENT_NOQUOTES, 'UTF-8'))); |
|
| 166 | + $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', 'kitodo:production:'.htmlspecialchars($metadata['prod_id'], ENT_NOQUOTES, 'UTF-8'))); |
|
| 167 | 167 | } |
| 168 | 168 | if (!empty($metadata['urn'])) { |
| 169 | 169 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['urn'], ENT_NOQUOTES, 'UTF-8'))); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | // Add attributes and build XML tree. |
| 262 | 262 | $epicur->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
| 263 | - $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'] . ' ' . $this->formats['epicur']['schema']); |
|
| 263 | + $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'].' '.$this->formats['epicur']['schema']); |
|
| 264 | 264 | // Do we update an URN or register a new one? |
| 265 | 265 | if ($metadata['tstamp'] == $metadata['crdate']) { |
| 266 | 266 | $update->setAttribute('type', 'urn_new'); |
@@ -307,10 +307,10 @@ discard block |
||
| 307 | 307 | // Import node into \DOMDocument. |
| 308 | 308 | $mets = $this->oai->importNode($root->item(0), true); |
| 309 | 309 | } else { |
| 310 | - $this->logger->error('No METS part found in document with location "' . $metadata['location'] . '"'); |
|
| 310 | + $this->logger->error('No METS part found in document with location "'.$metadata['location'].'"'); |
|
| 311 | 311 | } |
| 312 | 312 | } else { |
| 313 | - $this->logger->error('Could not load XML file from "' . $metadata['location'] . '"'); |
|
| 313 | + $this->logger->error('Could not load XML file from "'.$metadata['location'].'"'); |
|
| 314 | 314 | } |
| 315 | 315 | if ($mets === null) { |
| 316 | 316 | $mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!'), ENT_NOQUOTES, 'UTF-8')); |
@@ -346,15 +346,15 @@ discard block |
||
| 346 | 346 | if (strpos($this->conf['stylesheet'], 'EXT:') === 0) { |
| 347 | 347 | [$extKey, $filePath] = explode('/', substr($this->conf['stylesheet'], 4), 2); |
| 348 | 348 | if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey)) { |
| 349 | - $this->conf['stylesheet'] = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extKey)) . $filePath; |
|
| 349 | + $this->conf['stylesheet'] = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extKey)).$filePath; |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->conf['stylesheet']); |
| 353 | 353 | } else { |
| 354 | 354 | // Use default stylesheet if no custom stylesheet is given. |
| 355 | - $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Stylesheets/OaiPmh.xsl'); |
|
| 355 | + $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Stylesheets/OaiPmh.xsl'); |
|
| 356 | 356 | } |
| 357 | - $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="' . htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8') . '"')); |
|
| 357 | + $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="'.htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8').'"')); |
|
| 358 | 358 | // Create root element. |
| 359 | 359 | $root = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'OAI-PMH'); |
| 360 | 360 | $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
@@ -405,10 +405,10 @@ discard block |
||
| 405 | 405 | // Send headers. |
| 406 | 406 | header('HTTP/1.1 200 OK'); |
| 407 | 407 | header('Cache-Control: no-cache'); |
| 408 | - header('Content-Length: ' . strlen($content)); |
|
| 408 | + header('Content-Length: '.strlen($content)); |
|
| 409 | 409 | header('Content-Type: text/xml; charset=utf-8'); |
| 410 | - header('Date: ' . date('r', $GLOBALS['EXEC_TIME'])); |
|
| 411 | - header('Expires: ' . date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
|
| 410 | + header('Date: '.date('r', $GLOBALS['EXEC_TIME'])); |
|
| 411 | + header('Expires: '.date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
|
| 412 | 412 | echo $content; |
| 413 | 413 | exit; |
| 414 | 414 | } |
@@ -469,16 +469,16 @@ discard block |
||
| 469 | 469 | |
| 470 | 470 | $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_dlf_documents'); |
| 471 | 471 | |
| 472 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 473 | - 'FROM `tx_dlf_documents` ' . |
|
| 474 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 475 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 476 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
| 477 | - 'AND `tx_dlf_documents`.`pid` = ? ' . |
|
| 478 | - 'AND `tx_dlf_collections`.`pid` = ? ' . |
|
| 479 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 480 | - $where . |
|
| 481 | - 'AND ' . Helper::whereExpression('tx_dlf_collections'); |
|
| 472 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 473 | + 'FROM `tx_dlf_documents` '. |
|
| 474 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 475 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 476 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
| 477 | + 'AND `tx_dlf_documents`.`pid` = ? '. |
|
| 478 | + 'AND `tx_dlf_collections`.`pid` = ? '. |
|
| 479 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 480 | + $where. |
|
| 481 | + 'AND '.Helper::whereExpression('tx_dlf_collections'); |
|
| 482 | 482 | |
| 483 | 483 | $values = [ |
| 484 | 484 | $this->piVars['identifier'], |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $timestamp = $resArray['tstamp']; |
| 606 | 606 | $earliestDatestamp = gmdate('Y-m-d\TH:i:s\Z', $timestamp); |
| 607 | 607 | } else { |
| 608 | - $this->logger->notice('No records found with PID ' . $this->conf['pages']); |
|
| 608 | + $this->logger->notice('No records found with PID '.$this->conf['pages']); |
|
| 609 | 609 | } |
| 610 | 610 | $linkConf = [ |
| 611 | 611 | 'parameter' => $GLOBALS['TSFE']->id, |
@@ -866,9 +866,9 @@ discard block |
||
| 866 | 866 | } |
| 867 | 867 | $resArray = $allResults[0]; |
| 868 | 868 | if ($resArray['index_query'] != "") { |
| 869 | - $solr_query .= '(' . $resArray['index_query'] . ')'; |
|
| 869 | + $solr_query .= '('.$resArray['index_query'].')'; |
|
| 870 | 870 | } else { |
| 871 | - $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"'; |
|
| 871 | + $solr_query .= 'collection:'.'"'.$resArray['index_name'].'"'; |
|
| 872 | 872 | } |
| 873 | 873 | } else { |
| 874 | 874 | // If no set is specified we have to query for all collections |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | } |
| 877 | 877 | // Check for required fields. |
| 878 | 878 | foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) { |
| 879 | - $solr_query .= ' NOT ' . $required . ':""'; |
|
| 879 | + $solr_query .= ' NOT '.$required.':""'; |
|
| 880 | 880 | } |
| 881 | 881 | // toplevel="true" is always required |
| 882 | 882 | $solr_query .= ' AND toplevel:true'; |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | || is_array($date_array = strptime($this->piVars['from'], '%Y-%m-%d')) |
| 890 | 890 | ) { |
| 891 | 891 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
| 892 | - $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.000Z'; |
|
| 892 | + $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z'; |
|
| 893 | 893 | } else { |
| 894 | 894 | throw new \Exception('badArgument'); |
| 895 | 895 | } |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | || is_array($date_array = strptime($this->piVars['until'], '%Y-%m-%d')) |
| 904 | 904 | ) { |
| 905 | 905 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
| 906 | - $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z'; |
|
| 906 | + $until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z'; |
|
| 907 | 907 | if ($from != "*" && $from > $until) { |
| 908 | 908 | throw new \Exception('badArgument'); |
| 909 | 909 | } |
@@ -920,7 +920,7 @@ discard block |
||
| 920 | 920 | throw new \Exception('badArgument'); |
| 921 | 921 | } |
| 922 | 922 | } |
| 923 | - $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until . ']'; |
|
| 923 | + $solr_query .= ' AND timestamp:['.$from.' TO '.$until.']'; |
|
| 924 | 924 | $documentSet = []; |
| 925 | 925 | $solr = Solr::getInstance($this->conf['solrcore']); |
| 926 | 926 | if (!$solr->ready) { |
@@ -963,16 +963,16 @@ discard block |
||
| 963 | 963 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 964 | 964 | ->getConnectionForTable('tx_dlf_documents'); |
| 965 | 965 | |
| 966 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 967 | - 'FROM `tx_dlf_documents` ' . |
|
| 968 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 969 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 970 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
| 971 | - 'AND `tx_dlf_documents`.`pid` = ? ' . |
|
| 972 | - 'AND `tx_dlf_collections`.`pid` = ? ' . |
|
| 973 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 974 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
| 975 | - 'GROUP BY `tx_dlf_documents`.`uid` ' . |
|
| 966 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 967 | + 'FROM `tx_dlf_documents` '. |
|
| 968 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 969 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 970 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
| 971 | + 'AND `tx_dlf_documents`.`pid` = ? '. |
|
| 972 | + 'AND `tx_dlf_collections`.`pid` = ? '. |
|
| 973 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 974 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
| 975 | + 'GROUP BY `tx_dlf_documents`.`uid` '. |
|
| 976 | 976 | 'LIMIT ?'; |
| 977 | 977 | |
| 978 | 978 | $values = [ |
@@ -27,8 +27,7 @@ discard block |
||
| 27 | 27 | * @subpackage dlf |
| 28 | 28 | * @access public |
| 29 | 29 | */ |
| 30 | -class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 31 | -{ |
|
| 30 | +class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 32 | 31 | public $scriptRelPath = 'Classes/Plugin/OaiPmh.php'; |
| 33 | 32 | |
| 34 | 33 | /** |
@@ -78,8 +77,7 @@ discard block |
||
| 78 | 77 | * |
| 79 | 78 | * @return void |
| 80 | 79 | */ |
| 81 | - protected function deleteExpiredTokens() |
|
| 82 | - { |
|
| 80 | + protected function deleteExpiredTokens() { |
|
| 83 | 81 | // Delete expired resumption tokens. |
| 84 | 82 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_dlf_tokens'); |
| 85 | 83 | |
@@ -106,8 +104,7 @@ discard block |
||
| 106 | 104 | * |
| 107 | 105 | * @return \DOMElement XML node to add to the OAI response |
| 108 | 106 | */ |
| 109 | - protected function error($type) |
|
| 110 | - { |
|
| 107 | + protected function error($type) { |
|
| 111 | 108 | $this->error = true; |
| 112 | 109 | $error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type), ENT_NOQUOTES, 'UTF-8')); |
| 113 | 110 | $error->setAttribute('code', $type); |
@@ -121,8 +118,7 @@ discard block |
||
| 121 | 118 | * |
| 122 | 119 | * @return void |
| 123 | 120 | */ |
| 124 | - protected function getUrlParams() |
|
| 125 | - { |
|
| 121 | + protected function getUrlParams() { |
|
| 126 | 122 | $allowedParams = [ |
| 127 | 123 | 'verb', |
| 128 | 124 | 'identifier', |
@@ -152,8 +148,7 @@ discard block |
||
| 152 | 148 | * |
| 153 | 149 | * @return \DOMElement XML node to add to the OAI response |
| 154 | 150 | */ |
| 155 | - protected function getDcData(array $metadata) |
|
| 156 | - { |
|
| 151 | + protected function getDcData(array $metadata) { |
|
| 157 | 152 | $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc'); |
| 158 | 153 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/'); |
| 159 | 154 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
@@ -231,8 +226,7 @@ discard block |
||
| 231 | 226 | * |
| 232 | 227 | * @return \DOMElement XML node to add to the OAI response |
| 233 | 228 | */ |
| 234 | - protected function getEpicurData(array $metadata) |
|
| 235 | - { |
|
| 229 | + protected function getEpicurData(array $metadata) { |
|
| 236 | 230 | // Define all XML elements with or without qualified namespace. |
| 237 | 231 | if (empty($this->conf['unqualified_epicur'])) { |
| 238 | 232 | $epicur = $this->oai->createElementNS($this->formats['epicur']['namespace'], 'epicur:epicur'); |
@@ -295,8 +289,7 @@ discard block |
||
| 295 | 289 | * |
| 296 | 290 | * @return \DOMElement XML node to add to the OAI response |
| 297 | 291 | */ |
| 298 | - protected function getMetsData(array $metadata) |
|
| 299 | - { |
|
| 292 | + protected function getMetsData(array $metadata) { |
|
| 300 | 293 | $mets = null; |
| 301 | 294 | // Load METS file. |
| 302 | 295 | $xml = new \DOMDocument(); |
@@ -328,8 +321,7 @@ discard block |
||
| 328 | 321 | * |
| 329 | 322 | * @return void |
| 330 | 323 | */ |
| 331 | - public function main($content, $conf) |
|
| 332 | - { |
|
| 324 | + public function main($content, $conf) { |
|
| 333 | 325 | // Initialize plugin. |
| 334 | 326 | $this->init($conf); |
| 335 | 327 | // Turn cache off. |
@@ -420,8 +412,7 @@ discard block |
||
| 420 | 412 | * |
| 421 | 413 | * @return \DOMElement XML node to add to the OAI response |
| 422 | 414 | */ |
| 423 | - protected function resume() |
|
| 424 | - { |
|
| 415 | + protected function resume() { |
|
| 425 | 416 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 426 | 417 | ->getQueryBuilderForTable('tx_dlf_tokens'); |
| 427 | 418 | |
@@ -454,8 +445,7 @@ discard block |
||
| 454 | 445 | * |
| 455 | 446 | * @return \DOMElement XML node to add to the OAI response |
| 456 | 447 | */ |
| 457 | - protected function verbGetRecord() |
|
| 458 | - { |
|
| 448 | + protected function verbGetRecord() { |
|
| 459 | 449 | if (count($this->piVars) !== 3 || empty($this->piVars['metadataPrefix']) || empty($this->piVars['identifier'])) { |
| 460 | 450 | return $this->error('badArgument'); |
| 461 | 451 | } |
@@ -548,8 +538,7 @@ discard block |
||
| 548 | 538 | * |
| 549 | 539 | * @return \DOMElement XML node to add to the OAI response |
| 550 | 540 | */ |
| 551 | - protected function verbIdentify() |
|
| 552 | - { |
|
| 541 | + protected function verbIdentify() { |
|
| 553 | 542 | // Check for invalid arguments. |
| 554 | 543 | if (count($this->piVars) > 1) { |
| 555 | 544 | return $this->error('badArgument'); |
@@ -632,8 +621,7 @@ discard block |
||
| 632 | 621 | * |
| 633 | 622 | * @return \DOMElement XML node to add to the OAI response |
| 634 | 623 | */ |
| 635 | - protected function verbListIdentifiers() |
|
| 636 | - { |
|
| 624 | + protected function verbListIdentifiers() { |
|
| 637 | 625 | // If we have a resumption token we can continue our work |
| 638 | 626 | if (!empty($this->piVars['resumptionToken'])) { |
| 639 | 627 | // "resumptionToken" is an exclusive argument. |
@@ -672,8 +660,7 @@ discard block |
||
| 672 | 660 | * |
| 673 | 661 | * @return \DOMElement XML node to add to the OAI response |
| 674 | 662 | */ |
| 675 | - protected function verbListMetadataFormats() |
|
| 676 | - { |
|
| 663 | + protected function verbListMetadataFormats() { |
|
| 677 | 664 | $resArray = []; |
| 678 | 665 | // Check for invalid arguments. |
| 679 | 666 | if (count($this->piVars) > 1) { |
@@ -731,8 +718,7 @@ discard block |
||
| 731 | 718 | * |
| 732 | 719 | * @return \DOMElement XML node to add to the OAI response |
| 733 | 720 | */ |
| 734 | - protected function verbListRecords() |
|
| 735 | - { |
|
| 721 | + protected function verbListRecords() { |
|
| 736 | 722 | // Check for invalid arguments. |
| 737 | 723 | if (!empty($this->piVars['resumptionToken'])) { |
| 738 | 724 | // "resumptionToken" is an exclusive argument. |
@@ -772,8 +758,7 @@ discard block |
||
| 772 | 758 | * |
| 773 | 759 | * @return \DOMElement XML node to add to the OAI response |
| 774 | 760 | */ |
| 775 | - protected function verbListSets() |
|
| 776 | - { |
|
| 761 | + protected function verbListSets() { |
|
| 777 | 762 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 778 | 763 | ->getQueryBuilderForTable('tx_dlf_collections'); |
| 779 | 764 | |
@@ -829,8 +814,7 @@ discard block |
||
| 829 | 814 | * @return array Array of matching records |
| 830 | 815 | * @throws \Exception |
| 831 | 816 | */ |
| 832 | - protected function fetchDocumentUIDs() |
|
| 833 | - { |
|
| 817 | + protected function fetchDocumentUIDs() { |
|
| 834 | 818 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 835 | 819 | ->getQueryBuilderForTable('tx_dlf_collections'); |
| 836 | 820 | |
@@ -955,8 +939,7 @@ discard block |
||
| 955 | 939 | * |
| 956 | 940 | * @return \DOMElement XML of enriched records |
| 957 | 941 | */ |
| 958 | - protected function generateOutputForDocumentList(DocumentList $documentListSet) |
|
| 959 | - { |
|
| 942 | + protected function generateOutputForDocumentList(DocumentList $documentListSet) { |
|
| 960 | 943 | $documentsToProcess = $documentListSet->removeRange(0, (int) $this->conf['limit']); |
| 961 | 944 | $verb = $this->piVars['verb']; |
| 962 | 945 | |
@@ -1059,8 +1042,7 @@ discard block |
||
| 1059 | 1042 | * |
| 1060 | 1043 | * @return \DOMElement XML for resumption token |
| 1061 | 1044 | */ |
| 1062 | - protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet) |
|
| 1063 | - { |
|
| 1045 | + protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet) { |
|
| 1064 | 1046 | if ($documentListSet->count() !== 0) { |
| 1065 | 1047 | $token = uniqid('', false); |
| 1066 | 1048 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | // Get next available core name if none given. |
| 136 | 136 | if (empty($core)) { |
| 137 | - $core = 'dlfCore' . self::getNextCoreNumber(); |
|
| 137 | + $core = 'dlfCore'.self::getNextCoreNumber(); |
|
| 138 | 138 | } |
| 139 | 139 | // Get Solr service instance. |
| 140 | 140 | $solr = self::getInstance($core); |
@@ -230,13 +230,13 @@ discard block |
||
| 230 | 230 | ->execute(); |
| 231 | 231 | |
| 232 | 232 | while ($resArray = $result->fetch()) { |
| 233 | - $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i'; |
|
| 233 | + $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i'; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | // Check if queried field is valid. |
| 237 | 237 | $splitQuery = explode(':', $query, 2); |
| 238 | 238 | if (in_array($splitQuery[0], $fields)) { |
| 239 | - $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')'; |
|
| 239 | + $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')'; |
|
| 240 | 240 | } else { |
| 241 | 241 | $query = self::escapeQuery($query); |
| 242 | 242 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | { |
| 344 | 344 | $number = max(intval($number), 0); |
| 345 | 345 | // Check if core already exists. |
| 346 | - $solr = self::getInstance('dlfCore' . $number); |
|
| 346 | + $solr = self::getInstance('dlfCore'.$number); |
|
| 347 | 347 | if (!$solr->ready) { |
| 348 | 348 | return $number; |
| 349 | 349 | } else { |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | // Set filter query to just get toplevel documents. |
| 419 | 419 | $params['filterquery'][] = ['query' => 'toplevel:true']; |
| 420 | 420 | // Set join query to get all documents with the same uids. |
| 421 | - $params['query'] = '{!join from=uid to=uid}' . $params['query']; |
|
| 421 | + $params['query'] = '{!join from=uid to=uid}'.$params['query']; |
|
| 422 | 422 | // Perform search to determine the total number of toplevel hits and fetch the required rows. |
| 423 | 423 | $selectQuery = $this->service->createSelect($params); |
| 424 | 424 | $results = $this->service->select($selectQuery); |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | // Set query. |
| 476 | 476 | $parameters['query'] = $query; |
| 477 | 477 | // Calculate cache identifier. |
| 478 | - $cacheIdentifier = Helper::digest($this->core . print_r(array_merge($this->params, $parameters), true)); |
|
| 478 | + $cacheIdentifier = Helper::digest($this->core.print_r(array_merge($this->params, $parameters), true)); |
|
| 479 | 479 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
| 480 | 480 | $resultSet = []; |
| 481 | 481 | if (($entry = $cache->get($cacheIdentifier)) === false) { |
@@ -606,12 +606,12 @@ discard block |
||
| 606 | 606 | */ |
| 607 | 607 | public function __get($var) |
| 608 | 608 | { |
| 609 | - $method = '_get' . ucfirst($var); |
|
| 609 | + $method = '_get'.ucfirst($var); |
|
| 610 | 610 | if ( |
| 611 | 611 | !property_exists($this, $var) |
| 612 | 612 | || !method_exists($this, $method) |
| 613 | 613 | ) { |
| 614 | - $this->logger->warning('There is no getter function for property "' . $var . '"'); |
|
| 614 | + $this->logger->warning('There is no getter function for property "'.$var.'"'); |
|
| 615 | 615 | return; |
| 616 | 616 | } else { |
| 617 | 617 | return $this->$method(); |
@@ -644,12 +644,12 @@ discard block |
||
| 644 | 644 | */ |
| 645 | 645 | public function __set($var, $value) |
| 646 | 646 | { |
| 647 | - $method = '_set' . ucfirst($var); |
|
| 647 | + $method = '_set'.ucfirst($var); |
|
| 648 | 648 | if ( |
| 649 | 649 | !property_exists($this, $var) |
| 650 | 650 | || !method_exists($this, $method) |
| 651 | 651 | ) { |
| 652 | - $this->logger->warning('There is no setter function for property "' . $var . '"'); |
|
| 652 | + $this->logger->warning('There is no setter function for property "'.$var.'"'); |
|
| 653 | 653 | } else { |
| 654 | 654 | $this->$method($value); |
| 655 | 655 | } |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | 'scheme' => $this->config['scheme'], |
| 687 | 687 | 'host' => $this->config['host'], |
| 688 | 688 | 'port' => $this->config['port'], |
| 689 | - 'path' => '/' . $this->config['path'], |
|
| 689 | + 'path' => '/'.$this->config['path'], |
|
| 690 | 690 | 'core' => $core, |
| 691 | 691 | 'username' => $this->config['username'], |
| 692 | 692 | 'password' => $this->config['password'], |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $templateFile = $this->conf['templateFile']; |
| 82 | 82 | } else { |
| 83 | 83 | // Load default template from extension. |
| 84 | - $templateFile = 'EXT:' . $this->extKey . '/Resources/Private/Templates/' . Helper::getUnqualifiedClassName(get_class($this)) . '.tmpl'; |
|
| 84 | + $templateFile = 'EXT:'.$this->extKey.'/Resources/Private/Templates/'.Helper::getUnqualifiedClassName(get_class($this)).'.tmpl'; |
|
| 85 | 85 | } |
| 86 | 86 | // Substitute strings like "EXT:" in given template file location. |
| 87 | 87 | $fileResource = $GLOBALS['TSFE']->tmpl->getFileName($templateFile); |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | $conf = Helper::mergeRecursiveWithOverrule($flexFormConf, $conf); |
| 108 | 108 | } |
| 109 | 109 | // Read plugin TS configuration. |
| 110 | - $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '.']; |
|
| 110 | + $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_'.strtolower(Helper::getUnqualifiedClassName(get_class($this))).'.']; |
|
| 111 | 111 | if (is_array($pluginConf)) { |
| 112 | 112 | $conf = Helper::mergeRecursiveWithOverrule($pluginConf, $conf); |
| 113 | 113 | } |
| 114 | 114 | // Read general TS configuration. |
| 115 | - $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.']; |
|
| 115 | + $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId.'.']; |
|
| 116 | 116 | if (is_array($generalConf)) { |
| 117 | 117 | $conf = Helper::mergeRecursiveWithOverrule($generalConf, $conf); |
| 118 | 118 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | // Set default plugin variables. |
| 128 | 128 | $this->pi_setPiVarDefaults(); |
| 129 | 129 | // Load translation files. |
| 130 | - $this->pi_loadLL('EXT:' . $this->extKey . '/Resources/Private/Language/' . Helper::getUnqualifiedClassName(get_class($this)) . '.xml'); |
|
| 130 | + $this->pi_loadLL('EXT:'.$this->extKey.'/Resources/Private/Language/'.Helper::getUnqualifiedClassName(get_class($this)).'.xml'); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | if (!$this->doc->ready) { |
| 152 | 152 | // Destroy the incomplete object. |
| 153 | 153 | $this->doc = null; |
| 154 | - $this->logger->error('Failed to load document with UID ' . $this->piVars['id']); |
|
| 154 | + $this->logger->error('Failed to load document with UID '.$this->piVars['id']); |
|
| 155 | 155 | } else { |
| 156 | 156 | // Set configuration PID. |
| 157 | 157 | $this->doc->cPid = $this->conf['pages']; |
@@ -179,10 +179,10 @@ discard block |
||
| 179 | 179 | // Try to load document. |
| 180 | 180 | $this->loadDocument(); |
| 181 | 181 | } else { |
| 182 | - $this->logger->error('Failed to load document with record ID "' . $this->piVars['recordId'] . '"'); |
|
| 182 | + $this->logger->error('Failed to load document with record ID "'.$this->piVars['recordId'].'"'); |
|
| 183 | 183 | } |
| 184 | 184 | } else { |
| 185 | - $this->logger->error('Invalid UID ' . $this->piVars['id'] . ' or PID ' . $this->conf['pages'] . ' for document loading'); |
|
| 185 | + $this->logger->error('Invalid UID '.$this->piVars['id'].' or PID '.$this->conf['pages'].' for document loading'); |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $conf['no_cache'] = true; |
| 237 | 237 | } |
| 238 | 238 | $conf['parameter'] = $altPageId ? : ($this->pi_tmpPageId ? : 'current'); |
| 239 | - $conf['additionalParams'] = $this->conf['parent.']['addParams'] . HttpUtility::buildQueryString($urlParameters, '&', true) . $this->pi_moreParams; |
|
| 239 | + $conf['additionalParams'] = $this->conf['parent.']['addParams'].HttpUtility::buildQueryString($urlParameters, '&', true).$this->pi_moreParams; |
|
| 240 | 240 | // Add additional configuration for absolute URLs. |
| 241 | 241 | $conf['forceAbsoluteUrl'] = !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0; |
| 242 | 242 | $conf['forceAbsoluteUrl.']['scheme'] = !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'; |
@@ -257,9 +257,9 @@ discard block |
||
| 257 | 257 | { |
| 258 | 258 | if (!$this->frontendController->config['config']['disableWrapInBaseClass']) { |
| 259 | 259 | // Use class name instead of $this->prefixId for content wrapping because $this->prefixId is the same for all plugins. |
| 260 | - $content = '<div class="tx-dlf-' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '">' . $content . '</div>'; |
|
| 260 | + $content = '<div class="tx-dlf-'.strtolower(Helper::getUnqualifiedClassName(get_class($this))).'">'.$content.'</div>'; |
|
| 261 | 261 | if (!$this->frontendController->config['config']['disablePrefixComment']) { |
| 262 | - $content = "\n\n<!-- BEGIN: Content of extension '" . $this->extKey . "', plugin '" . Helper::getUnqualifiedClassName(get_class($this)) . "' -->\n\n" . $content . "\n\n<!-- END: Content of extension '" . $this->extKey . "', plugin '" . Helper::getUnqualifiedClassName(get_class($this)) . "' -->\n\n"; |
|
| 262 | + $content = "\n\n<!-- BEGIN: Content of extension '".$this->extKey."', plugin '".Helper::getUnqualifiedClassName(get_class($this))."' -->\n\n".$content."\n\n<!-- END: Content of extension '".$this->extKey."', plugin '".Helper::getUnqualifiedClassName(get_class($this))."' -->\n\n"; |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | return $content; |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | public $prefixId = 'tx_dlf'; |
| 38 | 38 | public $scriptRelPath = 'Classes/Common/AbstractPlugin.php'; |
| 39 | 39 | // Plugins are cached by default (@see setCache()). |
| 40 | - public $pi_USER_INT_obj = false; |
|
| 41 | - public $pi_checkCHash = true; |
|
| 40 | + public $pi_USER_INT_obj = FALSE; |
|
| 41 | + public $pi_checkCHash = TRUE; |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * This holds the current document |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $this->doc = Document::getInstance($this->piVars['id'], $pid); |
| 151 | 151 | if (!$this->doc->ready) { |
| 152 | 152 | // Destroy the incomplete object. |
| 153 | - $this->doc = null; |
|
| 153 | + $this->doc = NULL; |
|
| 154 | 154 | $this->logger->error('Failed to load document with UID ' . $this->piVars['id']); |
| 155 | 155 | } else { |
| 156 | 156 | // Set configuration PID. |
@@ -229,14 +229,14 @@ discard block |
||
| 229 | 229 | * |
| 230 | 230 | * @return string The input string wrapped in <a> tags |
| 231 | 231 | */ |
| 232 | - public function pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0) |
|
| 232 | + public function pi_linkTP($str, $urlParameters = [], $cache = FALSE, $altPageId = 0) |
|
| 233 | 233 | { |
| 234 | 234 | $conf = []; |
| 235 | 235 | if (!$cache) { |
| 236 | - $conf['no_cache'] = true; |
|
| 236 | + $conf['no_cache'] = TRUE; |
|
| 237 | 237 | } |
| 238 | 238 | $conf['parameter'] = $altPageId ? : ($this->pi_tmpPageId ? : 'current'); |
| 239 | - $conf['additionalParams'] = $this->conf['parent.']['addParams'] . HttpUtility::buildQueryString($urlParameters, '&', true) . $this->pi_moreParams; |
|
| 239 | + $conf['additionalParams'] = $this->conf['parent.']['addParams'] . HttpUtility::buildQueryString($urlParameters, '&', TRUE) . $this->pi_moreParams; |
|
| 240 | 240 | // Add additional configuration for absolute URLs. |
| 241 | 241 | $conf['forceAbsoluteUrl'] = !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0; |
| 242 | 242 | $conf['forceAbsoluteUrl.']['scheme'] = !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'; |
@@ -274,20 +274,20 @@ discard block |
||
| 274 | 274 | * |
| 275 | 275 | * @return void |
| 276 | 276 | */ |
| 277 | - protected function setCache($cache = true) |
|
| 277 | + protected function setCache($cache = TRUE) |
|
| 278 | 278 | { |
| 279 | 279 | if ($cache) { |
| 280 | 280 | // Set cObject type to "USER" (default). |
| 281 | - $this->pi_USER_INT_obj = false; |
|
| 282 | - $this->pi_checkCHash = true; |
|
| 281 | + $this->pi_USER_INT_obj = FALSE; |
|
| 282 | + $this->pi_checkCHash = TRUE; |
|
| 283 | 283 | if (count($this->piVars)) { |
| 284 | 284 | // Check cHash or disable caching. |
| 285 | 285 | $GLOBALS['TSFE']->reqCHash(); |
| 286 | 286 | } |
| 287 | 287 | } else { |
| 288 | 288 | // Set cObject type to "USER_INT". |
| 289 | - $this->pi_USER_INT_obj = true; |
|
| 290 | - $this->pi_checkCHash = false; |
|
| 289 | + $this->pi_USER_INT_obj = TRUE; |
|
| 290 | + $this->pi_checkCHash = FALSE; |
|
| 291 | 291 | // Plugins are of type "USER" by default, so convert it to "USER_INT". |
| 292 | 292 | $this->cObj->convertToUserIntObject(); |
| 293 | 293 | } |