@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | * @subpackage dlf |
| 23 | 23 | * @access public |
| 24 | 24 | */ |
| 25 | -class FulltextDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 26 | -{ |
|
| 25 | +class FulltextDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 27 | 26 | public $scriptRelPath = 'Classes/Plugin/Tools/FulltextDownloadTool.php'; |
| 28 | 27 | |
| 29 | 28 | /** |
@@ -36,8 +35,7 @@ discard block |
||
| 36 | 35 | * |
| 37 | 36 | * @return string The content that is displayed on the website |
| 38 | 37 | */ |
| 39 | - public function main($content, $conf) |
|
| 40 | - { |
|
| 38 | + public function main($content, $conf) { |
|
| 41 | 39 | $this->init($conf); |
| 42 | 40 | // Merge configuration with conf array of toolbox. |
| 43 | 41 | if (!empty($this->cObj->data['conf'])) { |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | // Load current document. |
| 48 | 48 | $this->loadDocument(); |
| 49 | 49 | if ( |
| 50 | - $this->doc === null |
|
| 50 | + $this->doc === NULL |
|
| 51 | 51 | || $this->doc->numPages < 1 |
| 52 | 52 | || empty($this->conf['fileGrpFulltext']) |
| 53 | 53 | ) { |
@@ -83,9 +83,9 @@ |
||
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | if (!empty($fullTextFile)) { |
| 86 | - $markerArray['###FULLTEXT_DOWNLOAD###'] = '<a href="#" id="tx-dlf-tools-fulltextdownload" title="' . htmlspecialchars($this->pi_getLL('download-current-page', '')) . '">' . htmlspecialchars($this->pi_getLL('download-current-page', '')) . '</a>'; |
|
| 86 | + $markerArray['###FULLTEXT_DOWNLOAD###'] = '<a href="#" id="tx-dlf-tools-fulltextdownload" title="'.htmlspecialchars($this->pi_getLL('download-current-page', '')).'">'.htmlspecialchars($this->pi_getLL('download-current-page', '')).'</a>'; |
|
| 87 | 87 | } else { |
| 88 | - $markerArray['###FULLTEXT_DOWNLOAD###'] = '<span class="no-fulltext">' . htmlspecialchars($this->pi_getLL('fulltext-not-available', '')) . '</span>'; |
|
| 88 | + $markerArray['###FULLTEXT_DOWNLOAD###'] = '<span class="no-fulltext">'.htmlspecialchars($this->pi_getLL('fulltext-not-available', '')).'</span>'; |
|
| 89 | 89 | } |
| 90 | 90 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
| 91 | 91 | return $this->pi_wrapInBaseClass($content); |
@@ -384,9 +384,9 @@ |
||
| 384 | 384 | $query = $solr->service->createCoreAdmin(); |
| 385 | 385 | $action = $query->createUnload(); |
| 386 | 386 | $action->setCore($resArray['core']); |
| 387 | - $action->setDeleteDataDir(true); |
|
| 388 | - $action->setDeleteIndex(true); |
|
| 389 | - $action->setDeleteInstanceDir(true); |
|
| 387 | + $action->setDeleteDataDir(TRUE); |
|
| 388 | + $action->setDeleteIndex(TRUE); |
|
| 389 | + $action->setDeleteInstanceDir(TRUE); |
|
| 390 | 390 | $query->setAction($action); |
| 391 | 391 | try { |
| 392 | 392 | $response = $solr->service->coreAdmin($query); |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | ) { |
| 124 | 124 | // Get current configuration. |
| 125 | 125 | $result = $queryBuilder |
| 126 | - ->select($table . '.is_listed AS is_listed') |
|
| 126 | + ->select($table.'.is_listed AS is_listed') |
|
| 127 | 127 | ->from($table) |
| 128 | 128 | ->where( |
| 129 | - $queryBuilder->expr()->eq($table . '.uid', intval($id)), |
|
| 129 | + $queryBuilder->expr()->eq($table.'.uid', intval($id)), |
|
| 130 | 130 | Helper::whereExpression($table) |
| 131 | 131 | ) |
| 132 | 132 | ->setMaxResults(1) |
@@ -148,10 +148,10 @@ discard block |
||
| 148 | 148 | ) { |
| 149 | 149 | // Get current configuration. |
| 150 | 150 | $result = $queryBuilder |
| 151 | - ->select($table . '.index_autocomplete AS index_autocomplete') |
|
| 151 | + ->select($table.'.index_autocomplete AS index_autocomplete') |
|
| 152 | 152 | ->from($table) |
| 153 | 153 | ->where( |
| 154 | - $queryBuilder->expr()->eq($table . '.uid', intval($id)), |
|
| 154 | + $queryBuilder->expr()->eq($table.'.uid', intval($id)), |
|
| 155 | 155 | Helper::whereExpression($table) |
| 156 | 156 | ) |
| 157 | 157 | ->setMaxResults(1) |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | if ($solr->ready) { |
| 230 | 230 | // Delete Solr document. |
| 231 | 231 | $updateQuery = $solr->service->createUpdate(); |
| 232 | - $updateQuery->addDeleteQuery('uid:' . $id); |
|
| 232 | + $updateQuery->addDeleteQuery('uid:'.$id); |
|
| 233 | 233 | $updateQuery->addCommit(); |
| 234 | 234 | $solr->service->update($updateQuery); |
| 235 | 235 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | if ($doc->ready) { |
| 240 | 240 | Indexer::add($doc, $resArray['core']); |
| 241 | 241 | } else { |
| 242 | - $this->logger->error('Failed to re-index document with UID ' . $id); |
|
| 242 | + $this->logger->error('Failed to re-index document with UID '.$id); |
|
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | if ($solr->ready) { |
| 310 | 310 | // Delete Solr document. |
| 311 | 311 | $updateQuery = $solr->service->createUpdate(); |
| 312 | - $updateQuery->addDeleteQuery('uid:' . $id); |
|
| 312 | + $updateQuery->addDeleteQuery('uid:'.$id); |
|
| 313 | 313 | $updateQuery->addCommit(); |
| 314 | 314 | $solr->service->update($updateQuery); |
| 315 | 315 | if ($command == 'delete') { |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | if ($doc->ready) { |
| 323 | 323 | Indexer::add($doc, $resArray['core']); |
| 324 | 324 | } else { |
| 325 | - $this->logger->error('Failed to re-index document with UID ' . $id); |
|
| 325 | + $this->logger->error('Failed to re-index document with UID '.$id); |
|
| 326 | 326 | } |
| 327 | 327 | break; |
| 328 | 328 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | // Nothing to do here. |
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | - $this->logger->warning('Core ' . $resArray['core'] . ' could not be deleted from Apache Solr'); |
|
| 379 | + $this->logger->warning('Core '.$resArray['core'].' could not be deleted from Apache Solr'); |
|
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | } |
@@ -31,8 +31,7 @@ discard block |
||
| 31 | 31 | * @subpackage dlf |
| 32 | 32 | * @access public |
| 33 | 33 | */ |
| 34 | -class DataHandler implements LoggerAwareInterface |
|
| 35 | -{ |
|
| 34 | +class DataHandler implements LoggerAwareInterface { |
|
| 36 | 35 | use LoggerAwareTrait; |
| 37 | 36 | |
| 38 | 37 | /** |
@@ -47,8 +46,7 @@ discard block |
||
| 47 | 46 | * |
| 48 | 47 | * @return void |
| 49 | 48 | */ |
| 50 | - public function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray) |
|
| 51 | - { |
|
| 49 | + public function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray) { |
|
| 52 | 50 | if ($status == 'new') { |
| 53 | 51 | switch ($table) { |
| 54 | 52 | // Field post-processing for table "tx_dlf_documents". |
@@ -179,8 +177,7 @@ discard block |
||
| 179 | 177 | * |
| 180 | 178 | * @return void |
| 181 | 179 | */ |
| 182 | - public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray) |
|
| 183 | - { |
|
| 180 | + public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray) { |
|
| 184 | 181 | if ($status == 'update') { |
| 185 | 182 | switch ($table) { |
| 186 | 183 | // After database operations for table "tx_dlf_documents". |
@@ -260,8 +257,7 @@ discard block |
||
| 260 | 257 | * |
| 261 | 258 | * @return void |
| 262 | 259 | */ |
| 263 | - public function processCmdmap_postProcess($command, $table, $id) |
|
| 264 | - { |
|
| 260 | + public function processCmdmap_postProcess($command, $table, $id) { |
|
| 265 | 261 | if ( |
| 266 | 262 | in_array($command, ['move', 'delete', 'undelete']) |
| 267 | 263 | && $table == 'tx_dlf_documents' |
@@ -27,16 +27,14 @@ |
||
| 27 | 27 | * @subpackage dlf |
| 28 | 28 | * @access public |
| 29 | 29 | */ |
| 30 | -class SearchInDocument |
|
| 31 | -{ |
|
| 30 | +class SearchInDocument { |
|
| 32 | 31 | /** |
| 33 | 32 | * The main method of the eID script |
| 34 | 33 | * |
| 35 | 34 | * @param ServerRequestInterface $request |
| 36 | 35 | * @return ResponseInterface JSON response of search suggestions |
| 37 | 36 | */ |
| 38 | - public function main(ServerRequestInterface $request) |
|
| 39 | - { |
|
| 37 | + public function main(ServerRequestInterface $request) { |
|
| 40 | 38 | $output = [ |
| 41 | 39 | 'documents' => [], |
| 42 | 40 | 'numFound' => 0 |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | if ($solr->ready) { |
| 59 | 59 | $query = $solr->service->createSelect(); |
| 60 | 60 | $query->setFields([$fields['id'], $fields['uid'], $fields['page']]); |
| 61 | - $query->setQuery($fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . intval($parameters['uid'])); |
|
| 61 | + $query->setQuery($fields['fulltext'].':('.Solr::escapeQuery((string) $parameters['q']).') AND '.$fields['uid'].':'.intval($parameters['uid'])); |
|
| 62 | 62 | $query->setStart($start)->setRows(20); |
| 63 | 63 | $query->addSort($fields['page'], $query::SORT_ASC); |
| 64 | 64 | $hl = $query->getHighlighting(); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | $query->addSort($fields['page'], $query::SORT_ASC); |
| 64 | 64 | $hl = $query->getHighlighting(); |
| 65 | 65 | $hl->setFields([$fields['fulltext']]); |
| 66 | - $hl->setUseFastVectorHighlighter(true); |
|
| 66 | + $hl->setUseFastVectorHighlighter(TRUE); |
|
| 67 | 67 | $results = $solr->service->select($query); |
| 68 | 68 | $output['numFound'] = $results->getNumFound(); |
| 69 | 69 | $highlighting = $results->getHighlighting(); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $uptimeInSeconds = floor($response->getUptime() / 1000); |
| 56 | 56 | $dateTimeFrom = new \DateTime('@0'); |
| 57 | 57 | $dateTimeTo = new \DateTime("@$uptimeInSeconds"); |
| 58 | - $uptime = $dateTimeFrom->diff($dateTimeTo)->format('%a ' . $GLOBALS['LANG']->getLL('flash.days') . ', %H:%I:%S'); |
|
| 58 | + $uptime = $dateTimeFrom->diff($dateTimeTo)->format('%a '.$GLOBALS['LANG']->getLL('flash.days').', %H:%I:%S'); |
|
| 59 | 59 | $numDocuments = $response->getNumberOfDocuments(); |
| 60 | 60 | $startTime = $response->getStartTime() ? strftime('%c', $response->getStartTime()->getTimestamp()) : 'N/A'; |
| 61 | 61 | $lastModified = $response->getLastModified() ? strftime('%c', $response->getLastModified()->getTimestamp()) : 'N/A'; |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | * @subpackage dlf |
| 25 | 25 | * @access public |
| 26 | 26 | */ |
| 27 | -class SolrCoreStatus extends AbstractNode |
|
| 28 | -{ |
|
| 27 | +class SolrCoreStatus extends AbstractNode { |
|
| 29 | 28 | /** |
| 30 | 29 | * Shows Solr core status for given 'index_name' |
| 31 | 30 | * |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class EditInProductionWarning extends AbstractNode |
|
| 27 | -{ |
|
| 26 | +class EditInProductionWarning extends AbstractNode { |
|
| 28 | 27 | /** |
| 29 | 28 | * Generates warning message when editing 'index_name' field |
| 30 | 29 | * |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $label = htmlspecialchars($this->pi_getLL('addBasket', '')); |
| 182 | 182 | $params = [ |
| 183 | 183 | 'id' => $this->piVars['id'], |
| 184 | - 'addToBasket' => true |
|
| 184 | + 'addToBasket' => TRUE |
|
| 185 | 185 | ]; |
| 186 | 186 | if (empty($this->piVars['page'])) { |
| 187 | 187 | $params['page'] = 1; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | 'parameter' => $this->conf['targetBasket'], |
| 191 | 191 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 192 | 192 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 193 | - 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false), |
|
| 193 | + 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', TRUE, FALSE), |
|
| 194 | 194 | 'title' => $label |
| 195 | 195 | ]; |
| 196 | 196 | $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">'; |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | if ($iiif instanceof ManifestInterface) { |
| 305 | 305 | $canvas = $iiif->getContainedResourceById($canvasId); |
| 306 | 306 | /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */ |
| 307 | - if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
| 307 | + if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
| 308 | 308 | $annotationContainers = []; |
| 309 | 309 | /* |
| 310 | 310 | * TODO Analyzing the annotations on the server side requires loading the annotation lists / pages |
@@ -314,11 +314,11 @@ discard block |
||
| 314 | 314 | * On the other hand, server connections are potentially better than client connections. Downloading annotation lists |
| 315 | 315 | */ |
| 316 | 316 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
| 317 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
| 317 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
| 318 | 318 | foreach ($textAnnotations as $annotation) { |
| 319 | 319 | if ( |
| 320 | 320 | $annotation->getBody()->getFormat() == 'text/plain' |
| 321 | - && $annotation->getBody()->getChars() != null |
|
| 321 | + && $annotation->getBody()->getChars() != NULL |
|
| 322 | 322 | ) { |
| 323 | 323 | $annotationListData = []; |
| 324 | 324 | $annotationListData['uri'] = $annotationContainer->getId(); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | // Load current document. |
| 361 | 361 | $this->loadDocument(); |
| 362 | 362 | if ( |
| 363 | - $this->doc === null |
|
| 363 | + $this->doc === NULL |
|
| 364 | 364 | || $this->doc->numPages < 1 |
| 365 | 365 | ) { |
| 366 | 366 | // Quit without doing anything if required variables are not set. |
@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | * @subpackage dlf |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class PageView extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 32 | -{ |
|
| 31 | +class PageView extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 33 | 32 | public $scriptRelPath = 'Classes/Plugin/PageView.php'; |
| 34 | 33 | |
| 35 | 34 | /** |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | * |
| 72 | 71 | * @return void |
| 73 | 72 | */ |
| 74 | - protected function addViewerJS() |
|
| 75 | - { |
|
| 73 | + protected function addViewerJS() { |
|
| 76 | 74 | // Viewer configuration. |
| 77 | 75 | $viewerConfiguration = ' |
| 78 | 76 | $(document).ready(function() { |
@@ -100,8 +98,7 @@ discard block |
||
| 100 | 98 | * |
| 101 | 99 | * @return array Marker array |
| 102 | 100 | */ |
| 103 | - protected function addInteraction() |
|
| 104 | - { |
|
| 101 | + protected function addInteraction() { |
|
| 105 | 102 | $markerArray = []; |
| 106 | 103 | if ($this->piVars['id']) { |
| 107 | 104 | if ($this->conf['crop']) { |
@@ -127,8 +124,7 @@ discard block |
||
| 127 | 124 | * |
| 128 | 125 | * @return array Marker array |
| 129 | 126 | */ |
| 130 | - protected function addBasketForm() |
|
| 131 | - { |
|
| 127 | + protected function addBasketForm() { |
|
| 132 | 128 | $markerArray = []; |
| 133 | 129 | // Add basket button |
| 134 | 130 | if ($this->conf['basketButton'] && $this->conf['targetBasket'] && $this->piVars['id']) { |
@@ -176,8 +172,7 @@ discard block |
||
| 176 | 172 | * |
| 177 | 173 | * @return array URL and MIME type of image file |
| 178 | 174 | */ |
| 179 | - protected function getImage($page) |
|
| 180 | - { |
|
| 175 | + protected function getImage($page) { |
|
| 181 | 176 | $image = []; |
| 182 | 177 | // Get @USE value of METS fileGrp. |
| 183 | 178 | $fileGrpsImages = GeneralUtility::trimExplode(',', $this->conf['fileGrpImages']); |
@@ -213,8 +208,7 @@ discard block |
||
| 213 | 208 | * |
| 214 | 209 | * @return array URL and MIME type of fulltext file |
| 215 | 210 | */ |
| 216 | - protected function getFulltext($page) |
|
| 217 | - { |
|
| 211 | + protected function getFulltext($page) { |
|
| 218 | 212 | $fulltext = []; |
| 219 | 213 | // Get fulltext link. |
| 220 | 214 | $fileGrpsFulltext = GeneralUtility::trimExplode(',', $this->conf['fileGrpFulltext']); |
@@ -250,8 +244,7 @@ discard block |
||
| 250 | 244 | * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as |
| 251 | 245 | * some information about the canvas. |
| 252 | 246 | */ |
| 253 | - protected function getAnnotationContainers($page) |
|
| 254 | - { |
|
| 247 | + protected function getAnnotationContainers($page) { |
|
| 255 | 248 | if ($this->doc instanceof IiifManifest) { |
| 256 | 249 | $canvasId = $this->doc->physicalStructure[$page]; |
| 257 | 250 | $iiif = $this->doc->getIiif(); |
@@ -308,8 +301,7 @@ discard block |
||
| 308 | 301 | * |
| 309 | 302 | * @return string The content that is displayed on the website |
| 310 | 303 | */ |
| 311 | - public function main($content, $conf) |
|
| 312 | - { |
|
| 304 | + public function main($content, $conf) { |
|
| 313 | 305 | $this->init($conf); |
| 314 | 306 | // Load current document. |
| 315 | 307 | $this->loadDocument(); |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | $(document).ready(function() { |
| 79 | 79 | if (dlfUtils.exists(dlfViewer)) { |
| 80 | 80 | tx_dlf_viewer = new dlfViewer({ |
| 81 | - controls: ["' . implode('", "', $this->controls) . '"], |
|
| 82 | - div: "' . $this->conf['elementId'] . '", |
|
| 83 | - images: ' . json_encode($this->images) . ', |
|
| 84 | - fulltexts: ' . json_encode($this->fulltexts) . ', |
|
| 85 | - annotationContainers: ' . json_encode($this->annotationContainers) . ', |
|
| 86 | - useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0) . ' |
|
| 81 | + controls: ["' . implode('", "', $this->controls).'"], |
|
| 82 | + div: "' . $this->conf['elementId'].'", |
|
| 83 | + images: ' . json_encode($this->images).', |
|
| 84 | + fulltexts: ' . json_encode($this->fulltexts).', |
|
| 85 | + annotationContainers: ' . json_encode($this->annotationContainers).', |
|
| 86 | + useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0).' |
|
| 87 | 87 | }); |
| 88 | 88 | } |
| 89 | 89 | }); |
@@ -105,14 +105,14 @@ discard block |
||
| 105 | 105 | $markerArray = []; |
| 106 | 106 | if ($this->piVars['id']) { |
| 107 | 107 | if ($this->conf['crop']) { |
| 108 | - $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . htmlspecialchars($this->pi_getLL('editMode', '')) . '">' . htmlspecialchars($this->pi_getLL('editMode', '')) . '</a>'; |
|
| 109 | - $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '">' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '</a>'; |
|
| 108 | + $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="'.htmlspecialchars($this->pi_getLL('editMode', '')).'">'.htmlspecialchars($this->pi_getLL('editMode', '')).'</a>'; |
|
| 109 | + $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="'.htmlspecialchars($this->pi_getLL('editRemove', '')).'">'.htmlspecialchars($this->pi_getLL('editRemove', '')).'</a>'; |
|
| 110 | 110 | } else { |
| 111 | 111 | $markerArray['###EDITBUTTON###'] = ''; |
| 112 | 112 | $markerArray['###EDITREMOVE###'] = ''; |
| 113 | 113 | } |
| 114 | 114 | if ($this->conf['magnifier']) { |
| 115 | - $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '">' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '</a>'; |
|
| 115 | + $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="'.htmlspecialchars($this->pi_getLL('magnifier', '')).'">'.htmlspecialchars($this->pi_getLL('magnifier', '')).'</a>'; |
|
| 116 | 116 | } else { |
| 117 | 117 | $markerArray['###MAGNIFIER###'] = ''; |
| 118 | 118 | } |
@@ -147,15 +147,15 @@ discard block |
||
| 147 | 147 | 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false), |
| 148 | 148 | 'title' => $label |
| 149 | 149 | ]; |
| 150 | - $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">'; |
|
| 151 | - $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="' . htmlspecialchars($this->piVars['page']) . '">'; |
|
| 152 | - $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="' . htmlspecialchars($this->piVars['page']) . '">'; |
|
| 150 | + $output = '<form id="addToBasketForm" action="'.$this->cObj->typoLink_URL($basketConf).'" method="post">'; |
|
| 151 | + $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="'.htmlspecialchars($this->piVars['page']).'">'; |
|
| 152 | + $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="'.htmlspecialchars($this->piVars['page']).'">'; |
|
| 153 | 153 | $output .= '<input type="hidden" name="tx_dlf[startX]" id="startX">'; |
| 154 | 154 | $output .= '<input type="hidden" name="tx_dlf[startY]" id="startY">'; |
| 155 | 155 | $output .= '<input type="hidden" name="tx_dlf[endX]" id="endX">'; |
| 156 | 156 | $output .= '<input type="hidden" name="tx_dlf[endY]" id="endY">'; |
| 157 | 157 | $output .= '<input type="hidden" name="tx_dlf[rotation]" id="rotation">'; |
| 158 | - $output .= '<button id="submitBasketForm" onclick="this.form.submit()">' . $label . '</button>'; |
|
| 158 | + $output .= '<button id="submitBasketForm" onclick="this.form.submit()">'.$label.'</button>'; |
|
| 159 | 159 | $output .= '</form>'; |
| 160 | 160 | $output .= '<script>'; |
| 161 | 161 | $output .= '$(document).ready(function() { $("#submitBasketForm").click(function() { $("#addToBasketForm").submit(); }); });'; |
@@ -191,18 +191,18 @@ discard block |
||
| 191 | 191 | 'parameter' => $GLOBALS['TSFE']->id, |
| 192 | 192 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 193 | 193 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 194 | - 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($image['url']), |
|
| 194 | + 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($image['url']), |
|
| 195 | 195 | ]; |
| 196 | 196 | $image['url'] = $this->cObj->typoLink_URL($linkConf); |
| 197 | 197 | } |
| 198 | 198 | $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpImages]); |
| 199 | 199 | break; |
| 200 | 200 | } else { |
| 201 | - $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); |
|
| 201 | + $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"'); |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | if (empty($image)) { |
| 205 | - $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->conf['fileGrpImages'] . '"'); |
|
| 205 | + $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->conf['fileGrpImages'].'"'); |
|
| 206 | 206 | } |
| 207 | 207 | return $image; |
| 208 | 208 | } |
@@ -230,18 +230,18 @@ discard block |
||
| 230 | 230 | 'parameter' => $GLOBALS['TSFE']->id, |
| 231 | 231 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 232 | 232 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 233 | - 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($fulltext['url']), |
|
| 233 | + 'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($fulltext['url']), |
|
| 234 | 234 | ]; |
| 235 | 235 | $fulltext['url'] = $this->cObj->typoLink_URL($linkConf); |
| 236 | 236 | } |
| 237 | 237 | $fulltext['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpFulltext]); |
| 238 | 238 | break; |
| 239 | 239 | } else { |
| 240 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"'); |
|
| 240 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"'); |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | if (empty($fulltext)) { |
| 244 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->conf['fileGrpFulltext'] . '"'); |
|
| 244 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->conf['fileGrpFulltext'].'"'); |
|
| 245 | 245 | } |
| 246 | 246 | return $fulltext; |
| 247 | 247 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * @var bool |
| 62 | 62 | * @access protected |
| 63 | 63 | */ |
| 64 | - protected static $fieldsLoaded = false; |
|
| 64 | + protected static $fieldsLoaded = FALSE; |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * List of already processed documents |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $errors = 0; |
| 98 | 98 | // Handle multi-volume documents. |
| 99 | 99 | if ($doc->parentId) { |
| 100 | - $parent = Document::getInstance($doc->parentId, 0, true); |
|
| 100 | + $parent = Document::getInstance($doc->parentId, 0, TRUE); |
|
| 101 | 101 | if ($parent->ready) { |
| 102 | 102 | $errors = self::add($parent, $core); |
| 103 | 103 | } else { |
@@ -155,17 +155,17 @@ discard block |
||
| 155 | 155 | if (!$errors) { |
| 156 | 156 | Helper::addMessage( |
| 157 | 157 | htmlspecialchars(sprintf(Helper::getMessage('flash.documentIndexed'), $resArray['title'], $doc->uid)), |
| 158 | - Helper::getMessage('flash.done', true), |
|
| 158 | + Helper::getMessage('flash.done', TRUE), |
|
| 159 | 159 | FlashMessage::OK, |
| 160 | - true, |
|
| 160 | + TRUE, |
|
| 161 | 161 | 'core.template.flashMessages' |
| 162 | 162 | ); |
| 163 | 163 | } else { |
| 164 | 164 | Helper::addMessage( |
| 165 | 165 | htmlspecialchars(sprintf(Helper::getMessage('flash.documentNotIndexed'), $resArray['title'], $doc->uid)), |
| 166 | - Helper::getMessage('flash.error', true), |
|
| 166 | + Helper::getMessage('flash.error', TRUE), |
|
| 167 | 167 | FlashMessage::ERROR, |
| 168 | - true, |
|
| 168 | + TRUE, |
|
| 169 | 169 | 'core.template.flashMessages' |
| 170 | 170 | ); |
| 171 | 171 | } |
@@ -174,10 +174,10 @@ discard block |
||
| 174 | 174 | } catch (\Exception $e) { |
| 175 | 175 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 176 | 176 | Helper::addMessage( |
| 177 | - Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 178 | - Helper::getMessage('flash.error', true), |
|
| 177 | + Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 178 | + Helper::getMessage('flash.error', TRUE), |
|
| 179 | 179 | FlashMessage::ERROR, |
| 180 | - true, |
|
| 180 | + TRUE, |
|
| 181 | 181 | 'core.template.flashMessages' |
| 182 | 182 | ); |
| 183 | 183 | } |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | } else { |
| 188 | 188 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 189 | 189 | Helper::addMessage( |
| 190 | - Helper::getMessage('flash.solrNoConnection', true), |
|
| 191 | - Helper::getMessage('flash.warning', true), |
|
| 190 | + Helper::getMessage('flash.solrNoConnection', TRUE), |
|
| 191 | + Helper::getMessage('flash.warning', TRUE), |
|
| 192 | 192 | FlashMessage::WARNING, |
| 193 | - true, |
|
| 193 | + TRUE, |
|
| 194 | 194 | 'core.template.flashMessages' |
| 195 | 195 | ); |
| 196 | 196 | } |
@@ -290,10 +290,10 @@ discard block |
||
| 290 | 290 | if ($indexing['index_boost'] > 0.0) { |
| 291 | 291 | self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['index_boost']); |
| 292 | 292 | } else { |
| 293 | - self::$fields['fieldboost'][$indexing['index_name']] = false; |
|
| 293 | + self::$fields['fieldboost'][$indexing['index_name']] = FALSE; |
|
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | - self::$fieldsLoaded = true; |
|
| 296 | + self::$fieldsLoaded = TRUE; |
|
| 297 | 297 | } |
| 298 | 298 | } |
| 299 | 299 | |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | $solrDoc->setField('root', $doc->rootId); |
| 340 | 340 | $solrDoc->setField('sid', $logicalUnit['id']); |
| 341 | 341 | // There can be only one toplevel unit per UID, independently of backend configuration |
| 342 | - $solrDoc->setField('toplevel', $logicalUnit['id'] == $doc->toplevelId ? true : false); |
|
| 342 | + $solrDoc->setField('toplevel', $logicalUnit['id'] == $doc->toplevelId ? TRUE : FALSE); |
|
| 343 | 343 | $solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']); |
| 344 | 344 | $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
| 345 | 345 | $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
@@ -393,10 +393,10 @@ discard block |
||
| 393 | 393 | } catch (\Exception $e) { |
| 394 | 394 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 395 | 395 | Helper::addMessage( |
| 396 | - Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 397 | - Helper::getMessage('flash.error', true), |
|
| 396 | + Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 397 | + Helper::getMessage('flash.error', TRUE), |
|
| 398 | 398 | FlashMessage::ERROR, |
| 399 | - true, |
|
| 399 | + TRUE, |
|
| 400 | 400 | 'core.template.flashMessages' |
| 401 | 401 | ); |
| 402 | 402 | } |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | $solrDoc->setField('partof', $doc->parentId); |
| 455 | 455 | $solrDoc->setField('root', $doc->rootId); |
| 456 | 456 | $solrDoc->setField('sid', $physicalUnit['id']); |
| 457 | - $solrDoc->setField('toplevel', false); |
|
| 457 | + $solrDoc->setField('toplevel', FALSE); |
|
| 458 | 458 | $solrDoc->setField('type', $physicalUnit['type'], self::$fields['fieldboost']['type']); |
| 459 | 459 | $solrDoc->setField('collection', $doc->metadataArray[$doc->toplevelId]['collection']); |
| 460 | 460 | $solrDoc->setField('fulltext', htmlspecialchars($fulltext)); |
@@ -491,10 +491,10 @@ discard block |
||
| 491 | 491 | } catch (\Exception $e) { |
| 492 | 492 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 493 | 493 | Helper::addMessage( |
| 494 | - Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 495 | - Helper::getMessage('flash.error', true), |
|
| 494 | + Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 495 | + Helper::getMessage('flash.error', TRUE), |
|
| 496 | 496 | FlashMessage::ERROR, |
| 497 | - true, |
|
| 497 | + TRUE, |
|
| 498 | 498 | 'core.template.flashMessages' |
| 499 | 499 | ); |
| 500 | 500 | } |
@@ -527,10 +527,10 @@ discard block |
||
| 527 | 527 | self::loadIndexConf($pid); |
| 528 | 528 | } |
| 529 | 529 | } else { |
| 530 | - return false; |
|
| 530 | + return FALSE; |
|
| 531 | 531 | } |
| 532 | 532 | } |
| 533 | - return true; |
|
| 533 | + return TRUE; |
|
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if ($parent->ready) { |
| 106 | 106 | $errors = self::add($parent, $core); |
| 107 | 107 | } else { |
| 108 | - $logger->error('Could not load parent document with UID ' . $doc->parentId); |
|
| 108 | + $logger->error('Could not load parent document with UID '.$doc->parentId); |
|
| 109 | 109 | return 1; |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | self::$processedDocs[] = $doc->uid; |
| 115 | 115 | // Delete old Solr documents. |
| 116 | 116 | $updateQuery = self::$solr->service->createUpdate(); |
| 117 | - $updateQuery->addDeleteQuery('uid:' . $doc->uid); |
|
| 117 | + $updateQuery->addDeleteQuery('uid:'.$doc->uid); |
|
| 118 | 118 | self::$solr->service->update($updateQuery); |
| 119 | 119 | // Index every logical unit as separate Solr document. |
| 120 | 120 | foreach ($doc->tableOfContents as $logicalUnit) { |
@@ -178,14 +178,14 @@ discard block |
||
| 178 | 178 | } catch (\Exception $e) { |
| 179 | 179 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 180 | 180 | Helper::addMessage( |
| 181 | - Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 181 | + Helper::getMessage('flash.solrException', true).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 182 | 182 | Helper::getMessage('flash.error', true), |
| 183 | 183 | FlashMessage::ERROR, |
| 184 | 184 | true, |
| 185 | 185 | 'core.template.flashMessages' |
| 186 | 186 | ); |
| 187 | 187 | } |
| 188 | - $logger->error('Apache Solr threw exception: "' . $e->getMessage() . '"'); |
|
| 188 | + $logger->error('Apache Solr threw exception: "'.$e->getMessage().'"'); |
|
| 189 | 189 | return 1; |
| 190 | 190 | } |
| 191 | 191 | } else { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | // Sanitize input. |
| 221 | 221 | $pid = max(intval($pid), 0); |
| 222 | 222 | if (!$pid) { |
| 223 | - $logger->error('Invalid PID ' . $pid . ' for metadata configuration'); |
|
| 223 | + $logger->error('Invalid PID '.$pid.' for metadata configuration'); |
|
| 224 | 224 | return ''; |
| 225 | 225 | } |
| 226 | 226 | // Load metadata configuration. |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
| 230 | 230 | $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
| 231 | 231 | $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
| 232 | - $index_name .= '_' . $suffix; |
|
| 232 | + $index_name .= '_'.$suffix; |
|
| 233 | 233 | return $index_name; |
| 234 | 234 | } |
| 235 | 235 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | $updateQuery = self::$solr->service->createUpdate(); |
| 331 | 331 | $solrDoc = $updateQuery->createDocument(); |
| 332 | 332 | // Create unique identifier from document's UID and unit's XML ID. |
| 333 | - $solrDoc->setField('id', $doc->uid . $logicalUnit['id']); |
|
| 333 | + $solrDoc->setField('id', $doc->uid.$logicalUnit['id']); |
|
| 334 | 334 | $solrDoc->setField('uid', $doc->uid); |
| 335 | 335 | $solrDoc->setField('pid', $doc->pid); |
| 336 | 336 | if (MathUtility::canBeInterpretedAsInteger($logicalUnit['points'])) { |
@@ -370,11 +370,11 @@ discard block |
||
| 370 | 370 | $solrDoc->setField(self::getIndexFieldName($index_name, $doc->pid), $data, self::$fields['fieldboost'][$index_name]); |
| 371 | 371 | if (in_array($index_name, self::$fields['sortables'])) { |
| 372 | 372 | // Add sortable fields to index. |
| 373 | - $solrDoc->setField($index_name . '_sorting', $metadata[$index_name . '_sorting'][0]); |
|
| 373 | + $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
| 374 | 374 | } |
| 375 | 375 | if (in_array($index_name, self::$fields['facets'])) { |
| 376 | 376 | // Add facets to index. |
| 377 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
| 377 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 378 | 378 | } |
| 379 | 379 | if (in_array($index_name, self::$fields['autocomplete'])) { |
| 380 | 380 | $autocomplete = array_merge($autocomplete, $data); |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | } catch (\Exception $e) { |
| 400 | 400 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 401 | 401 | Helper::addMessage( |
| 402 | - Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 402 | + Helper::getMessage('flash.solrException', true).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 403 | 403 | Helper::getMessage('flash.error', true), |
| 404 | 404 | FlashMessage::ERROR, |
| 405 | 405 | true, |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | $updateQuery = self::$solr->service->createUpdate(); |
| 447 | 447 | $solrDoc = $updateQuery->createDocument(); |
| 448 | 448 | // Create unique identifier from document's UID and unit's XML ID. |
| 449 | - $solrDoc->setField('id', $doc->uid . $physicalUnit['id']); |
|
| 449 | + $solrDoc->setField('id', $doc->uid.$physicalUnit['id']); |
|
| 450 | 450 | $solrDoc->setField('uid', $doc->uid); |
| 451 | 451 | $solrDoc->setField('pid', $doc->pid); |
| 452 | 452 | $solrDoc->setField('page', $page); |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | // Add facets to index. |
| 483 | - $solrDoc->setField($index_name . '_faceting', $data); |
|
| 483 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | } |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | } catch (\Exception $e) { |
| 498 | 498 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
| 499 | 499 | Helper::addMessage( |
| 500 | - Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()), |
|
| 500 | + Helper::getMessage('flash.solrException', true).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 501 | 501 | Helper::getMessage('flash.error', true), |
| 502 | 502 | FlashMessage::ERROR, |
| 503 | 503 | true, |
@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | * @subpackage dlf |
| 30 | 30 | * @access public |
| 31 | 31 | */ |
| 32 | -class Indexer |
|
| 33 | -{ |
|
| 32 | +class Indexer { |
|
| 34 | 33 | /** |
| 35 | 34 | * The extension key |
| 36 | 35 | * |
@@ -91,8 +90,7 @@ discard block |
||
| 91 | 90 | * |
| 92 | 91 | * @return int 0 on success or 1 on failure |
| 93 | 92 | */ |
| 94 | - public static function add(Document &$doc, $core = 0) |
|
| 95 | - { |
|
| 93 | + public static function add(Document &$doc, $core = 0) { |
|
| 96 | 94 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
| 97 | 95 | |
| 98 | 96 | if (in_array($doc->uid, self::$processedDocs)) { |
@@ -213,8 +211,7 @@ discard block |
||
| 213 | 211 | * |
| 214 | 212 | * @return string The field's dynamic index name |
| 215 | 213 | */ |
| 216 | - public static function getIndexFieldName($index_name, $pid = 0) |
|
| 217 | - { |
|
| 214 | + public static function getIndexFieldName($index_name, $pid = 0) { |
|
| 218 | 215 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
| 219 | 216 | |
| 220 | 217 | // Sanitize input. |
@@ -242,8 +239,7 @@ discard block |
||
| 242 | 239 | * |
| 243 | 240 | * @return void |
| 244 | 241 | */ |
| 245 | - protected static function loadIndexConf($pid) |
|
| 246 | - { |
|
| 242 | + protected static function loadIndexConf($pid) { |
|
| 247 | 243 | if (!self::$fieldsLoaded) { |
| 248 | 244 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 249 | 245 | ->getQueryBuilderForTable('tx_dlf_metadata'); |
@@ -313,8 +309,7 @@ discard block |
||
| 313 | 309 | * |
| 314 | 310 | * @return int 0 on success or 1 on failure |
| 315 | 311 | */ |
| 316 | - protected static function processLogical(Document &$doc, array $logicalUnit) |
|
| 317 | - { |
|
| 312 | + protected static function processLogical(Document &$doc, array $logicalUnit) { |
|
| 318 | 313 | $errors = 0; |
| 319 | 314 | // Get metadata for logical unit. |
| 320 | 315 | $metadata = $doc->metadataArray[$logicalUnit['id']]; |
@@ -434,8 +429,7 @@ discard block |
||
| 434 | 429 | * |
| 435 | 430 | * @return int 0 on success or 1 on failure |
| 436 | 431 | */ |
| 437 | - protected static function processPhysical(Document &$doc, $page, array $physicalUnit) |
|
| 438 | - { |
|
| 432 | + protected static function processPhysical(Document &$doc, $page, array $physicalUnit) { |
|
| 439 | 433 | if ( |
| 440 | 434 | $doc->hasFulltext |
| 441 | 435 | && $fulltext = $doc->getRawText($physicalUnit['id']) |
@@ -520,8 +514,7 @@ discard block |
||
| 520 | 514 | * |
| 521 | 515 | * @return bool true on success or false on failure |
| 522 | 516 | */ |
| 523 | - protected static function solrConnect($core, $pid = 0) |
|
| 524 | - { |
|
| 517 | + protected static function solrConnect($core, $pid = 0) { |
|
| 525 | 518 | // Get Solr instance. |
| 526 | 519 | if (!self::$solr) { |
| 527 | 520 | // Connect to Solr server. |
@@ -544,8 +537,7 @@ discard block |
||
| 544 | 537 | * |
| 545 | 538 | * @access private |
| 546 | 539 | */ |
| 547 | - private function __construct() |
|
| 548 | - { |
|
| 540 | + private function __construct() { |
|
| 549 | 541 | // This is a static class, thus no instances should be created. |
| 550 | 542 | } |
| 551 | 543 | } |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | protected function printContent() |
| 101 | 101 | { |
| 102 | 102 | $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class); |
| 103 | - $this->doc->setModuleTemplate('EXT:' . $this->extKey . '/Resources/Private/Templates/' . Helper::getUnqualifiedClassName(get_class($this)) . '.tmpl'); |
|
| 103 | + $this->doc->setModuleTemplate('EXT:'.$this->extKey.'/Resources/Private/Templates/'.Helper::getUnqualifiedClassName(get_class($this)).'.tmpl'); |
|
| 104 | 104 | $this->doc->backPath = $GLOBALS['BACK_PATH']; |
| 105 | - $this->doc->bodyTagAdditions = 'class="ext-' . $this->extKey . '-modules"'; |
|
| 105 | + $this->doc->bodyTagAdditions = 'class="ext-'.$this->extKey.'-modules"'; |
|
| 106 | 106 | $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">'; |
| 107 | 107 | // Add Javascript for function menu. |
| 108 | 108 | $this->doc->JScode .= '<script type="text/javascript">script_ended = 0;function jumpToUrl(URL) { document.location = URL; }</script>'; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); |
| 113 | 113 | // Set defaults for menu. |
| 114 | 114 | if (empty($this->markerArray['CSH'])) { |
| 115 | - $this->markerArray['CSH'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'csh'); |
|
| 115 | + $this->markerArray['CSH'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_'.$GLOBALS['MCONF']['name'], 'csh'); |
|
| 116 | 116 | } |
| 117 | 117 | if (empty($this->markerArray['MOD_MENU'])) { |
| 118 | 118 | $this->markerArray['MOD_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function __construct() |
| 133 | 133 | { |
| 134 | - $GLOBALS['LANG']->includeLLFile('EXT:' . $this->extKey . '/Resources/Private/Language/' . Helper::getUnqualifiedClassName(get_class($this)) . '.xml'); |
|
| 134 | + $GLOBALS['LANG']->includeLLFile('EXT:'.$this->extKey.'/Resources/Private/Language/'.Helper::getUnqualifiedClassName(get_class($this)).'.xml'); |
|
| 135 | 135 | // Read extension configuration. |
| 136 | 136 | if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey])) { |
| 137 | 137 | $this->conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extKey); |
@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | * @access public |
| 25 | 25 | * @abstract |
| 26 | 26 | */ |
| 27 | -abstract class AbstractModule extends \TYPO3\CMS\Backend\Module\BaseScriptClass |
|
| 28 | -{ |
|
| 27 | +abstract class AbstractModule extends \TYPO3\CMS\Backend\Module\BaseScriptClass { |
|
| 29 | 28 | public $extKey = 'dlf'; |
| 30 | 29 | public $prefixId = 'tx_dlf'; |
| 31 | 30 | |
@@ -97,8 +96,7 @@ discard block |
||
| 97 | 96 | * |
| 98 | 97 | * @return string |
| 99 | 98 | */ |
| 100 | - protected function printContent() |
|
| 101 | - { |
|
| 99 | + protected function printContent() { |
|
| 102 | 100 | $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class); |
| 103 | 101 | $this->doc->setModuleTemplate('EXT:' . $this->extKey . '/Resources/Private/Templates/' . Helper::getUnqualifiedClassName(get_class($this)) . '.tmpl'); |
| 104 | 102 | $this->doc->backPath = $GLOBALS['BACK_PATH']; |
@@ -129,8 +127,7 @@ discard block |
||
| 129 | 127 | * |
| 130 | 128 | * @return void |
| 131 | 129 | */ |
| 132 | - public function __construct() |
|
| 133 | - { |
|
| 130 | + public function __construct() { |
|
| 134 | 131 | $GLOBALS['LANG']->includeLLFile('EXT:' . $this->extKey . '/Resources/Private/Language/' . Helper::getUnqualifiedClassName(get_class($this)) . '.xml'); |
| 135 | 132 | // Read extension configuration. |
| 136 | 133 | if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey])) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @var bool |
| 38 | 38 | * @access protected |
| 39 | 39 | */ |
| 40 | - protected $error = false; |
|
| 40 | + protected $error = FALSE; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * This holds the OAI DOM object |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | protected function error($type) |
| 110 | 110 | { |
| 111 | - $this->error = true; |
|
| 111 | + $this->error = TRUE; |
|
| 112 | 112 | $error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type), ENT_NOQUOTES, 'UTF-8')); |
| 113 | 113 | $error->setAttribute('code', $type); |
| 114 | 114 | return $error; |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | protected function getMetsData(array $metadata) |
| 299 | 299 | { |
| 300 | - $mets = null; |
|
| 300 | + $mets = NULL; |
|
| 301 | 301 | // Load METS file. |
| 302 | 302 | $xml = new \DOMDocument(); |
| 303 | 303 | if ($xml->load($metadata['location'])) { |
@@ -305,14 +305,14 @@ discard block |
||
| 305 | 305 | $root = $xml->getElementsByTagNameNS($this->formats['mets']['namespace'], 'mets'); |
| 306 | 306 | if ($root->item(0) instanceof \DOMNode) { |
| 307 | 307 | // Import node into \DOMDocument. |
| 308 | - $mets = $this->oai->importNode($root->item(0), true); |
|
| 308 | + $mets = $this->oai->importNode($root->item(0), TRUE); |
|
| 309 | 309 | } else { |
| 310 | 310 | $this->logger->error('No METS part found in document with location "' . $metadata['location'] . '"'); |
| 311 | 311 | } |
| 312 | 312 | } else { |
| 313 | 313 | $this->logger->error('Could not load XML file from "' . $metadata['location'] . '"'); |
| 314 | 314 | } |
| 315 | - if ($mets === null) { |
|
| 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')); |
| 317 | 317 | } |
| 318 | 318 | return $mets; |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | // Initialize plugin. |
| 334 | 334 | $this->init($conf); |
| 335 | 335 | // Turn cache off. |
| 336 | - $this->setCache(false); |
|
| 336 | + $this->setCache(FALSE); |
|
| 337 | 337 | // Get GET and POST variables. |
| 338 | 338 | $this->getUrlParams(); |
| 339 | 339 | // Delete expired resumption tokens. |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet) |
| 1063 | 1063 | { |
| 1064 | 1064 | if ($documentListSet->count() !== 0) { |
| 1065 | - $token = uniqid('', false); |
|
| 1065 | + $token = uniqid('', FALSE); |
|
| 1066 | 1066 | |
| 1067 | 1067 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_dlf_tokens'); |
| 1068 | 1068 | $affectedRows = $queryBuilder |
@@ -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 | |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc'); |
| 160 | 160 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/'); |
| 161 | 161 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
| 162 | - $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'] . ' ' . $this->formats['oai_dc']['schema']); |
|
| 162 | + $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'].' '.$this->formats['oai_dc']['schema']); |
|
| 163 | 163 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['record_id'], ENT_NOQUOTES, 'UTF-8'))); |
| 164 | 164 | if (!empty($metadata['purl'])) { |
| 165 | 165 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['purl'], ENT_NOQUOTES, 'UTF-8'))); |
| 166 | 166 | } |
| 167 | 167 | if (!empty($metadata['prod_id'])) { |
| 168 | - $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'))); |
|
| 168 | + $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'))); |
|
| 169 | 169 | } |
| 170 | 170 | if (!empty($metadata['urn'])) { |
| 171 | 171 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['urn'], ENT_NOQUOTES, 'UTF-8'))); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | } |
| 263 | 263 | // Add attributes and build XML tree. |
| 264 | 264 | $epicur->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
| 265 | - $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'] . ' ' . $this->formats['epicur']['schema']); |
|
| 265 | + $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'].' '.$this->formats['epicur']['schema']); |
|
| 266 | 266 | // Do we update an URN or register a new one? |
| 267 | 267 | if ($metadata['tstamp'] == $metadata['crdate']) { |
| 268 | 268 | $update->setAttribute('type', 'urn_new'); |
@@ -309,10 +309,10 @@ discard block |
||
| 309 | 309 | // Import node into \DOMDocument. |
| 310 | 310 | $mets = $this->oai->importNode($root->item(0), true); |
| 311 | 311 | } else { |
| 312 | - $this->logger->error('No METS part found in document with location "' . $metadata['location'] . '"'); |
|
| 312 | + $this->logger->error('No METS part found in document with location "'.$metadata['location'].'"'); |
|
| 313 | 313 | } |
| 314 | 314 | } else { |
| 315 | - $this->logger->error('Could not load XML file from "' . $metadata['location'] . '"'); |
|
| 315 | + $this->logger->error('Could not load XML file from "'.$metadata['location'].'"'); |
|
| 316 | 316 | } |
| 317 | 317 | if ($mets === null) { |
| 318 | 318 | $mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!'), ENT_NOQUOTES, 'UTF-8')); |
@@ -348,15 +348,15 @@ discard block |
||
| 348 | 348 | if (strpos($this->conf['stylesheet'], 'EXT:') === 0) { |
| 349 | 349 | [$extKey, $filePath] = explode('/', substr($this->conf['stylesheet'], 4), 2); |
| 350 | 350 | if (ExtensionManagementUtility::isLoaded($extKey)) { |
| 351 | - $this->conf['stylesheet'] = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($extKey)) . $filePath; |
|
| 351 | + $this->conf['stylesheet'] = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($extKey)).$filePath; |
|
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | $stylesheet = GeneralUtility::locationHeaderUrl($this->conf['stylesheet']); |
| 355 | 355 | } else { |
| 356 | 356 | // Use default stylesheet if no custom stylesheet is given. |
| 357 | - $stylesheet = GeneralUtility::locationHeaderUrl(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Stylesheets/OaiPmh.xsl'); |
|
| 357 | + $stylesheet = GeneralUtility::locationHeaderUrl(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Stylesheets/OaiPmh.xsl'); |
|
| 358 | 358 | } |
| 359 | - $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="' . htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8') . '"')); |
|
| 359 | + $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="'.htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8').'"')); |
|
| 360 | 360 | // Create root element. |
| 361 | 361 | $root = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'OAI-PMH'); |
| 362 | 362 | $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
@@ -407,10 +407,10 @@ discard block |
||
| 407 | 407 | // Send headers. |
| 408 | 408 | header('HTTP/1.1 200 OK'); |
| 409 | 409 | header('Cache-Control: no-cache'); |
| 410 | - header('Content-Length: ' . strlen($content)); |
|
| 410 | + header('Content-Length: '.strlen($content)); |
|
| 411 | 411 | header('Content-Type: text/xml; charset=utf-8'); |
| 412 | - header('Date: ' . date('r', $GLOBALS['EXEC_TIME'])); |
|
| 413 | - header('Expires: ' . date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
|
| 412 | + header('Date: '.date('r', $GLOBALS['EXEC_TIME'])); |
|
| 413 | + header('Expires: '.date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
|
| 414 | 414 | echo $content; |
| 415 | 415 | exit; |
| 416 | 416 | } |
@@ -471,16 +471,16 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_dlf_documents'); |
| 473 | 473 | |
| 474 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 475 | - 'FROM `tx_dlf_documents` ' . |
|
| 476 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 477 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 478 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
| 479 | - 'AND `tx_dlf_documents`.`pid` = ? ' . |
|
| 480 | - 'AND `tx_dlf_collections`.`pid` = ? ' . |
|
| 481 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 482 | - $where . |
|
| 483 | - 'AND ' . Helper::whereExpression('tx_dlf_collections'); |
|
| 474 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 475 | + 'FROM `tx_dlf_documents` '. |
|
| 476 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 477 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 478 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
| 479 | + 'AND `tx_dlf_documents`.`pid` = ? '. |
|
| 480 | + 'AND `tx_dlf_collections`.`pid` = ? '. |
|
| 481 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 482 | + $where. |
|
| 483 | + 'AND '.Helper::whereExpression('tx_dlf_collections'); |
|
| 484 | 484 | |
| 485 | 485 | $values = [ |
| 486 | 486 | $this->piVars['identifier'], |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | $timestamp = $resArray['tstamp']; |
| 608 | 608 | $earliestDatestamp = gmdate('Y-m-d\TH:i:s\Z', $timestamp); |
| 609 | 609 | } else { |
| 610 | - $this->logger->notice('No records found with PID ' . $this->conf['pages']); |
|
| 610 | + $this->logger->notice('No records found with PID '.$this->conf['pages']); |
|
| 611 | 611 | } |
| 612 | 612 | $linkConf = [ |
| 613 | 613 | 'parameter' => $GLOBALS['TSFE']->id, |
@@ -868,9 +868,9 @@ discard block |
||
| 868 | 868 | } |
| 869 | 869 | $resArray = $allResults[0]; |
| 870 | 870 | if ($resArray['index_query'] != "") { |
| 871 | - $solr_query .= '(' . $resArray['index_query'] . ')'; |
|
| 871 | + $solr_query .= '('.$resArray['index_query'].')'; |
|
| 872 | 872 | } else { |
| 873 | - $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"'; |
|
| 873 | + $solr_query .= 'collection:'.'"'.$resArray['index_name'].'"'; |
|
| 874 | 874 | } |
| 875 | 875 | } else { |
| 876 | 876 | // If no set is specified we have to query for all collections |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | } |
| 879 | 879 | // Check for required fields. |
| 880 | 880 | foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) { |
| 881 | - $solr_query .= ' NOT ' . $required . ':""'; |
|
| 881 | + $solr_query .= ' NOT '.$required.':""'; |
|
| 882 | 882 | } |
| 883 | 883 | // toplevel="true" is always required |
| 884 | 884 | $solr_query .= ' AND toplevel:true'; |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | || is_array($date_array = strptime($this->piVars['from'], '%Y-%m-%d')) |
| 892 | 892 | ) { |
| 893 | 893 | $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); |
| 894 | - $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.000Z'; |
|
| 894 | + $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z'; |
|
| 895 | 895 | } else { |
| 896 | 896 | throw new \Exception('badArgument'); |
| 897 | 897 | } |
@@ -905,7 +905,7 @@ discard block |
||
| 905 | 905 | || is_array($date_array = strptime($this->piVars['until'], '%Y-%m-%d')) |
| 906 | 906 | ) { |
| 907 | 907 | $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); |
| 908 | - $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z'; |
|
| 908 | + $until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z'; |
|
| 909 | 909 | if ($from != "*" && $from > $until) { |
| 910 | 910 | throw new \Exception('badArgument'); |
| 911 | 911 | } |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | throw new \Exception('badArgument'); |
| 923 | 923 | } |
| 924 | 924 | } |
| 925 | - $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until . ']'; |
|
| 925 | + $solr_query .= ' AND timestamp:['.$from.' TO '.$until.']'; |
|
| 926 | 926 | $documentSet = []; |
| 927 | 927 | $solr = Solr::getInstance($this->conf['solrcore']); |
| 928 | 928 | if (!$solr->ready) { |
@@ -965,16 +965,16 @@ discard block |
||
| 965 | 965 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 966 | 966 | ->getConnectionForTable('tx_dlf_documents'); |
| 967 | 967 | |
| 968 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 969 | - 'FROM `tx_dlf_documents` ' . |
|
| 970 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 971 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 972 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
| 973 | - 'AND `tx_dlf_documents`.`pid` = ? ' . |
|
| 974 | - 'AND `tx_dlf_collections`.`pid` = ? ' . |
|
| 975 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 976 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
| 977 | - 'GROUP BY `tx_dlf_documents`.`uid` ' . |
|
| 968 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 969 | + 'FROM `tx_dlf_documents` '. |
|
| 970 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 971 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 972 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
| 973 | + 'AND `tx_dlf_documents`.`pid` = ? '. |
|
| 974 | + 'AND `tx_dlf_collections`.`pid` = ? '. |
|
| 975 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 976 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
| 977 | + 'GROUP BY `tx_dlf_documents`.`uid` '. |
|
| 978 | 978 | 'LIMIT ?'; |
| 979 | 979 | |
| 980 | 980 | $values = [ |