We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -390,10 +390,10 @@ |
||
390 | 390 | ); |
391 | 391 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
392 | 392 | if ($resArray['COLUMN_NAME'] == 'document_format') { |
393 | - return false; |
|
393 | + return FALSE; |
|
394 | 394 | } |
395 | 395 | } |
396 | - return true; |
|
396 | + return TRUE; |
|
397 | 397 | } |
398 | 398 | |
399 | 399 | protected function updateDocumentAddFormat() { |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
139 | 139 | IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']); |
140 | 140 | $service = IiifHelper::loadIiifResource($fileLocation); |
141 | - if ($service != null && $service instanceof AbstractImageService) { |
|
141 | + if ($service != NULL && $service instanceof AbstractImageService) { |
|
142 | 142 | return $service->getImageUrl(); |
143 | 143 | } |
144 | 144 | } elseif ($fileMimeType = "application/vnd.netfpx") { |
145 | - $baseURL = $fileLocation.(strpos($fileLocation, "?") === false ? "?" : ""); |
|
145 | + $baseURL = $fileLocation.(strpos($fileLocation, "?") === FALSE ? "?" : ""); |
|
146 | 146 | // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' |
147 | 147 | return $baseURL."&CVT=jpeg"; |
148 | 148 | } |
@@ -580,9 +580,9 @@ discard block |
||
580 | 580 | |
581 | 581 | if ($preloadedDocument instanceof \SimpleXMLElement) { |
582 | 582 | $this->xml = $preloadedDocument; |
583 | - return true; |
|
583 | + return TRUE; |
|
584 | 584 | } |
585 | - return false; |
|
585 | + return FALSE; |
|
586 | 586 | } |
587 | 587 | |
588 | 588 | /** |
@@ -65,7 +65,7 @@ |
||
65 | 65 | // Load template file. |
66 | 66 | $this->getTemplate(); |
67 | 67 | $annotationContainers = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['annotationContainers']; |
68 | - if ($annotationContainers != null && sizeof($annotationContainers)>0) { |
|
68 | + if ($annotationContainers != NULL && sizeof($annotationContainers)>0) { |
|
69 | 69 | $markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:' |
70 | 70 | .$this->pi_getLL('annotations-on', '', TRUE).';annotations-off:' |
71 | 71 | .$this->pi_getLL('annotations-off', '', TRUE).'"> </a>'; |
@@ -150,7 +150,7 @@ |
||
150 | 150 | * |
151 | 151 | * @return string The metadata array ready for output |
152 | 152 | */ |
153 | - protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false) { |
|
153 | + protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = FALSE) { |
|
154 | 154 | // Load template file. |
155 | 155 | $this->getTemplate(); |
156 | 156 | $output = ''; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | if ($iiif instanceof ManifestInterface) { |
248 | 248 | $canvas = $iiif->getContainedResourceById($canvasId); |
249 | 249 | /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */ |
250 | - if ($canvas!=null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
250 | + if ($canvas!=NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
251 | 251 | $annotationContainers = array(); |
252 | 252 | /* |
253 | 253 | * TODO Analyzing the annotations on the server side requires loading the annotation lists / pages |
@@ -257,10 +257,10 @@ discard block |
||
257 | 257 | * On the other hand, server connections are potentially better than client connections. Downloading annotation lists |
258 | 258 | */ |
259 | 259 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
260 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
260 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
261 | 261 | foreach ($textAnnotations as $annotation) { |
262 | 262 | if ($annotation->getBody()->getFormat() == "text/plain" |
263 | - && $annotation->getBody()->getChars() != null) { |
|
263 | + && $annotation->getBody()->getChars() != NULL) { |
|
264 | 264 | $annotationListData = []; |
265 | 265 | $annotationListData["uri"] = $annotationContainer->getId(); |
266 | 266 | $annotationListData["label"] = $annotationContainer->getLabelForDisplay(); |
@@ -411,9 +411,9 @@ discard block |
||
411 | 411 | } |
412 | 412 | } |
413 | 413 | // Create new instance depending on format (METS or IIIF) ... |
414 | - $documentFormat = null; |
|
415 | - $xml = null; |
|
416 | - $iiif = null; |
|
414 | + $documentFormat = NULL; |
|
415 | + $xml = NULL; |
|
416 | + $iiif = NULL; |
|
417 | 417 | // Try to get document format from database |
418 | 418 | if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($uid)) { |
419 | 419 | $whereClause = 'tx_dlf_documents.uid='.intval($uid).Helper::whereClause('tx_dlf_documents'); |
@@ -460,15 +460,15 @@ discard block |
||
460 | 460 | libxml_disable_entity_loader($previousValueOfEntityLoader); |
461 | 461 | // Reset libxml's error logging. |
462 | 462 | libxml_use_internal_errors($libxmlErrors); |
463 | - if ($xml !== false) { |
|
463 | + if ($xml !== FALSE) { |
|
464 | 464 | /* @var $xml \SimpleXMLElement */ |
465 | 465 | $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/'); |
466 | 466 | $xpathResult = $xml->xpath('//mets:mets'); |
467 | - $documentFormat = ($xpathResult !== false && count($xpathResult)>0) ? 'METS' : null; |
|
467 | + $documentFormat = ($xpathResult !== FALSE && count($xpathResult)>0) ? 'METS' : NULL; |
|
468 | 468 | } else { |
469 | 469 | // Try to load file as IIIF resource instead. |
470 | - $contentAsJsonArray = json_decode($content, true); |
|
471 | - if ($contentAsJsonArray !== null) { |
|
470 | + $contentAsJsonArray = json_decode($content, TRUE); |
|
471 | + if ($contentAsJsonArray !== NULL) { |
|
472 | 472 | // Load plugin configuration. |
473 | 473 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
474 | 474 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
@@ -722,12 +722,12 @@ discard block |
||
722 | 722 | return $depth; |
723 | 723 | } elseif (array_key_exists('children', $element)) { |
724 | 724 | $foundInChildren = $this->getTreeDepth($element['children'], $depth + 1, $logId); |
725 | - if ($foundInChildren!==false) { |
|
725 | + if ($foundInChildren!==FALSE) { |
|
726 | 726 | return $foundInChildren; |
727 | 727 | } |
728 | 728 | } |
729 | 729 | } |
730 | - return false; |
|
730 | + return FALSE; |
|
731 | 731 | } |
732 | 732 | |
733 | 733 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @var boolean |
69 | 69 | * @access protected |
70 | 70 | */ |
71 | - protected $hasFulltextSet = false; |
|
71 | + protected $hasFulltextSet = FALSE; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * This holds the original manifest's parsed metadata array with their corresponding |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | protected function establishRecordId($pid) |
103 | 103 | { |
104 | - if ($this->iiif !== null) { |
|
104 | + if ($this->iiif !== NULL) { |
|
105 | 105 | /* |
106 | 106 | * FIXME This will not consistently work because we can not be sure to have the pid at hand. It may miss |
107 | 107 | * if the plugin that actually loads the manifest allows content from other pages. |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | { |
229 | 229 | // Is there no physical structure array yet? |
230 | 230 | if (!$this->physicalStructureLoaded) { |
231 | - if ($this->iiif == null || !($this->iiif instanceof ManifestInterface)) { |
|
232 | - return null; |
|
231 | + if ($this->iiif == NULL || !($this->iiif instanceof ManifestInterface)) { |
|
232 | + return NULL; |
|
233 | 233 | } |
234 | 234 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
235 | 235 | $iiifId = $this->iiif->getId(); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $this->physicalStructureInfo[$physSeq[0]]['label'] = $this->iiif->getLabelForDisplay(); |
240 | 240 | $this->physicalStructureInfo[$physSeq[0]]['orderlabel'] = $this->iiif->getLabelForDisplay(); |
241 | 241 | $this->physicalStructureInfo[$physSeq[0]]['type'] = 'physSequence'; |
242 | - $this->physicalStructureInfo[$physSeq[0]]['contentIds'] = null; |
|
242 | + $this->physicalStructureInfo[$physSeq[0]]['contentIds'] = NULL; |
|
243 | 243 | $fileUseDownload = $this->getUseGroups('fileGrpDownload'); |
244 | 244 | $fileUseFulltext = $this->getUseGroups('fileGrpFulltext'); |
245 | 245 | $fileUseThumbs = $this->getUseGroups('fileGrpThumbs'); |
@@ -253,14 +253,14 @@ discard block |
||
253 | 253 | if (isset($fileUseFulltext)) { |
254 | 254 | $iiifAlto = $this->iiif->getSeeAlsoUrlsForFormat("application/alto+xml"); |
255 | 255 | if (empty($iiifAlto)) { |
256 | - $iiifAlto = $this->iiif->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", true); |
|
256 | + $iiifAlto = $this->iiif->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", TRUE); |
|
257 | 257 | } |
258 | 258 | if (!empty($iiifAlto)) { |
259 | 259 | // TODO use multiple possible alto files? |
260 | 260 | $this->mimeTypes[$iiifAlto[0]] = "application/alto+xml"; |
261 | 261 | $this->physicalStructureInfo[$physSeq[0]]['files'][$fileUseFulltext] = $iiifAlto[0]; |
262 | - $this->hasFulltext = true; |
|
263 | - $this->hasFulltextSet = true; |
|
262 | + $this->hasFulltext = TRUE; |
|
263 | + $this->hasFulltextSet = TRUE; |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | if (!empty($this->iiif->getDefaultCanvases())) { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | // put images in all non specific filegroups |
278 | 278 | if (isset($fileUses)) { |
279 | 279 | foreach ($fileUses as $fileUse) { |
280 | - if ($image->getBody() != null && $image->getBody() instanceof ContentResourceInterface) { |
|
280 | + if ($image->getBody() != NULL && $image->getBody() instanceof ContentResourceInterface) { |
|
281 | 281 | $this->physicalStructureInfo[$physSeq[0]]['files'][$fileUse] = $image->getBody()->getId(); |
282 | 282 | } |
283 | 283 | } |
@@ -285,40 +285,40 @@ discard block |
||
285 | 285 | // populate structural metadata info |
286 | 286 | $elements[$canvasOrder] = $canvas->getId(); |
287 | 287 | $this->physicalStructureInfo[$elements[$canvasOrder]]['id']=$canvas->getId(); |
288 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId']=null; |
|
288 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId']=NULL; |
|
289 | 289 | $this->physicalStructureInfo[$elements[$canvasOrder]]['label']=$canvas->getLabelForDisplay(); |
290 | 290 | $this->physicalStructureInfo[$elements[$canvasOrder]]['orderlabel']=$canvas->getLabelForDisplay(); |
291 | 291 | // assume that a canvas always represents a page |
292 | 292 | $this->physicalStructureInfo[$elements[$canvasOrder]]['type']='page'; |
293 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds']=null; |
|
294 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = null; |
|
293 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds']=NULL; |
|
294 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = NULL; |
|
295 | 295 | if (!empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
296 | 296 | $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = array(); |
297 | 297 | $this->physicalStructureInfo[$physSeq[0]]['annotationContainers'] = array(); |
298 | 298 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
299 | 299 | $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'][] = $annotationContainer->getId(); |
300 | 300 | if ($extConf['indexAnnotations']) { |
301 | - $this->hasFulltext = true; |
|
302 | - $this->hasFulltextSet = true; |
|
301 | + $this->hasFulltext = TRUE; |
|
302 | + $this->hasFulltextSet = TRUE; |
|
303 | 303 | } |
304 | 304 | } |
305 | 305 | } |
306 | 306 | if (isset($fileUseFulltext)) { |
307 | 307 | $alto = $canvas->getSeeAlsoUrlsForFormat("application/alto+xml"); |
308 | 308 | if (empty($alto)) { |
309 | - $alto = $canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", true); |
|
309 | + $alto = $canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", TRUE); |
|
310 | 310 | } |
311 | 311 | if (!empty($alto)) { |
312 | 312 | // TODO use all possible alto files? |
313 | 313 | $this->mimeTypes[$alto[0]] = "application/alto+xml"; |
314 | 314 | $this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUseFulltext] = $alto[0]; |
315 | - $this->hasFulltext = true; |
|
316 | - $this->hasFulltextSet = true; |
|
315 | + $this->hasFulltext = TRUE; |
|
316 | + $this->hasFulltextSet = TRUE; |
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | if (isset($fileUses)) { |
320 | 320 | foreach ($fileUses as $fileUse) { |
321 | - if ($image->getBody() != null && $image->getBody() instanceof ContentResourceInterface) { |
|
321 | + if ($image->getBody() != NULL && $image->getBody() instanceof ContentResourceInterface) { |
|
322 | 322 | $this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUse] = $image->getBody()->getId(); |
323 | 323 | } |
324 | 324 | } |
@@ -361,15 +361,15 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public function getFileLocation($id) |
363 | 363 | { |
364 | - if ($id == null) { |
|
365 | - return null; |
|
364 | + if ($id == NULL) { |
|
365 | + return NULL; |
|
366 | 366 | } |
367 | 367 | $resource = $this->iiif->getContainedResourceById($id); |
368 | 368 | if (isset($resource)) { |
369 | 369 | if ($resource instanceof CanvasInterface) { |
370 | - return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != null) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id; |
|
370 | + return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != NULL) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id; |
|
371 | 371 | } elseif ($resource instanceof ContentResourceInterface) { |
372 | - return $resource->getSingleService() != null && $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id; |
|
372 | + return $resource->getSingleService() != NULL && $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id; |
|
373 | 373 | } elseif ($resource instanceof AbstractImageService) { |
374 | 374 | return $resource->getId(); |
375 | 375 | } elseif ($resource instanceof AnnotationContainerInterface) { |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | } elseif ($fileResource instanceof AnnotationInterface) { |
393 | 393 | $format = "application/vnd.kitodo.iiif"; |
394 | 394 | } elseif ($fileResource instanceof ContentResourceInterface) { |
395 | - if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == null || !($fileResource->getSingleService() instanceof AbstractImageService))) { |
|
395 | + if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == NULL || !($fileResource->getSingleService() instanceof AbstractImageService))) { |
|
396 | 396 | // Support static images without an image service |
397 | 397 | return $fileResource->getFormat(); |
398 | 398 | } |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | // cache the ranges - they might occure multiple times in the structures "tree" - with full data as well as referenced as id |
428 | 428 | $processedStructures = array(); |
429 | 429 | foreach ($logUnits as $logUnit) { |
430 | - if (array_search($logUnit->getId(), $processedStructures) == false) { |
|
430 | + if (array_search($logUnit->getId(), $processedStructures) == FALSE) { |
|
431 | 431 | $this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, TRUE, $processedStructures); |
432 | 432 | } |
433 | 433 | } |
@@ -446,12 +446,12 @@ discard block |
||
446 | 446 | * @param array $processedStructures: IIIF resources that already have been processed |
447 | 447 | * @return array Logical structure array |
448 | 448 | */ |
449 | - protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = false, &$processedStructures = array()) { |
|
449 | + protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = FALSE, &$processedStructures = array()) { |
|
450 | 450 | $details = array (); |
451 | 451 | $details['id'] = $resource->getId(); |
452 | 452 | $details['dmdId'] = ''; |
453 | - $details['label'] = $resource->getLabelForDisplay() !== null ? $resource->getLabelForDisplay() : ''; |
|
454 | - $details['orderlabel'] = $resource->getLabelForDisplay() !== null ? $resource->getLabelForDisplay() : ''; |
|
453 | + $details['label'] = $resource->getLabelForDisplay() !== NULL ? $resource->getLabelForDisplay() : ''; |
|
454 | + $details['orderlabel'] = $resource->getLabelForDisplay() !== NULL ? $resource->getLabelForDisplay() : ''; |
|
455 | 455 | $details['contentIds'] = ''; |
456 | 456 | $details['volume'] = ''; |
457 | 457 | $details['pagination'] = ''; |
@@ -476,10 +476,10 @@ discard block |
||
476 | 476 | $startCanvas = $resource->getStartCanvasOrFirstCanvas(); |
477 | 477 | $canvases = $resource->getAllCanvases(); |
478 | 478 | } |
479 | - if ($startCanvas != null) { |
|
479 | + if ($startCanvas != NULL) { |
|
480 | 480 | $details['pagination'] = $startCanvas->getLabel(); |
481 | 481 | $startCanvasIndex = array_search($startCanvas, $this->iiif->getDefaultCanvases()); |
482 | - if ($startCanvasIndex!==false) { |
|
482 | + if ($startCanvasIndex!==FALSE) { |
|
483 | 483 | $details['points'] = $startCanvasIndex + 1; |
484 | 484 | } |
485 | 485 | } |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | if ($recursive) { |
494 | 494 | $processedStructures[] = $resource->getId(); |
495 | 495 | $details['children'] = array (); |
496 | - if ($resource instanceof ManifestInterface && $resource->getRootRanges() != null) { |
|
496 | + if ($resource instanceof ManifestInterface && $resource->getRootRanges() != NULL) { |
|
497 | 497 | $rangesToAdd = []; |
498 | 498 | $rootRanges = []; |
499 | 499 | if (sizeof($this->iiif->getRootRanges()) == 1 && $this->iiif->getRootRanges()[0]->isTopRange()) { |
@@ -505,14 +505,14 @@ discard block |
||
505 | 505 | $rootRanges[] = $range; |
506 | 506 | } |
507 | 507 | foreach ($rootRanges as $range) { |
508 | - if ((array_search($range->getId(), $processedStructures) == false)) { |
|
508 | + if ((array_search($range->getId(), $processedStructures) == FALSE)) { |
|
509 | 509 | $details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures); |
510 | 510 | } |
511 | 511 | } |
512 | 512 | } elseif ($resource instanceof RangeInterface) { |
513 | 513 | if (!empty($resource->getAllRanges())) { |
514 | 514 | foreach ($resource->getAllRanges() as $range) { |
515 | - if ((array_search($range->getId(), $processedStructures) == false)) { |
|
515 | + if ((array_search($range->getId(), $processedStructures) == FALSE)) { |
|
516 | 516 | $details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures); |
517 | 517 | } |
518 | 518 | } |
@@ -538,14 +538,14 @@ discard block |
||
538 | 538 | * |
539 | 539 | * @todo This method is still in experimental; the method signature may change. |
540 | 540 | */ |
541 | - public function getManifestMetadata($id, $cPid = 0, $withDescription = true, $withRights = true, $withRelated = true) { |
|
541 | + public function getManifestMetadata($id, $cPid = 0, $withDescription = TRUE, $withRights = TRUE, $withRelated = TRUE) { |
|
542 | 542 | if (!empty($this->originalMetadataArray[$id])) { |
543 | 543 | return $this->originalMetadataArray[$id]; |
544 | 544 | } |
545 | 545 | $iiifResource = $this->iiif->getContainedResourceById($id); |
546 | 546 | $result = array(); |
547 | - if ($iiifResource != null) { |
|
548 | - if ($iiifResource->getLabel()!=null && $iiifResource->getLabel() != "") { |
|
547 | + if ($iiifResource != NULL) { |
|
548 | + if ($iiifResource->getLabel()!=NULL && $iiifResource->getLabel() != "") { |
|
549 | 549 | $result['label'] = $iiifResource->getLabel(); |
550 | 550 | } |
551 | 551 | if (!empty($iiifResource->getMetadata())) { |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | $iiifResource = $this->iiif->getContainedResourceById($id); |
619 | 619 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
620 | 620 | // Set metadata field's value(s). |
621 | - if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $iiifResource->jsonPath($resArray['xpath'])) != null) { |
|
621 | + if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $iiifResource->jsonPath($resArray['xpath'])) != NULL) { |
|
622 | 622 | if (is_string($values)) { |
623 | 623 | $metadata[$resArray['index_name']] = array (trim((string) $values)); |
624 | 624 | } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data())>1 ) { |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | // Set sorting value if applicable. |
636 | 636 | if (!empty($metadata[$resArray['index_name']]) && $resArray['is_sortable']) { |
637 | 637 | if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting']) |
638 | - && ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != null)) { |
|
638 | + && ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != NULL)) { |
|
639 | 639 | if ($values instanceof string) { |
640 | 640 | $metadata[$resArray['index_name'].'_sorting'][0] = array (trim((string) $values)); |
641 | 641 | } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()>1 )) { |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | $this->smLinkRangeCanvasesRecursively($range); |
670 | 670 | } |
671 | 671 | } |
672 | - $this->smLinksLoaded = true; |
|
672 | + $this->smLinksLoaded = TRUE; |
|
673 | 673 | } |
674 | 674 | return $this->smLinks; |
675 | 675 | } |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | /* @var $annotationContainer \Ubl\Iiif\Presentation\Common\Model\Resources\AnnotationContainerInterface */ |
757 | 757 | foreach ($annotationContainer->getTextAnnotations(Motivation::PAINTING) as $annotation) { |
758 | 758 | if ($annotation->getTargetResourceId() == $iiifResource->getId() && |
759 | - $annotation->getBody()!=null && $annotation->getBody()->getChars()!=null) { |
|
759 | + $annotation->getBody()!=NULL && $annotation->getBody()->getChars()!=NULL) { |
|
760 | 760 | $annotationTexts[] = $annotation->getBody()->getChars(); |
761 | 761 | } |
762 | 762 | } |
@@ -806,10 +806,10 @@ discard block |
||
806 | 806 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
807 | 807 | IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']); |
808 | 808 | $resource = IiifHelper::loadIiifResource($content); |
809 | - if ($resource != null ) { |
|
809 | + if ($resource != NULL ) { |
|
810 | 810 | if ($resource instanceof ManifestInterface) { |
811 | 811 | $this->iiif = $resource; |
812 | - return true; |
|
812 | + return TRUE; |
|
813 | 813 | } |
814 | 814 | } else { |
815 | 815 | Helper::devLog('Could not load IIIF manifest from "'.$location.'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
@@ -833,9 +833,9 @@ discard block |
||
833 | 833 | protected function setPreloadedDocument($preloadedDocument) { |
834 | 834 | if ($preloadedDocument instanceof ManifestInterface) { |
835 | 835 | $this->iiif = $preloadedDocument; |
836 | - return true; |
|
836 | + return TRUE; |
|
837 | 837 | } |
838 | - return false; |
|
838 | + return FALSE; |
|
839 | 839 | } |
840 | 840 | |
841 | 841 | /** |
@@ -856,20 +856,20 @@ discard block |
||
856 | 856 | foreach ($canvases as $canvas) { |
857 | 857 | if (!empty($canvas->getSeeAlsoUrlsForFormat("application/alto+xml")) || |
858 | 858 | !empty($canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/"))) { |
859 | - $this->hasFulltextSet = true; |
|
860 | - $this->hasFulltext = true; |
|
859 | + $this->hasFulltextSet = TRUE; |
|
860 | + $this->hasFulltext = TRUE; |
|
861 | 861 | return; |
862 | 862 | } |
863 | 863 | $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
864 | 864 | if ($extConf['indexAnnotations'] == 1 && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
865 | 865 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
866 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
866 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
867 | 867 | foreach ($textAnnotations as $annotation) { |
868 | - if ($annotation->getBody() != null && |
|
868 | + if ($annotation->getBody() != NULL && |
|
869 | 869 | $annotation->getBody()->getFormat() == "text/plain" && |
870 | - $annotation->getBody()->getChars() != null) { |
|
871 | - $this->hasFulltextSet = true; |
|
872 | - $this->hasFulltext = true; |
|
870 | + $annotation->getBody()->getChars() != NULL) { |
|
871 | + $this->hasFulltextSet = TRUE; |
|
872 | + $this->hasFulltext = TRUE; |
|
873 | 873 | return; |
874 | 874 | } |
875 | 875 | } |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | } |
878 | 878 | } |
879 | 879 | } |
880 | - $this->hasFulltextSet = true; |
|
880 | + $this->hasFulltextSet = TRUE; |
|
881 | 881 | } |
882 | 882 | } |
883 | 883 | |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
919 | 919 | IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']); |
920 | 920 | $resource = IiifHelper::loadIiifResource($this->asJson); |
921 | - if ($resource != null && $resource instanceof ManifestInterface) { |
|
921 | + if ($resource != NULL && $resource instanceof ManifestInterface) { |
|
922 | 922 | $this->asJson=''; |
923 | 923 | $this->iiif = $resource; |
924 | 924 | $this->init(); |