@@ -121,7 +121,7 @@ |
||
| 121 | 121 | // prepare feature array for fluid |
| 122 | 122 | $features = []; |
| 123 | 123 | foreach (explode(',', $this->settings['features']) as $feature) { |
| 124 | - $features[$feature] = true; |
|
| 124 | + $features[$feature] = TRUE; |
|
| 125 | 125 | } |
| 126 | 126 | $this->view->assign('features', $features); |
| 127 | 127 | } |
@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | } else { |
| 259 | 259 | // Reindex document. |
| 260 | 260 | $document = $this->getDocumentRepository()->findByUid((int) $id); |
| 261 | - $doc = AbstractDocument::getInstance($document->getLocation(), ['storagePid' => $document->getPid()], true); |
|
| 262 | - if ($document !== null && $doc !== null) { |
|
| 261 | + $doc = AbstractDocument::getInstance($document->getLocation(), ['storagePid' => $document->getPid()], TRUE); |
|
| 262 | + if ($document !== NULL && $doc !== NULL) { |
|
| 263 | 263 | $document->setCurrentDocument($doc); |
| 264 | 264 | Indexer::add($document, $this->getDocumentRepository()); |
| 265 | 265 | } else { |
@@ -340,8 +340,8 @@ discard block |
||
| 340 | 340 | case 'undelete': |
| 341 | 341 | // Reindex document. |
| 342 | 342 | $document = $this->getDocumentRepository()->findByUid((int) $id); |
| 343 | - $doc = AbstractDocument::getInstance($document->getLocation(), ['storagePid' => $document->getPid()], true); |
|
| 344 | - if ($document !== null && $doc !== null) { |
|
| 343 | + $doc = AbstractDocument::getInstance($document->getLocation(), ['storagePid' => $document->getPid()], TRUE); |
|
| 344 | + if ($document !== NULL && $doc !== NULL) { |
|
| 345 | 345 | $document->setCurrentDocument($doc); |
| 346 | 346 | Indexer::add($document, $this->getDocumentRepository()); |
| 347 | 347 | } else { |
@@ -383,9 +383,9 @@ discard block |
||
| 383 | 383 | $query = $solr->service->createCoreAdmin(); |
| 384 | 384 | $action = $query->createUnload(); |
| 385 | 385 | $action->setCore($resArray['core']); |
| 386 | - $action->setDeleteDataDir(true); |
|
| 387 | - $action->setDeleteIndex(true); |
|
| 388 | - $action->setDeleteInstanceDir(true); |
|
| 386 | + $action->setDeleteDataDir(TRUE); |
|
| 387 | + $action->setDeleteIndex(TRUE); |
|
| 388 | + $action->setDeleteInstanceDir(TRUE); |
|
| 389 | 389 | $query->setAction($action); |
| 390 | 390 | try { |
| 391 | 391 | $response = $solr->service->coreAdmin($query); |
@@ -108,11 +108,11 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | // exit if at least one update statement is not successful |
| 110 | 110 | if (!((bool) $updateResult)) { |
| 111 | - return false; |
|
| 111 | + return FALSE; |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - return true; |
|
| 115 | + return TRUE; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function updateNecessary(): bool |
| 128 | 128 | { |
| 129 | - $oldSettingsFound = false; |
|
| 129 | + $oldSettingsFound = FALSE; |
|
| 130 | 130 | |
| 131 | 131 | $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content'); |
| 132 | 132 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | // Update the found record sets |
| 145 | 145 | while ($record = $statement->fetchAssociative()) { |
| 146 | 146 | $oldSettingsFound = $this->checkForOldSettings($record['pi_flexform']); |
| 147 | - if ($oldSettingsFound === true) { |
|
| 147 | + if ($oldSettingsFound === TRUE) { |
|
| 148 | 148 | // We found at least one field to be updated --> break here |
| 149 | 149 | break; |
| 150 | 150 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | foreach ($fields as $field) { |
| 189 | 189 | // change the index attribute if it doesn't start with 'settings.' yet |
| 190 | - if (strpos($field['index'], 'settings.') === false) { |
|
| 190 | + if (strpos($field['index'], 'settings.') === FALSE) { |
|
| 191 | 191 | $field['index'] = 'settings.' . $field['index']; |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | public function updateNecessary(): bool |
| 106 | 106 | { |
| 107 | 107 | /** @var int */ |
| 108 | - $numRecords = $this->getRecordsFromTable(true); |
|
| 108 | + $numRecords = $this->getRecordsFromTable(TRUE); |
|
| 109 | 109 | if ($numRecords > 0) { |
| 110 | - return true; |
|
| 110 | + return TRUE; |
|
| 111 | 111 | } |
| 112 | - return false; |
|
| 112 | + return FALSE; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
@@ -145,16 +145,16 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function executeUpdate(): bool |
| 147 | 147 | { |
| 148 | - $result = true; |
|
| 148 | + $result = TRUE; |
|
| 149 | 149 | try { |
| 150 | 150 | /** @var int */ |
| 151 | - $numRecords = $this->getRecordsFromTable(true); |
|
| 151 | + $numRecords = $this->getRecordsFromTable(TRUE); |
|
| 152 | 152 | if ($numRecords > 0) { |
| 153 | 153 | $this->performUpdate(); |
| 154 | 154 | } |
| 155 | 155 | } catch (\Exception $e) { |
| 156 | 156 | // If something goes wrong, migrateField() logs an error |
| 157 | - $result = false; |
|
| 157 | + $result = FALSE; |
|
| 158 | 158 | } |
| 159 | 159 | return $result; |
| 160 | 160 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * |
| 172 | 172 | * @throws \RuntimeException |
| 173 | 173 | */ |
| 174 | - protected function getRecordsFromTable(bool $countOnly = false) |
|
| 174 | + protected function getRecordsFromTable(bool $countOnly = FALSE) |
|
| 175 | 175 | { |
| 176 | 176 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
| 177 | 177 | $allResults = []; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | ->orderBy('uid') |
| 199 | 199 | ->execute() |
| 200 | 200 | ->fetchAllAssociative(); |
| 201 | - if ($countOnly === true) { |
|
| 201 | + if ($countOnly === TRUE) { |
|
| 202 | 202 | $numResults += count($result); |
| 203 | 203 | } else { |
| 204 | 204 | $allResults[$table] = $result; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - if ($countOnly === true) { |
|
| 214 | + if ($countOnly === TRUE) { |
|
| 215 | 215 | return $numResults; |
| 216 | 216 | } else { |
| 217 | 217 | return $allResults; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | protected function performUpdate(): bool |
| 230 | 230 | { |
| 231 | - $result = true; |
|
| 231 | + $result = TRUE; |
|
| 232 | 232 | |
| 233 | 233 | try { |
| 234 | 234 | $storages = GeneralUtility::makeInstance(StorageRepository::class)->findAll(); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | } catch (\Exception $e) { |
| 244 | - $result = false; |
|
| 244 | + $result = FALSE; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | return $result; |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $storageUid = (int) $this->storage->getUid(); |
| 271 | 271 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
| 272 | 272 | |
| 273 | - $fileUid = null; |
|
| 273 | + $fileUid = NULL; |
|
| 274 | 274 | $sourcePath = Environment::getPublicPath() . '/' . $fieldItem; |
| 275 | 275 | |
| 276 | 276 | // maybe the file was already moved, so check if the original file still exists |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | // Load document with current plugin parameters. |
| 138 | 138 | $this->loadDocument($queryParams['tx_dlf'], $cPid); |
| 139 | - if ($this->document === null || $this->document->getCurrentDocument() === null) { |
|
| 139 | + if ($this->document === NULL || $this->document->getCurrentDocument() === NULL) { |
|
| 140 | 140 | return $type; |
| 141 | 141 | } |
| 142 | 142 | // Set PID for metadata definitions. |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | // Calendar plugin does not support IIIF (yet). Abort for all newspaper related types. |
| 148 | 148 | if ( |
| 149 | 149 | $this->document->getCurrentDocument() instanceof IiifManifest |
| 150 | - && array_search($metadata['type'][0], ['newspaper', 'ephemera', 'year', 'issue']) !== false |
|
| 150 | + && array_search($metadata['type'][0], ['newspaper', 'ephemera', 'year', 'issue']) !== FALSE |
|
| 151 | 151 | ) { |
| 152 | 152 | return $type; |
| 153 | 153 | } |
@@ -174,25 +174,25 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | $this->initializeRepositories($pid); |
| 176 | 176 | |
| 177 | - $doc = null; |
|
| 177 | + $doc = NULL; |
|
| 178 | 178 | if (MathUtility::canBeInterpretedAsInteger($requestData['id'])) { |
| 179 | 179 | // find document from repository by uid |
| 180 | 180 | $this->document = $this->documentRepository->findOneByIdAndSettings((int) $requestData['id'], ['storagePid' => $pid]); |
| 181 | 181 | if ($this->document) { |
| 182 | - $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], true); |
|
| 182 | + $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], TRUE); |
|
| 183 | 183 | } else { |
| 184 | 184 | $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $pid . '" for document loading'); |
| 185 | 185 | } |
| 186 | 186 | } else if (GeneralUtility::isValidUrl($requestData['id'])) { |
| 187 | 187 | |
| 188 | - $doc = AbstractDocument::getInstance($requestData['id'], ['storagePid' => $pid], true); |
|
| 188 | + $doc = AbstractDocument::getInstance($requestData['id'], ['storagePid' => $pid], TRUE); |
|
| 189 | 189 | |
| 190 | - if ($doc !== null) { |
|
| 190 | + if ($doc !== NULL) { |
|
| 191 | 191 | if ($doc->recordId) { |
| 192 | 192 | $this->document = $this->documentRepository->findOneByRecordId($doc->recordId); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - if ($this->document === null) { |
|
| 195 | + if ($this->document === NULL) { |
|
| 196 | 196 | // create new dummy Document object |
| 197 | 197 | $this->document = GeneralUtility::makeInstance(Document::class); |
| 198 | 198 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - if ($this->document !== null && $doc !== null) { |
|
| 206 | + if ($this->document !== NULL && $doc !== NULL) { |
|
| 207 | 207 | $this->document->setCurrentDocument($doc); |
| 208 | 208 | } |
| 209 | 209 | |
@@ -211,9 +211,9 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | $this->document = $this->documentRepository->findOneByRecordId($requestData['recordId']); |
| 213 | 213 | |
| 214 | - if ($this->document !== null) { |
|
| 215 | - $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], true); |
|
| 216 | - if ($doc !== null) { |
|
| 214 | + if ($this->document !== NULL) { |
|
| 215 | + $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], TRUE); |
|
| 216 | + if ($doc !== NULL) { |
|
| 217 | 217 | $this->document->setCurrentDocument($doc); |
| 218 | 218 | } else { |
| 219 | 219 | $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"'); |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | $previousPage = (int) (($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getPublicItemsPerPage()) - ($this->paginator->getPublicItemsPerPage() - 1); |
| 37 | 37 | |
| 38 | 38 | if ($previousPage > $this->paginator->getNumberOfPages()) { |
| 39 | - return null; |
|
| 39 | + return NULL; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return $previousPage >= $this->getFirstPageNumber() |
| 43 | 43 | ? $previousPage |
| 44 | - : null |
|
| 44 | + : NULL |
|
| 45 | 45 | ; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | return $nextPage <= $this->paginator->getNumberOfPages() |
| 53 | 53 | ? $nextPage |
| 54 | - : null |
|
| 54 | + : NULL |
|
| 55 | 55 | ; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | protected function getMetsData(array $record) |
| 243 | 243 | { |
| 244 | - $mets = null; |
|
| 244 | + $mets = NULL; |
|
| 245 | 245 | // Load METS file. |
| 246 | 246 | $xml = new \DOMDocument(); |
| 247 | 247 | if ($xml->load($record['location'])) { |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | } else { |
| 323 | 323 | // No resumption token found or resumption token expired. |
| 324 | 324 | $this->error = 'badResumptionToken'; |
| 325 | - return null; |
|
| 325 | + return NULL; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | protected function verbListSets() |
| 584 | 584 | { |
| 585 | 585 | // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin. |
| 586 | - $this->settings['hideEmptyOaiNames'] = true; |
|
| 586 | + $this->settings['hideEmptyOaiNames'] = TRUE; |
|
| 587 | 587 | |
| 588 | 588 | $oaiSets = $this->collectionRepository->findCollectionsBySettings($this->settings); |
| 589 | 589 | |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | $currentCursor = $documentListSet['metadata']['cursor']; |
| 845 | 845 | |
| 846 | 846 | if (count($documentListSet['elements']) !== 0) { |
| 847 | - $resumptionToken = uniqid('', false); |
|
| 847 | + $resumptionToken = uniqid('', FALSE); |
|
| 848 | 848 | |
| 849 | 849 | $documentListSet['metadata']['cursor'] += $numShownDocuments; |
| 850 | 850 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | protected function printMetadata(array $metadata): void |
| 156 | 156 | { |
| 157 | 157 | if ($this->useOriginalIiifManifestMetadata) { |
| 158 | - $this->view->assign('useIiif', true); |
|
| 158 | + $this->view->assign('useIiif', TRUE); |
|
| 159 | 159 | $this->view->assign('iiifData', $this->buildIiifData($metadata)); |
| 160 | 160 | } else { |
| 161 | 161 | // findBySettings also sorts entries by the `sorting` field |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | if (IRI::isAbsoluteIri($value) && ($scheme == 'http' || $scheme == 'https')) { |
| 246 | 246 | //TODO: should really label be converted to empty string if equal to value? |
| 247 | 247 | $label = $value == $label ? '' : $label; |
| 248 | - $buildUrl = true; |
|
| 248 | + $buildUrl = TRUE; |
|
| 249 | 249 | } else { |
| 250 | - $buildUrl = false; |
|
| 250 | + $buildUrl = FALSE; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | return [ |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | private function parseParentTitle(int $i, $value, array &$metadata) : void |
| 389 | 389 | { |
| 390 | 390 | if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
| 391 | - $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), true); |
|
| 391 | + $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), TRUE); |
|
| 392 | 392 | if (!empty($superiorTitle)) { |
| 393 | 393 | $metadata[$i]['title'] = ['[' . $superiorTitle . ']']; |
| 394 | 394 | } |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | $this->getAllLogicalUnits(); |
| 73 | 73 | // Go through table of contents and create all menu entries. |
| 74 | 74 | foreach ($this->document->getCurrentDocument()->tableOfContents as $entry) { |
| 75 | - $menuArray[] = $this->getMenuEntry($entry, true); |
|
| 75 | + $menuArray[] = $this->getMenuEntry($entry, TRUE); |
|
| 76 | 76 | } |
| 77 | 77 | } else { |
| 78 | 78 | // Go through table of contents and create top-level menu entries. |
| 79 | 79 | foreach ($this->document->getCurrentDocument()->tableOfContents as $entry) { |
| 80 | - $menuArray[] = $this->getMenuEntry($entry, false); |
|
| 80 | + $menuArray[] = $this->getMenuEntry($entry, FALSE); |
|
| 81 | 81 | } |
| 82 | 82 | // Build table of contents from database. |
| 83 | 83 | $result = $this->documentRepository->getTableOfContentsFromDb($this->document->getUid(), $this->document->getPid(), $this->settings); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | 'pagination' => '', |
| 98 | 98 | 'targetUid' => $resArray['uid'] |
| 99 | 99 | ]; |
| 100 | - $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false); |
|
| 100 | + $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * |
| 116 | 116 | * @return array HMENU array for menu entry |
| 117 | 117 | */ |
| 118 | - private function getMenuEntry(array $entry, bool $recursive = false): array |
|
| 118 | + private function getMenuEntry(array $entry, bool $recursive = FALSE): array |
|
| 119 | 119 | { |
| 120 | 120 | $entry = $this->resolveMenuEntry($entry); |
| 121 | 121 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | // Build sub-menu if available and called recursively. |
| 177 | 177 | if ( |
| 178 | - $recursive === true |
|
| 178 | + $recursive === TRUE |
|
| 179 | 179 | && !empty($entry['children']) |
| 180 | 180 | ) { |
| 181 | 181 | // Build sub-menu only if one of the following conditions apply: |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | if (in_array($child['id'], $this->activeEntries)) { |
| 194 | 194 | $entryArray['ITEM_STATE'] = 'ACT'; |
| 195 | 195 | } |
| 196 | - $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true); |
|
| 196 | + $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE); |
|
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries. |