@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
| 74 | 74 | |
| 75 | - $collection = null; |
|
| 75 | + $collection = NULL; |
|
| 76 | 76 | if ($this->searchParams['collection'] && MathUtility::canBeInterpretedAsInteger($this->searchParams['collection'])) { |
| 77 | 77 | $collection = $this->collectionRepository->findByUid($this->searchParams['collection']); |
| 78 | 78 | } |
@@ -83,15 +83,15 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // get all sortable metadata records |
| 86 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
| 86 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
| 87 | 87 | |
| 88 | 88 | // get all metadata records to be shown in results |
| 89 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
| 89 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
| 90 | 90 | |
| 91 | 91 | $solrResults = []; |
| 92 | 92 | $numResults = 0; |
| 93 | 93 | if (is_array($this->searchParams) && !empty($this->searchParams)) { |
| 94 | - $solrResults = $this->documentRepository->findSolrByCollection($collection ? : null, $this->settings, $this->searchParams, $listedMetadata); |
|
| 94 | + $solrResults = $this->documentRepository->findSolrByCollection($collection ? : NULL, $this->settings, $this->searchParams, $listedMetadata); |
|
| 95 | 95 | $numResults = $solrResults->getNumFound(); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | // Load current document. |
| 36 | 36 | $this->loadDocument($this->requestData); |
| 37 | 37 | if ( |
| 38 | - $this->document === null |
|
| 39 | - || $this->document->getDoc() === null |
|
| 38 | + $this->document === NULL |
|
| 39 | + || $this->document->getDoc() === NULL |
|
| 40 | 40 | ) { |
| 41 | 41 | // Quit without doing anything if required variables are not set. |
| 42 | 42 | return ''; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | // prepare feature array for fluid |
| 82 | 82 | $features = []; |
| 83 | 83 | foreach (explode(',', $this->settings['features']) as $feature) { |
| 84 | - $features[$feature] = true; |
|
| 84 | + $features[$feature] = TRUE; |
|
| 85 | 85 | } |
| 86 | 86 | $this->view->assign('features', $features); |
| 87 | 87 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return array HMENU array for menu entry |
| 46 | 46 | */ |
| 47 | - protected function getMenuEntry(array $entry, $recursive = false) |
|
| 47 | + protected function getMenuEntry(array $entry, $recursive = FALSE) |
|
| 48 | 48 | { |
| 49 | 49 | $entry = $this->resolveMenuEntry($entry); |
| 50 | 50 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | // Build sub-menu if available and called recursively. |
| 104 | 104 | if ( |
| 105 | - $recursive === true |
|
| 105 | + $recursive === TRUE |
|
| 106 | 106 | && !empty($entry['children']) |
| 107 | 107 | ) { |
| 108 | 108 | // Build sub-menu only if one of the following conditions apply: |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | if (in_array($child['id'], $this->activeEntries)) { |
| 121 | 121 | $entryArray['ITEM_STATE'] = 'ACT'; |
| 122 | 122 | } |
| 123 | - $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true); |
|
| 123 | + $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE); |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries. |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | // Load current document. |
| 178 | 178 | $this->loadDocument($this->requestData); |
| 179 | 179 | if ( |
| 180 | - $this->document === null |
|
| 181 | - || $this->document->getDoc() === null |
|
| 180 | + $this->document === NULL |
|
| 181 | + || $this->document->getDoc() === NULL |
|
| 182 | 182 | ) { |
| 183 | 183 | // Quit without doing anything if required variables are not set. |
| 184 | 184 | return []; |
@@ -225,12 +225,12 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | // Go through table of contents and create all menu entries. |
| 227 | 227 | foreach ($this->document->getDoc()->tableOfContents as $entry) { |
| 228 | - $menuArray[] = $this->getMenuEntry($entry, true); |
|
| 228 | + $menuArray[] = $this->getMenuEntry($entry, TRUE); |
|
| 229 | 229 | } |
| 230 | 230 | } else { |
| 231 | 231 | // Go through table of contents and create top-level menu entries. |
| 232 | 232 | foreach ($this->document->getDoc()->tableOfContents as $entry) { |
| 233 | - $menuArray[] = $this->getMenuEntry($entry, false); |
|
| 233 | + $menuArray[] = $this->getMenuEntry($entry, FALSE); |
|
| 234 | 234 | } |
| 235 | 235 | // Build table of contents from database. |
| 236 | 236 | $result = $this->documentRepository->getTableOfContentsFromDb($this->document->getUid(), $this->document->getPid(), $this->settings); |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | 'pagination' => '', |
| 250 | 250 | 'targetUid' => $resArray['uid'] |
| 251 | 251 | ]; |
| 252 | - $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false); |
|
| 252 | + $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE); |
|
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // Load current document. |
| 65 | 65 | $this->loadDocument($this->requestData); |
| 66 | - if ($this->document === null) { |
|
| 66 | + if ($this->document === NULL) { |
|
| 67 | 67 | // Quit without doing anything if required variables are not set. |
| 68 | 68 | return ''; |
| 69 | 69 | } |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | switch ($type) { |
| 79 | 79 | case 'newspaper': |
| 80 | 80 | case 'ephemera': |
| 81 | - $this->forward('years', null, null, $this->requestData); |
|
| 81 | + $this->forward('years', NULL, NULL, $this->requestData); |
|
| 82 | 82 | break; |
| 83 | 83 | case 'year': |
| 84 | - $this->forward('calendar', null, null, $this->requestData); |
|
| 84 | + $this->forward('calendar', NULL, NULL, $this->requestData); |
|
| 85 | 85 | break; |
| 86 | 86 | case 'issue': |
| 87 | 87 | default: |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | // Load current document. |
| 112 | 112 | $this->loadDocument($this->requestData); |
| 113 | - if ($this->document === null) { |
|
| 113 | + if ($this->document === NULL) { |
|
| 114 | 114 | // Quit without doing anything if required variables are not set. |
| 115 | 115 | return ''; |
| 116 | 116 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $title = $document->getTitle(); |
| 128 | 128 | } else { |
| 129 | 129 | $title = !empty($document->getMetsLabel()) ? $document->getMetsLabel() : $document->getMetsOrderlabel(); |
| 130 | - if (strtotime($title) !== false) { |
|
| 130 | + if (strtotime($title) !== FALSE) { |
|
| 131 | 131 | $title = strftime('%x', strtotime($title)); |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $calendarIssuesByYear = []; |
| 143 | 143 | foreach ($issues as $issue) { |
| 144 | 144 | $dateTimestamp = strtotime($issue['year']); |
| 145 | - if ($dateTimestamp !== false) { |
|
| 145 | + if ($dateTimestamp !== FALSE) { |
|
| 146 | 146 | $_year = date('Y', $dateTimestamp); |
| 147 | 147 | $_month = date('n', $dateTimestamp); |
| 148 | 148 | $_day = date('j', $dateTimestamp); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | // Load current document. |
| 218 | 218 | $this->loadDocument($this->requestData); |
| 219 | - if ($this->document === null) { |
|
| 219 | + if ($this->document === NULL) { |
|
| 220 | 220 | // Quit without doing anything if required variables are not set. |
| 221 | 221 | return ''; |
| 222 | 222 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | if (count($collections) == 1 && empty($this->settings['dont_show_single']) && is_array($collections)) { |
| 90 | - $this->forward('show', null, null, ['collection' => array_pop($collections)]); |
|
| 90 | + $this->forward('show', NULL, NULL, ['collection' => array_pop($collections)]); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $processedCollections = []; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $searchParams['collection'] = $collection; |
| 167 | 167 | // If a targetPid is given, the results will be shown by ListView on the target page. |
| 168 | 168 | if (!empty($this->settings['targetPid'])) { |
| 169 | - $this->redirect('main', 'ListView', null, |
|
| 169 | + $this->redirect('main', 'ListView', NULL, |
|
| 170 | 170 | [ |
| 171 | 171 | 'searchParameter' => $searchParams, |
| 172 | 172 | 'widgetPage' => $widgetPage |
@@ -175,10 +175,10 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | // get all metadata records to be shown in results |
| 178 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
| 178 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
| 179 | 179 | |
| 180 | 180 | // get all sortable metadata records |
| 181 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
| 181 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
| 182 | 182 | |
| 183 | 183 | // get all documents of given collection |
| 184 | 184 | $solrResults = $this->documentRepository->findSolrByCollection($collection, $this->settings, $searchParams, $listedMetadata); |
@@ -204,13 +204,13 @@ discard block |
||
| 204 | 204 | // if search was triggered, get search parameters from POST variables |
| 205 | 205 | $searchParams = $this->getParametersSafely('searchParameter'); |
| 206 | 206 | |
| 207 | - $collection = null; |
|
| 207 | + $collection = NULL; |
|
| 208 | 208 | if ($searchParams['collection']['__identity'] && MathUtility::canBeInterpretedAsInteger($searchParams['collection']['__identity'])) { |
| 209 | 209 | $collection = $this->collectionRepository->findByUid($searchParams['collection']['__identity']); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | // output is done by show action |
| 213 | - $this->forward('show', null, null, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
| 213 | + $this->forward('show', NULL, NULL, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
| 214 | 214 | |
| 215 | 215 | } |
| 216 | 216 | } |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | // Load current document. |
| 33 | 33 | $this->loadDocument($this->requestData); |
| 34 | 34 | if ( |
| 35 | - $this->document === null |
|
| 36 | - || $this->document->getDoc() === null |
|
| 35 | + $this->document === NULL |
|
| 36 | + || $this->document->getDoc() === NULL |
|
| 37 | 37 | || $this->document->getDoc()->metadataArray['LOG_0001']['type'][0] != 'object' |
| 38 | 38 | ) { |
| 39 | 39 | // Quit without doing anything if required variables are not set. |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
| 78 | 78 | |
| 79 | 79 | // output is done by main action |
| 80 | - $this->forward('main', null, null, ['searchParameter' => $this->searchParams]); |
|
| 80 | + $this->forward('main', NULL, NULL, ['searchParameter' => $this->searchParams]); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function mainAction() |
| 91 | 91 | { |
| 92 | - $listViewSearch = false; |
|
| 92 | + $listViewSearch = FALSE; |
|
| 93 | 93 | // Quit without doing anything if required variables are not set. |
| 94 | 94 | if (empty($this->settings['solrcore'])) { |
| 95 | 95 | $this->logger->warning('Incomplete plugin configuration'); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
| 105 | 105 | $this->searchParams = array_merge($this->searchParams ? : [], $listRequestData['searchParameter']); |
| 106 | - $listViewSearch = true; |
|
| 106 | + $listViewSearch = TRUE; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // Pagination of Results: Pass the currentPage to the fluid template to calculate current index of search result. |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | // If a targetPid is given, the results will be shown by ListView on the target page. |
| 116 | 116 | if (!empty($this->settings['targetPid']) && !empty($this->searchParams) && !$listViewSearch) { |
| 117 | - $this->redirect('main', 'ListView', null, |
|
| 117 | + $this->redirect('main', 'ListView', NULL, |
|
| 118 | 118 | [ |
| 119 | 119 | 'searchParameter' => $this->searchParams, |
| 120 | 120 | 'widgetPage' => $widgetPage |
@@ -125,16 +125,16 @@ discard block |
||
| 125 | 125 | // If no search has been executed, no variables habe to be prepared. An empty form will be shown. |
| 126 | 126 | if (is_array($this->searchParams) && !empty($this->searchParams)) { |
| 127 | 127 | // get all sortable metadata records |
| 128 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
| 128 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
| 129 | 129 | |
| 130 | 130 | // get all metadata records to be shown in results |
| 131 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
| 131 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
| 132 | 132 | |
| 133 | 133 | $solrResults = []; |
| 134 | 134 | $numResults = 0; |
| 135 | 135 | // Do not execute the Solr search if used together with ListView plugin. |
| 136 | 136 | if (!$listViewSearch) { |
| 137 | - $solrResults = $this->documentRepository->findSolrByCollection(null, $this->settings, $this->searchParams, $listedMetadata); |
|
| 137 | + $solrResults = $this->documentRepository->findSolrByCollection(NULL, $this->settings, $this->searchParams, $listedMetadata); |
|
| 138 | 138 | $numResults = $solrResults->getNumFound(); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | // Get facets from plugin configuration. |
| 185 | 185 | $facets = []; |
| 186 | - foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
|
| 186 | + foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], TRUE) as $facet) { |
|
| 187 | 187 | $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | // Check if facet is already selected. |
| 385 | 385 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
| 386 | 386 | $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
| 387 | - if ($index !== false) { |
|
| 387 | + if ($index !== FALSE) { |
|
| 388 | 388 | // Facet is selected, thus remove it from filter. |
| 389 | 389 | unset($queryColumn[$index]); |
| 390 | 390 | $queryColumn = array_values($queryColumn); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | $state = 'ACTIFSUB'; |
| 393 | 393 | // Reset facets |
| 394 | 394 | if ($this->settings['resetFacets']) { |
| 395 | - $entryArray['resetFacet'] = true; |
|
| 395 | + $entryArray['resetFacet'] = TRUE; |
|
| 396 | 396 | $entryArray['queryColumn'] = $queryColumn; |
| 397 | 397 | } |
| 398 | 398 | } else { |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | // Get field selector options. |
| 426 | - $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], true); |
|
| 426 | + $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], TRUE); |
|
| 427 | 427 | |
| 428 | 428 | $slotCountArray = []; |
| 429 | 429 | for ($i = 0; $i < $this->settings['extendedSlotCount']; $i++) { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @var bool |
| 96 | 96 | * @access protected |
| 97 | 97 | */ |
| 98 | - protected $mdSecLoaded = false; |
|
| 98 | + protected $mdSecLoaded = FALSE; |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * Subset of $mdSec storing only the dmdSec entries; kept for compatibility. |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @var bool |
| 130 | 130 | * @access protected |
| 131 | 131 | */ |
| 132 | - protected $fileGrpsLoaded = false; |
|
| 132 | + protected $fileGrpsLoaded = FALSE; |
|
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | 135 | * Additional information about files (e.g., ADMID), indexed by ID. |
@@ -223,11 +223,11 @@ discard block |
||
| 223 | 223 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
| 224 | 224 | IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']); |
| 225 | 225 | $service = IiifHelper::loadIiifResource($fileLocation); |
| 226 | - if ($service !== null && $service instanceof AbstractImageService) { |
|
| 226 | + if ($service !== NULL && $service instanceof AbstractImageService) { |
|
| 227 | 227 | return $service->getImageUrl(); |
| 228 | 228 | } |
| 229 | 229 | } elseif ($fileMimeType === 'application/vnd.netfpx') { |
| 230 | - $baseURL = $fileLocation . (strpos($fileLocation, '?') === false ? '?' : ''); |
|
| 230 | + $baseURL = $fileLocation . (strpos($fileLocation, '?') === FALSE ? '?' : ''); |
|
| 231 | 231 | // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' |
| 232 | 232 | return $baseURL . '&CVT=jpeg'; |
| 233 | 233 | } |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | * {@inheritDoc} |
| 275 | 275 | * @see \Kitodo\Dlf\Common\Doc::getLogicalStructure() |
| 276 | 276 | */ |
| 277 | - public function getLogicalStructure($id, $recursive = false) |
|
| 277 | + public function getLogicalStructure($id, $recursive = FALSE) |
|
| 278 | 278 | { |
| 279 | 279 | $details = []; |
| 280 | 280 | // Is the requested logical unit already loaded? |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | * |
| 316 | 316 | * @return array Array of the element's id, label, type and physical page indexes/mptr link |
| 317 | 317 | */ |
| 318 | - protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = false) |
|
| 318 | + protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = FALSE) |
|
| 319 | 319 | { |
| 320 | 320 | // Get attributes. |
| 321 | 321 | foreach ($structure->attributes() as $attribute => $value) { |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | && array_key_exists($details['id'], $this->smLinks['l2p']) |
| 362 | 362 | ) { |
| 363 | 363 | // Link logical structure to the first corresponding physical page/track. |
| 364 | - $details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, true)), 1); |
|
| 364 | + $details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, TRUE)), 1); |
|
| 365 | 365 | $fileGrpsThumb = GeneralUtility::trimExplode(',', $extConf['fileGrpThumbs']); |
| 366 | 366 | while ($fileGrpThumb = array_shift($fileGrpsThumb)) { |
| 367 | 367 | if (!empty($this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$fileGrpThumb])) { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | $details['children'] = []; |
| 406 | 406 | foreach ($structure->children('http://www.loc.gov/METS/')->div as $child) { |
| 407 | 407 | // Repeat for all children. |
| 408 | - $details['children'][] = $this->getLogicalStructureInfo($child, true); |
|
| 408 | + $details['children'][] = $this->getLogicalStructureInfo($child, TRUE); |
|
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | return $details; |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | } |
| 635 | 635 | } |
| 636 | 636 | |
| 637 | - $hasMetadataSection[$mdSectionType] = true; |
|
| 637 | + $hasMetadataSection[$mdSectionType] = TRUE; |
|
| 638 | 638 | } |
| 639 | 639 | // Set title to empty string if not present. |
| 640 | 640 | if (empty($metadata['title'][0])) { |
@@ -765,16 +765,16 @@ discard block |
||
| 765 | 765 | protected function loadLocation($location) |
| 766 | 766 | { |
| 767 | 767 | $fileResource = Helper::getUrl($location); |
| 768 | - if ($fileResource !== false) { |
|
| 768 | + if ($fileResource !== FALSE) { |
|
| 769 | 769 | $xml = Helper::getXmlFileAsString($fileResource); |
| 770 | 770 | // Set some basic properties. |
| 771 | - if ($xml !== false) { |
|
| 771 | + if ($xml !== FALSE) { |
|
| 772 | 772 | $this->xml = $xml; |
| 773 | - return true; |
|
| 773 | + return TRUE; |
|
| 774 | 774 | } |
| 775 | 775 | } |
| 776 | 776 | $this->logger->error('Could not load XML file from "' . $location . '"'); |
| 777 | - return false; |
|
| 777 | + return FALSE; |
|
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | /** |
@@ -798,9 +798,9 @@ discard block |
||
| 798 | 798 | |
| 799 | 799 | if ($preloadedDocument instanceof \SimpleXMLElement) { |
| 800 | 800 | $this->xml = $preloadedDocument; |
| 801 | - return true; |
|
| 801 | + return TRUE; |
|
| 802 | 802 | } |
| 803 | - return false; |
|
| 803 | + return FALSE; |
|
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | /** |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | foreach ($this->mets->xpath('./mets:dmdSec') as $dmdSecTag) { |
| 828 | 828 | $dmdSec = $this->processMdSec($dmdSecTag); |
| 829 | 829 | |
| 830 | - if ($dmdSec !== null) { |
|
| 830 | + if ($dmdSec !== NULL) { |
|
| 831 | 831 | $this->mdSec[$dmdSec['id']] = $dmdSec; |
| 832 | 832 | $this->dmdSec[$dmdSec['id']] = $dmdSec; |
| 833 | 833 | } |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | // TODO: Should we check that the format may occur within this type (e.g., to ignore VIDEOMD within rightsMD)? |
| 845 | 845 | $mdSec = $this->processMdSec($mdSecTag); |
| 846 | 846 | |
| 847 | - if ($mdSec !== null) { |
|
| 847 | + if ($mdSec !== NULL) { |
|
| 848 | 848 | $this->mdSec[$mdSec['id']] = $mdSec; |
| 849 | 849 | |
| 850 | 850 | $childIds[] = $mdSec['id']; |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | } |
| 858 | 858 | } |
| 859 | 859 | |
| 860 | - $this->mdSecLoaded = true; |
|
| 860 | + $this->mdSecLoaded = TRUE; |
|
| 861 | 861 | } |
| 862 | 862 | return $this->mdSec; |
| 863 | 863 | } |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | { |
| 882 | 882 | $mdId = (string) $element->attributes()->ID; |
| 883 | 883 | if (empty($mdId)) { |
| 884 | - return null; |
|
| 884 | + return NULL; |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | $this->registerNamespaces($element); |
@@ -898,7 +898,7 @@ discard block |
||
| 898 | 898 | } |
| 899 | 899 | |
| 900 | 900 | if (empty($xml)) { |
| 901 | - return null; |
|
| 901 | + return NULL; |
|
| 902 | 902 | } |
| 903 | 903 | |
| 904 | 904 | $this->registerNamespaces($xml[0]); |
@@ -959,9 +959,9 @@ discard block |
||
| 959 | 959 | !empty($extConf['fileGrpFulltext']) |
| 960 | 960 | && array_intersect(GeneralUtility::trimExplode(',', $extConf['fileGrpFulltext']), $this->fileGrps) !== [] |
| 961 | 961 | ) { |
| 962 | - $this->hasFulltext = true; |
|
| 962 | + $this->hasFulltext = TRUE; |
|
| 963 | 963 | } |
| 964 | - $this->fileGrpsLoaded = true; |
|
| 964 | + $this->fileGrpsLoaded = TRUE; |
|
| 965 | 965 | } |
| 966 | 966 | return $this->fileGrps; |
| 967 | 967 | } |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | $this->physicalStructure = array_merge($physSeq, $elements); |
| 1064 | 1064 | } |
| 1065 | 1065 | } |
| 1066 | - $this->physicalStructureLoaded = true; |
|
| 1066 | + $this->physicalStructureLoaded = TRUE; |
|
| 1067 | 1067 | } |
| 1068 | 1068 | return $this->physicalStructure; |
| 1069 | 1069 | } |
@@ -1082,7 +1082,7 @@ discard block |
||
| 1082 | 1082 | $this->smLinks['p2l'][(string) $smLink->attributes('http://www.w3.org/1999/xlink')->to][] = (string) $smLink->attributes('http://www.w3.org/1999/xlink')->from; |
| 1083 | 1083 | } |
| 1084 | 1084 | } |
| 1085 | - $this->smLinksLoaded = true; |
|
| 1085 | + $this->smLinksLoaded = TRUE; |
|
| 1086 | 1086 | } |
| 1087 | 1087 | return $this->smLinks; |
| 1088 | 1088 | } |
@@ -1091,7 +1091,7 @@ discard block |
||
| 1091 | 1091 | * {@inheritDoc} |
| 1092 | 1092 | * @see \Kitodo\Dlf\Common\Doc::_getThumbnail() |
| 1093 | 1093 | */ |
| 1094 | - protected function _getThumbnail($forceReload = false) |
|
| 1094 | + protected function _getThumbnail($forceReload = FALSE) |
|
| 1095 | 1095 | { |
| 1096 | 1096 | if ( |
| 1097 | 1097 | !$this->thumbnailLoaded |
@@ -1101,14 +1101,14 @@ discard block |
||
| 1101 | 1101 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
| 1102 | 1102 | if (!$cPid) { |
| 1103 | 1103 | $this->logger->error('Invalid PID ' . $cPid . ' for structure definitions'); |
| 1104 | - $this->thumbnailLoaded = true; |
|
| 1104 | + $this->thumbnailLoaded = TRUE; |
|
| 1105 | 1105 | return $this->thumbnail; |
| 1106 | 1106 | } |
| 1107 | 1107 | // Load extension configuration. |
| 1108 | 1108 | $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
| 1109 | 1109 | if (empty($extConf['fileGrpThumbs'])) { |
| 1110 | 1110 | $this->logger->warning('No fileGrp for thumbnails specified'); |
| 1111 | - $this->thumbnailLoaded = true; |
|
| 1111 | + $this->thumbnailLoaded = TRUE; |
|
| 1112 | 1112 | return $this->thumbnail; |
| 1113 | 1113 | } |
| 1114 | 1114 | $strctId = $this->_getToplevelId(); |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | } else { |
| 1163 | 1163 | $this->logger->error('No structure of type "' . $metadata['type'][0] . '" found in database'); |
| 1164 | 1164 | } |
| 1165 | - $this->thumbnailLoaded = true; |
|
| 1165 | + $this->thumbnailLoaded = TRUE; |
|
| 1166 | 1166 | } |
| 1167 | 1167 | return $this->thumbnail; |
| 1168 | 1168 | } |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | */ |
| 1204 | 1204 | public function _getParentHref() |
| 1205 | 1205 | { |
| 1206 | - if ($this->parentHref === null) { |
|
| 1206 | + if ($this->parentHref === NULL) { |
|
| 1207 | 1207 | $this->parentHref = ''; |
| 1208 | 1208 | |
| 1209 | 1209 | // Get the closest ancestor of the current document which has a MPTR child. |
@@ -1241,8 +1241,8 @@ discard block |
||
| 1241 | 1241 | public function __toString() |
| 1242 | 1242 | { |
| 1243 | 1243 | $xml = new \DOMDocument('1.0', 'utf-8'); |
| 1244 | - $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), true)); |
|
| 1245 | - $xml->formatOutput = true; |
|
| 1244 | + $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), TRUE)); |
|
| 1245 | + $xml->formatOutput = TRUE; |
|
| 1246 | 1246 | return $xml->saveXML(); |
| 1247 | 1247 | } |
| 1248 | 1248 | |
@@ -1257,7 +1257,7 @@ discard block |
||
| 1257 | 1257 | public function __wakeup() |
| 1258 | 1258 | { |
| 1259 | 1259 | $xml = Helper::getXmlFileAsString($this->asXML); |
| 1260 | - if ($xml !== false) { |
|
| 1260 | + if ($xml !== FALSE) { |
|
| 1261 | 1261 | $this->asXML = ''; |
| 1262 | 1262 | $this->xml = $xml; |
| 1263 | 1263 | // Rebuild the unserializable properties. |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * @param array $searchParams |
| 34 | 34 | * @param QueryResult $listedMetadata |
| 35 | 35 | */ |
| 36 | - public function __construct($documentRepository, $collection, $settings, $searchParams, $listedMetadata = null) |
|
| 36 | + public function __construct($documentRepository, $collection, $settings, $searchParams, $listedMetadata = NULL) |
|
| 37 | 37 | { |
| 38 | 38 | $this->documentRepository = $documentRepository; |
| 39 | 39 | $this->collection = $collection; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function count() |
| 51 | 51 | { |
| 52 | - if ($this->result === null) { |
|
| 52 | + if ($this->result === NULL) { |
|
| 53 | 53 | return 0; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | public function offsetGet($offset) |
| 91 | 91 | { |
| 92 | 92 | $idx = $this->result['document_keys'][$offset]; |
| 93 | - $document = $this->result['documents'][$idx] ?? null; |
|
| 93 | + $document = $this->result['documents'][$idx] ?? NULL; |
|
| 94 | 94 | |
| 95 | - if ($document !== null) { |
|
| 95 | + if ($document !== NULL) { |
|
| 96 | 96 | // It may happen that a Solr group only includes non-toplevel results, |
| 97 | 97 | // in which case metadata of toplevel entry isn't yet filled. |
| 98 | 98 | if (empty($document['metadata'])) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | // get title of parent/grandparent/... if empty |
| 108 | 108 | if (empty($document['title']) && $document['partOf'] > 0) { |
| 109 | - $superiorTitle = Doc::getTitle($document['partOf'], true); |
|
| 109 | + $superiorTitle = Doc::getTitle($document['partOf'], TRUE); |
|
| 110 | 110 | if (!empty($superiorTitle)) { |
| 111 | 111 | $document['title'] = '[' . $superiorTitle . ']'; |
| 112 | 112 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | if (!empty($this->searchParams['query'])) { |
| 180 | 180 | $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($this->searchParams['query'])) . ')'; |
| 181 | 181 | } |
| 182 | - $params['fulltext'] = true; |
|
| 182 | + $params['fulltext'] = TRUE; |
|
| 183 | 183 | } else { |
| 184 | 184 | // Retain given search field if valid. |
| 185 | 185 | if (!empty($this->searchParams['query'])) { |
@@ -282,17 +282,17 @@ discard block |
||
| 282 | 282 | $this->params = $params; |
| 283 | 283 | |
| 284 | 284 | // Send off query to get total number of search results in advance |
| 285 | - $this->submit(0, 1, false); |
|
| 285 | + $this->submit(0, 1, FALSE); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - public function submit($start, $rows, $processResults = true) |
|
| 288 | + public function submit($start, $rows, $processResults = TRUE) |
|
| 289 | 289 | { |
| 290 | 290 | $params = $this->params; |
| 291 | 291 | $params['start'] = $start; |
| 292 | 292 | $params['rows'] = $rows; |
| 293 | 293 | |
| 294 | 294 | // Perform search. |
| 295 | - $result = $this->searchSolr($params, true); |
|
| 295 | + $result = $this->searchSolr($params, TRUE); |
|
| 296 | 296 | |
| 297 | 297 | // Initialize values |
| 298 | 298 | $documents = []; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $documents[$doc['uid']] = $allDocuments[$doc['uid']]; |
| 317 | 317 | } |
| 318 | 318 | if ($documents[$doc['uid']]) { |
| 319 | - if ($doc['toplevel'] === false) { |
|
| 319 | + if ($doc['toplevel'] === FALSE) { |
|
| 320 | 320 | // this maybe a chapter, article, ..., year |
| 321 | 321 | if ($doc['type'] === 'year') { |
| 322 | 322 | continue; |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | $documents[$doc['uid']]['searchResults'][] = $searchResult; |
| 342 | 342 | } |
| 343 | - } else if ($doc['toplevel'] === true) { |
|
| 343 | + } else if ($doc['toplevel'] === TRUE) { |
|
| 344 | 344 | foreach ($params['listMetadataRecords'] as $indexName => $solrField) { |
| 345 | 345 | if (isset($doc['metadata'][$indexName])) { |
| 346 | 346 | $documents[$doc['uid']]['metadata'][$indexName] = $doc['metadata'][$indexName]; |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | $params['filterquery'][] = ['query' => 'toplevel:true']; |
| 409 | 409 | |
| 410 | 410 | // Perform search. |
| 411 | - $result = $this->searchSolr($params, true); |
|
| 411 | + $result = $this->searchSolr($params, TRUE); |
|
| 412 | 412 | |
| 413 | 413 | foreach ($result['documents'] as $doc) { |
| 414 | 414 | $metadataArray[$doc['uid']] = $doc['metadata']; |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | * |
| 428 | 428 | * @return array The Apache Solr Documents that were fetched |
| 429 | 429 | */ |
| 430 | - protected function searchSolr($parameters = [], $enableCache = true) |
|
| 430 | + protected function searchSolr($parameters = [], $enableCache = TRUE) |
|
| 431 | 431 | { |
| 432 | 432 | // Set query. |
| 433 | 433 | $parameters['query'] = isset($parameters['query']) ? $parameters['query'] : '*'; |
@@ -446,10 +446,10 @@ discard block |
||
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | $cacheIdentifier = ''; |
| 449 | - $cache = null; |
|
| 449 | + $cache = NULL; |
|
| 450 | 450 | // Calculate cache identifier. |
| 451 | - if ($enableCache === true) { |
|
| 452 | - $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true)); |
|
| 451 | + if ($enableCache === TRUE) { |
|
| 452 | + $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, TRUE)); |
|
| 453 | 453 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
| 454 | 454 | } |
| 455 | 455 | $resultSet = [ |
@@ -457,22 +457,22 @@ discard block |
||
| 457 | 457 | 'numberOfToplevels' => 0, |
| 458 | 458 | 'numFound' => 0, |
| 459 | 459 | ]; |
| 460 | - if ($enableCache === false || ($entry = $cache->get($cacheIdentifier)) === false) { |
|
| 460 | + if ($enableCache === FALSE || ($entry = $cache->get($cacheIdentifier)) === FALSE) { |
|
| 461 | 461 | $selectQuery = $solr->service->createSelect($parameters); |
| 462 | 462 | |
| 463 | 463 | $grouping = $selectQuery->getGrouping(); |
| 464 | 464 | $grouping->addField('uid'); |
| 465 | 465 | $grouping->setLimit(100); // Results in group (TODO: check) |
| 466 | - $grouping->setNumberOfGroups(true); |
|
| 466 | + $grouping->setNumberOfGroups(TRUE); |
|
| 467 | 467 | |
| 468 | - if ($parameters['fulltext'] === true) { |
|
| 468 | + if ($parameters['fulltext'] === TRUE) { |
|
| 469 | 469 | // get highlighting component and apply settings |
| 470 | 470 | $selectQuery->getHighlighting(); |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | $solrRequest = $solr->service->createRequest($selectQuery); |
| 474 | 474 | |
| 475 | - if ($parameters['fulltext'] === true) { |
|
| 475 | + if ($parameters['fulltext'] === TRUE) { |
|
| 476 | 476 | // If it is a fulltext search, enable highlighting. |
| 477 | 477 | // field for which highlighting is going to be performed, |
| 478 | 478 | // is required if you want to have OCR highlighting |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | $resultSet['numberOfToplevels'] = $uidGroup->getNumberOfGroups(); |
| 494 | 494 | $resultSet['numFound'] = $uidGroup->getMatches(); |
| 495 | 495 | $highlighting = []; |
| 496 | - if ($parameters['fulltext'] === true) { |
|
| 496 | + if ($parameters['fulltext'] === TRUE) { |
|
| 497 | 497 | $data = $result->getData(); |
| 498 | 498 | $highlighting = $data['ocrHighlighting']; |
| 499 | 499 | } |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | // Save value in cache. |
| 527 | - if (!empty($resultSet) && $enableCache === true) { |
|
| 527 | + if (!empty($resultSet) && $enableCache === TRUE) { |
|
| 528 | 528 | $cache->set($cacheIdentifier, $resultSet); |
| 529 | 529 | } |
| 530 | 530 | } else { |