@@ -24,8 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class ToolboxController extends AbstractController |
|
28 | -{ |
|
27 | +class ToolboxController extends AbstractController { |
|
29 | 28 | |
30 | 29 | /** |
31 | 30 | * @access private |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $this->renderToolByName('renderSearchInDocumentTool'); |
100 | 100 | break; |
101 | 101 | default: |
102 | - $this->logger->warning('Incorrect tool configuration: "' . $this->settings['tools'] . '". Tool "' . $tool . '" does not exist.'); |
|
102 | + $this->logger->warning('Incorrect tool configuration: "'.$this->settings['tools'].'". Tool "'.$tool.'" does not exist.'); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } |
263 | 263 | break; |
264 | 264 | } else { |
265 | - $this->logger->warning('File not found in fileGrp "' . $fileGrp . '"'); |
|
265 | + $this->logger->warning('File not found in fileGrp "'.$fileGrp.'"'); |
|
266 | 266 | } |
267 | 267 | } |
268 | 268 | return $image; |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | empty($firstPageLink) |
347 | 347 | && empty($secondPageLink) |
348 | 348 | ) { |
349 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
349 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | if (!empty($firstPageLink)) { |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | } |
385 | 385 | } |
386 | 386 | if (empty($workLink)) { |
387 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
387 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
388 | 388 | } |
389 | 389 | return $workLink; |
390 | 390 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | private function renderToolByName(string $tool): void |
118 | 118 | { |
119 | 119 | $this->$tool(); |
120 | - $this->view->assign($tool, true); |
|
120 | + $this->view->assign($tool, TRUE); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | |
140 | 140 | $annotationContainers = $this->currentDocument->physicalStructureInfo[$this->currentDocument->physicalStructure[$this->requestData['page']]]['annotationContainers']; |
141 | 141 | if ( |
142 | - $annotationContainers != null |
|
142 | + $annotationContainers != NULL |
|
143 | 143 | && count($annotationContainers) > 0 |
144 | 144 | ) { |
145 | - $this->view->assign('annotationTool', true); |
|
145 | + $this->view->assign('annotationTool', TRUE); |
|
146 | 146 | } else { |
147 | - $this->view->assign('annotationTool', false); |
|
147 | + $this->view->assign('annotationTool', FALSE); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | $this->setPage(); |
194 | 194 | |
195 | 195 | if (!$this->isFullTextEmpty()) { |
196 | - $this->view->assign('fulltext', true); |
|
196 | + $this->view->assign('fulltext', TRUE); |
|
197 | 197 | $this->view->assign('activateFullTextInitially', MathUtility::forceIntegerInRange($this->settings['activateFullTextInitially'], 0, 1, 0)); |
198 | 198 | } else { |
199 | - $this->view->assign('fulltext', false); |
|
199 | + $this->view->assign('fulltext', FALSE); |
|
200 | 200 | } |
201 | 201 | } |
202 | 202 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // Set parent element for initialization. |
282 | 282 | $parentContainer = !empty($this->settings['parentContainer']) ? $this->settings['parentContainer'] : '.tx-dlf-imagemanipulationtool'; |
283 | 283 | |
284 | - $this->view->assign('imageManipulation', true); |
|
284 | + $this->view->assign('imageManipulation', TRUE); |
|
285 | 285 | $this->view->assign('parentContainer', $parentContainer); |
286 | 286 | } |
287 | 287 | |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | { |
445 | 445 | $id = $this->document->getUid(); |
446 | 446 | |
447 | - if ($id !== null && $id > 0) { |
|
447 | + if ($id !== NULL && $id > 0) { |
|
448 | 448 | // we found the document uid |
449 | 449 | return (string) $id; |
450 | 450 | } else { |
@@ -500,9 +500,9 @@ discard block |
||
500 | 500 | while ($fileGrpFulltext = array_shift($fileGrpsFulltext)) { |
501 | 501 | $files = $this->currentDocument->physicalStructureInfo[$this->currentDocument->physicalStructure[$this->requestData['page']]]['files']; |
502 | 502 | if (!empty($files[$fileGrpFulltext])) { |
503 | - return false; |
|
503 | + return FALSE; |
|
504 | 504 | } |
505 | 505 | } |
506 | - return true; |
|
506 | + return TRUE; |
|
507 | 507 | } |
508 | 508 | } |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class PageViewController extends AbstractController |
|
29 | -{ |
|
28 | +class PageViewController extends AbstractController { |
|
30 | 29 | /** |
31 | 30 | * @access protected |
32 | 31 | * @var array Holds the controls to add to the map |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | if ($iiif instanceof ManifestInterface) { |
171 | 171 | $canvas = $iiif->getContainedResourceById($canvasId); |
172 | 172 | /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */ |
173 | - if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
173 | + if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
174 | 174 | $annotationContainers = []; |
175 | 175 | /* |
176 | 176 | * TODO Analyzing the annotations on the server side requires loading the annotation lists / pages |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | * On the other hand, server connections are potentially better than client connections. Downloading annotation lists |
181 | 181 | */ |
182 | 182 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
183 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
183 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
184 | 184 | foreach ($textAnnotations as $annotation) { |
185 | 185 | if ( |
186 | 186 | $annotation->getBody()->getFormat() == 'text/plain' |
187 | - && $annotation->getBody()->getChars() != null |
|
187 | + && $annotation->getBody()->getChars() != NULL |
|
188 | 188 | ) { |
189 | 189 | $annotationListData = []; |
190 | 190 | $annotationListData['uri'] = $annotationContainer->getId(); |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | $fulltext['mimetype'] = $file['mimeType']; |
120 | 120 | break; |
121 | 121 | } else { |
122 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"'); |
|
122 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"'); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | if (empty($fulltext)) { |
126 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpFulltext'] . '"'); |
|
126 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpFulltext'].'"'); |
|
127 | 127 | } |
128 | 128 | return $fulltext; |
129 | 129 | } |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | $viewerConfiguration = '$(document).ready(function() { |
142 | 142 | if (dlfUtils.exists(dlfViewer)) { |
143 | 143 | tx_dlf_viewer = new dlfViewer({ |
144 | - controls: ["' . implode('", "', $this->controls) . '"], |
|
145 | - div: "' . $this->settings['elementId'] . '", |
|
146 | - progressElementId: "' . $this->settings['progressElementId'] . '", |
|
147 | - images: ' . json_encode($this->images) . ', |
|
148 | - fulltexts: ' . json_encode($this->fulltexts) . ', |
|
149 | - annotationContainers: ' . json_encode($this->annotationContainers) . ', |
|
150 | - useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0) . ' |
|
144 | + controls: ["' . implode('", "', $this->controls).'"], |
|
145 | + div: "' . $this->settings['elementId'].'", |
|
146 | + progressElementId: "' . $this->settings['progressElementId'].'", |
|
147 | + images: ' . json_encode($this->images).', |
|
148 | + fulltexts: ' . json_encode($this->fulltexts).', |
|
149 | + annotationContainers: ' . json_encode($this->annotationContainers).', |
|
150 | + useInternalProxy: ' . ($this->settings['useInternalProxy'] ? 1 : 0).' |
|
151 | 151 | }); |
152 | 152 | } |
153 | 153 | });'; |
@@ -240,11 +240,11 @@ discard block |
||
240 | 240 | } |
241 | 241 | break; |
242 | 242 | } else { |
243 | - $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); |
|
243 | + $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"'); |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | if (empty($image)) { |
247 | - $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpImages'] . '"'); |
|
247 | + $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpImages'].'"'); |
|
248 | 248 | } |
249 | 249 | return $image; |
250 | 250 | } |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | $this->view->assign('calendarData', $calendarData); |
135 | 135 | $this->view->assign('documentId', $this->document->getUid()); |
136 | 136 | $this->view->assign('yearLinkTitle', $yearLinkTitle); |
137 | - $this->view->assign('parentDocumentId', $this->document->getPartof() ?: $this->document->getCurrentDocument()->tableOfContents[0]['points']); |
|
138 | - $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle($this->document->getPartof()) ?: $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
137 | + $this->view->assign('parentDocumentId', $this->document->getPartof() ? : $this->document->getCurrentDocument()->tableOfContents[0]['points']); |
|
138 | + $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle($this->document->getPartof()) ? : $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | } |
221 | 221 | |
222 | 222 | $this->view->assign('documentId', $this->document->getUid()); |
223 | - $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle((int) $this->document->getUid()) ?: $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
223 | + $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle((int) $this->document->getUid()) ? : $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | protected function getCalendarYear(array &$calendarData, array $calendarIssuesByMonth, int $year, int $firstMonth = 1, int $lastMonth = 12): void |
240 | 240 | { |
241 | 241 | for ($i = $firstMonth; $i <= $lastMonth; $i++) { |
242 | - $key = $year . '-' . $i; |
|
242 | + $key = $year.'-'.$i; |
|
243 | 243 | |
244 | 244 | $calendarData[$key] = [ |
245 | 245 | 'DAYMON_NAME' => strftime('%a', strtotime('last Monday')), |
@@ -249,16 +249,16 @@ discard block |
||
249 | 249 | 'DAYFRI_NAME' => strftime('%a', strtotime('last Friday')), |
250 | 250 | 'DAYSAT_NAME' => strftime('%a', strtotime('last Saturday')), |
251 | 251 | 'DAYSUN_NAME' => strftime('%a', strtotime('last Sunday')), |
252 | - 'MONTHNAME' => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year, |
|
252 | + 'MONTHNAME' => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year, |
|
253 | 253 | 'CALYEAR' => ($i == $firstMonth) ? $year : '' |
254 | 254 | ]; |
255 | 255 | |
256 | - $firstOfMonth = strtotime($year . '-' . $i . '-1'); |
|
256 | + $firstOfMonth = strtotime($year.'-'.$i.'-1'); |
|
257 | 257 | $lastOfMonth = strtotime('last day of', ($firstOfMonth)); |
258 | 258 | $firstOfMonthStart = strtotime('last Monday', $firstOfMonth); |
259 | 259 | // There are never more than 6 weeks in a month. |
260 | 260 | for ($j = 0; $j <= 5; $j++) { |
261 | - $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart); |
|
261 | + $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart); |
|
262 | 262 | |
263 | 263 | $calendarData[$key]['week'][$j] = [ |
264 | 264 | 'DAYMON' => ['dayValue' => ' '], |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | ]; |
272 | 272 | // Every week has seven days. ;-) |
273 | 273 | for ($k = 0; $k <= 6; $k++) { |
274 | - $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek); |
|
274 | + $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek); |
|
275 | 275 | if ( |
276 | 276 | $currentDayTime >= $firstOfMonth |
277 | 277 | && $currentDayTime <= $lastOfMonth |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | private function fillCalendar(array &$calendarData, int $currentDayTime, string $dayLinks, array $dayLinkDiv, int $firstDayOfWeek, int $k): void |
344 | 344 | { |
345 | - switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) { |
|
345 | + switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) { |
|
346 | 346 | case '0': |
347 | 347 | $this->fillDay($calendarData, $currentDayTime, 'DAYSUN', $dayLinks, $dayLinkDiv); |
348 | 348 | break; |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $_day = date('j', $dateTimestamp); |
447 | 447 | $issuesByYear[$_year][$_month][$_day][] = $issue; |
448 | 448 | } else { |
449 | - $this->logger->warning('Document with UID ' . $issue['uid'] . 'has no valid date of publication'); |
|
449 | + $this->logger->warning('Document with UID '.$issue['uid'].'has no valid date of publication'); |
|
450 | 450 | } |
451 | 451 | } |
452 | 452 | // Sort by years. |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | foreach ($year['children'] as $month) { |
490 | 490 | foreach ($month['children'] as $day) { |
491 | 491 | foreach ($day['children'] as $issue) { |
492 | - $title = $issue['label'] ?: $issue['orderlabel']; |
|
492 | + $title = $issue['label'] ? : $issue['orderlabel']; |
|
493 | 493 | if (strtotime($title) !== false) { |
494 | 494 | $title = strftime('%x', strtotime($title)); |
495 | 495 | } |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class CalendarController extends AbstractController |
|
29 | -{ |
|
28 | +class CalendarController extends AbstractController { |
|
30 | 29 | /** |
31 | 30 | * @access protected |
32 | 31 | * @var StructureRepository |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | switch ($type) { |
83 | 83 | case 'newspaper': |
84 | 84 | case 'ephemera': |
85 | - $this->forward('years', null, null, $this->requestData); |
|
85 | + $this->forward('years', NULL, NULL, $this->requestData); |
|
86 | 86 | case 'year': |
87 | - $this->forward('calendar', null, null, $this->requestData); |
|
87 | + $this->forward('calendar', NULL, NULL, $this->requestData); |
|
88 | 88 | case 'issue': |
89 | 89 | default: |
90 | 90 | break; |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | |
441 | 441 | foreach ($this->getIssues() as $issue) { |
442 | 442 | $dateTimestamp = strtotime($issue['year']); |
443 | - if ($dateTimestamp !== false) { |
|
443 | + if ($dateTimestamp !== FALSE) { |
|
444 | 444 | $_year = date('Y', $dateTimestamp); |
445 | 445 | $_month = date('n', $dateTimestamp); |
446 | 446 | $_day = date('j', $dateTimestamp); |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | foreach ($month['children'] as $day) { |
491 | 491 | foreach ($day['children'] as $issue) { |
492 | 492 | $title = $issue['label'] ?: $issue['orderlabel']; |
493 | - if (strtotime($title) !== false) { |
|
493 | + if (strtotime($title) !== FALSE) { |
|
494 | 494 | $title = strftime('%x', strtotime($title)); |
495 | 495 | } |
496 | 496 | |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | $title = $document->getTitle(); |
524 | 524 | } else { |
525 | 525 | $title = !empty($document->getMetsLabel()) ? $document->getMetsLabel() : $document->getMetsOrderlabel(); |
526 | - if (strtotime($title) !== false) { |
|
526 | + if (strtotime($title) !== FALSE) { |
|
527 | 527 | $title = strftime('%x', strtotime($title)); |
528 | 528 | } |
529 | 529 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | foreach ($this->requestData['selected'] as $docValue) { |
134 | 134 | if ($docValue['id']) { |
135 | 135 | $docData = $this->getDocumentData((int) $docValue['id'], $docValue); |
136 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
136 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
137 | 137 | $this->redirectToUri($pdfUrl); |
138 | 138 | } |
139 | 139 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | if ($allMails->count() > 0) { |
201 | 201 | $mailSelect[0] = htmlspecialchars(LocalizationUtility::translate('basket.chooseMail', 'dlf')); |
202 | 202 | foreach ($allMails as $mail) { |
203 | - $mailSelect[$mail->getUid()] = htmlspecialchars($mail->getName()) . ' (' . htmlspecialchars($mail->getMail()) . ')'; |
|
203 | + $mailSelect[$mail->getUid()] = htmlspecialchars($mail->getName()).' ('.htmlspecialchars($mail->getMail()).')'; |
|
204 | 204 | } |
205 | 205 | $this->view->assign('mailSelect', $mailSelect); |
206 | 206 | } |
@@ -292,12 +292,12 @@ discard block |
||
292 | 292 | |
293 | 293 | $entryArray['BASKETDATA'] = $docData; |
294 | 294 | |
295 | - $entryKey = $id . '_' . $startpage; |
|
295 | + $entryKey = $id.'_'.$startpage; |
|
296 | 296 | if (!empty($startX)) { |
297 | - $entryKey .= '_' . $startX; |
|
297 | + $entryKey .= '_'.$startX; |
|
298 | 298 | } |
299 | 299 | if (!empty($endX)) { |
300 | - $entryKey .= '_' . $endX; |
|
300 | + $entryKey .= '_'.$endX; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | $entryArray['id'] = $id; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : (int) $data['endY'], $urlParams); |
354 | 354 | $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : (int) $data['rotation'], $urlParams); |
355 | 355 | |
356 | - $downloadUrl = $this->settings['pdfgenerate'] . $urlParams; |
|
356 | + $downloadUrl = $this->settings['pdfgenerate'].$urlParams; |
|
357 | 357 | |
358 | 358 | $title = $this->document->getTitle(); |
359 | 359 | if (empty($title)) { |
@@ -364,15 +364,15 @@ discard block |
||
364 | 364 | $info = ''; |
365 | 365 | if ($data['startX'] != '' && $data['endX'] != '') { |
366 | 366 | // cutout |
367 | - $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')) . ' '; |
|
367 | + $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')).' '; |
|
368 | 368 | } |
369 | 369 | if ($data['startpage'] == $data['endpage']) { |
370 | 370 | // One page |
371 | - $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage']; |
|
371 | + $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage']; |
|
372 | 372 | } else { |
373 | - $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage'] . '-' . $data['endpage']; |
|
373 | + $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage'].'-'.$data['endpage']; |
|
374 | 374 | } |
375 | - $downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . htmlspecialchars($title) . '</a> (' . $info . ')'; |
|
375 | + $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.htmlspecialchars($title).'</a> ('.$info.')'; |
|
376 | 376 | if ($data['startpage'] == $data['endpage']) { |
377 | 377 | $pageNums = 1; |
378 | 378 | } else { |
@@ -445,12 +445,12 @@ discard block |
||
445 | 445 | if ($piVars['addToBasket'] == 'list') { |
446 | 446 | $documentItem['endpage'] = $this->document->getCurrentDocument()->numPages; |
447 | 447 | } |
448 | - $arrayKey = $documentItem['id'] . '_' . $page; |
|
448 | + $arrayKey = $documentItem['id'].'_'.$page; |
|
449 | 449 | if (!empty($documentItem['startX'])) { |
450 | - $arrayKey .= '_' . $documentItem['startX']; |
|
450 | + $arrayKey .= '_'.$documentItem['startX']; |
|
451 | 451 | } |
452 | 452 | if (!empty($documentItem['endX'])) { |
453 | - $arrayKey .= '_' . $documentItem['endX']; |
|
453 | + $arrayKey .= '_'.$documentItem['endX']; |
|
454 | 454 | } |
455 | 455 | // do not add more than one identical object |
456 | 456 | if (!in_array($arrayKey, $items)) { |
@@ -471,14 +471,14 @@ discard block |
||
471 | 471 | // remove parameter endpage |
472 | 472 | $pdfParams = str_replace(",##endpage##", '', $pdfParams); |
473 | 473 | } |
474 | - $pdfGenerateUrl = $this->settings['pdfgenerate'] . $pdfParams; |
|
474 | + $pdfGenerateUrl = $this->settings['pdfgenerate'].$pdfParams; |
|
475 | 475 | if ($this->settings['pregeneration']) { |
476 | 476 | // send ajax request to webapp |
477 | 477 | $output .= ' |
478 | 478 | <script> |
479 | 479 | $(document).ready(function(){ |
480 | 480 | $.ajax({ |
481 | - url: "' . $pdfGenerateUrl . '", |
|
481 | + url: "' . $pdfGenerateUrl.'", |
|
482 | 482 | }).done(function() { |
483 | 483 | }); |
484 | 484 | }); |
@@ -516,12 +516,12 @@ discard block |
||
516 | 516 | } |
517 | 517 | foreach ($piVars['selected'] as $value) { |
518 | 518 | if (isset($value['id'])) { |
519 | - $arrayKey = $value['id'] . '_' . $value['startpage']; |
|
519 | + $arrayKey = $value['id'].'_'.$value['startpage']; |
|
520 | 520 | if (!empty($value['startX'])) { |
521 | - $arrayKey .= '_' . $value['startX']; |
|
521 | + $arrayKey .= '_'.$value['startX']; |
|
522 | 522 | } |
523 | 523 | if (!empty($value['endX'])) { |
524 | - $arrayKey .= '_' . $value['endX']; |
|
524 | + $arrayKey .= '_'.$value['endX']; |
|
525 | 525 | } |
526 | 526 | if (isset($items[$arrayKey])) { |
527 | 527 | unset($items[$arrayKey]); |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | $mailObject = $this->mailRepository->findByUid(intval($mailId))->getFirst(); |
556 | 556 | |
557 | - $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf')) . "\n"; |
|
557 | + $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf'))."\n"; |
|
558 | 558 | $numberOfPages = 0; |
559 | 559 | $pdfUrl = $this->settings['pdfdownload']; |
560 | 560 | // prepare links |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | if ($docValue['id']) { |
563 | 563 | $explodeId = explode("_", $docValue['id']); |
564 | 564 | $docData = $this->getDocumentData((int) $explodeId[0], $docValue); |
565 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
565 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
566 | 566 | $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage']))); |
567 | 567 | if ($pages === 0) { |
568 | 568 | $numberOfPages = $numberOfPages + 1; |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | } |
574 | 574 | // Remove leading/tailing pdfparamseperator |
575 | 575 | $pdfUrl = trim($pdfUrl, $this->settings['pdfparamseparator']); |
576 | - $mailBody = $mailText . $pdfUrl; |
|
576 | + $mailBody = $mailText.$pdfUrl; |
|
577 | 577 | // Get hook objects. |
578 | 578 | $hookObjects = Helper::getHookObjects('Classes/Controller/BasketController.php'); |
579 | 579 | // Hook for getting a customized mail body. |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | $newActionLog = GeneralUtility::makeInstance(ActionLog::class); |
601 | 601 | $newActionLog->setFileName($pdfUrl); |
602 | 602 | $newActionLog->setCountPages($numberOfPages); |
603 | - $newActionLog->setLabel('Mail: ' . $mailObject->getMail()); |
|
603 | + $newActionLog->setLabel('Mail: '.$mailObject->getMail()); |
|
604 | 604 | |
605 | 605 | if ($GLOBALS["TSFE"]->loginUser) { |
606 | 606 | // internal user |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | foreach ($this->requestData['selected'] as $docId => $docValue) { |
632 | 632 | if ($docValue['id']) { |
633 | 633 | $docData = $this->getDocumentData((int) $docValue['id'], $docValue); |
634 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
634 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
635 | 635 | $numberOfPages += $docData['pageNums']; |
636 | 636 | } |
637 | 637 | } |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | if ($docValue['id']) { |
650 | 650 | $explodeId = explode("_", $docId); |
651 | 651 | $docData = $this->getDocumentData((int) $explodeId[0], $docValue); |
652 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
652 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
653 | 653 | $numberOfPages += $docData['pageNums']; |
654 | 654 | } |
655 | 655 | } |
@@ -666,12 +666,12 @@ discard block |
||
666 | 666 | // internal user |
667 | 667 | $actionLog->setUserId($GLOBALS["TSFE"]->fe_user->user['uid']); |
668 | 668 | $actionLog->setName($GLOBALS["TSFE"]->fe_user->user['username']); |
669 | - $actionLog->setLabel('Print: ' . $printer->getLabel()); |
|
669 | + $actionLog->setLabel('Print: '.$printer->getLabel()); |
|
670 | 670 | } else { |
671 | 671 | // external user |
672 | 672 | $actionLog->setUserId(0); |
673 | 673 | $actionLog->setName('n/a'); |
674 | - $actionLog->setLabel('Print: ' . $printer->getLabel()); |
|
674 | + $actionLog->setLabel('Print: '.$printer->getLabel()); |
|
675 | 675 | } |
676 | 676 | // add action to protocol |
677 | 677 | $this->actionLogRepository->add($actionLog); |
@@ -33,8 +33,7 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @access public |
35 | 35 | */ |
36 | -class BasketController extends AbstractController |
|
37 | -{ |
|
36 | +class BasketController extends AbstractController { |
|
38 | 37 | /** |
39 | 38 | * @access protected |
40 | 39 | * @var BasketRepository |
@@ -328,8 +327,7 @@ discard block |
||
328 | 327 | * |
329 | 328 | * @return array|false download url or false |
330 | 329 | */ |
331 | - protected function getDocumentData(int $id, array $data) |
|
332 | - { |
|
330 | + protected function getDocumentData(int $id, array $data) { |
|
333 | 331 | // get document instance to load further information |
334 | 332 | $this->loadDocument((int) $id); |
335 | 333 | if (isset($this->document)) { |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | $countDocs = 0; |
192 | 192 | if ($basket->getDocIds()) { |
193 | - $countDocs = count(json_decode($basket->getDocIds(), true)); |
|
193 | + $countDocs = count(json_decode($basket->getDocIds(), TRUE)); |
|
194 | 194 | } |
195 | 195 | $this->view->assign('countDocs', $countDocs); |
196 | 196 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | // session does not exist |
256 | - if ($basket === null) { |
|
256 | + if ($basket === NULL) { |
|
257 | 257 | // create new basket in db |
258 | 258 | $basket = GeneralUtility::makeInstance(Basket::class); |
259 | 259 | $basket->setSessionId($userSession->getIdentifier()); |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | 'record_id' => $this->document->getRecordId(), |
389 | 389 | ]; |
390 | 390 | } |
391 | - return false; |
|
391 | + return FALSE; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | } else { |
411 | 411 | $page = (int) $piVars['startpage']; |
412 | 412 | } |
413 | - if ($page != null || $piVars['addToBasket'] == 'list') { |
|
413 | + if ($page != NULL || $piVars['addToBasket'] == 'list') { |
|
414 | 414 | $documentItem = [ |
415 | 415 | 'id' => (int) $piVars['id'], |
416 | 416 | 'startpage' => (int) $piVars['startpage'], |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $this->loadDocument((int) $documentItem['id']); |
434 | 434 | if ($this->isDocMissing()) { |
435 | 435 | // Quit without doing anything if required variables are not set. |
436 | - return null; |
|
436 | + return NULL; |
|
437 | 437 | } |
438 | 438 | // set endpage for toc and subentry based on logid |
439 | 439 | if (($piVars['addToBasket'] == 'subentry') or ($piVars['addToBasket'] == 'toc')) { |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | } |
488 | 488 | |
489 | 489 | $basket->setDocIds(json_encode($items)); |
490 | - if ($basket->getUid() === null) { |
|
490 | + if ($basket->getUid() === NULL) { |
|
491 | 491 | $this->basketRepository->add($basket); |
492 | 492 | } else { |
493 | 493 | $this->basketRepository->update($basket); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $simplePagination = new SimplePagination($solrPaginator); |
168 | 168 | |
169 | 169 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
170 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
170 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $this->view->assign('viewData', $this->viewData); |
@@ -219,20 +219,20 @@ discard block |
||
219 | 219 | foreach ($collections as $collection) { |
220 | 220 | $solr_query = ''; |
221 | 221 | if ($collection->getIndexSearch() != '') { |
222 | - $solr_query .= '(' . $collection->getIndexSearch() . ')'; |
|
222 | + $solr_query .= '('.$collection->getIndexSearch().')'; |
|
223 | 223 | } else { |
224 | - $solr_query .= 'collection:("' . Solr::escapeQuery($collection->getIndexName()) . '")'; |
|
224 | + $solr_query .= 'collection:("'.Solr::escapeQuery($collection->getIndexName()).'")'; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | // virtual collection might yield documents, that are not toplevel true or partof anything |
228 | 228 | if ($collection->getIndexSearch()) { |
229 | 229 | $params['query'] = $solr_query; |
230 | 230 | } else { |
231 | - $params['query'] = $solr_query . ' AND partof:0 AND toplevel:true'; |
|
231 | + $params['query'] = $solr_query.' AND partof:0 AND toplevel:true'; |
|
232 | 232 | } |
233 | 233 | $partOfNothing = $solr->searchRaw($params); |
234 | 234 | |
235 | - $params['query'] = $solr_query . ' AND NOT partof:0 AND toplevel:true'; |
|
235 | + $params['query'] = $solr_query.' AND NOT partof:0 AND toplevel:true'; |
|
236 | 236 | $partOfSomething = $solr->searchRaw($params); |
237 | 237 | |
238 | 238 | $collectionInfo = []; |
@@ -28,8 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @access public |
30 | 30 | */ |
31 | -class CollectionController extends AbstractController |
|
32 | -{ |
|
31 | +class CollectionController extends AbstractController { |
|
33 | 32 | /** |
34 | 33 | * @access protected |
35 | 34 | * @var CollectionRepository |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | if (count($collections) == 1 && empty($this->settings['dont_show_single']) && is_array($collections)) { |
101 | - $this->forward('show', null, null, ['collection' => array_pop($collections)]); |
|
101 | + $this->forward('show', NULL, NULL, ['collection' => array_pop($collections)]); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | $processedCollections = $this->processCollections($collections, $solr); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $searchParams['collection'] = $collection; |
141 | 141 | // If a targetPid is given, the results will be shown by ListView on the target page. |
142 | 142 | if (!empty($this->settings['targetPid'])) { |
143 | - $this->redirect('main', 'ListView', null, |
|
143 | + $this->redirect('main', 'ListView', NULL, |
|
144 | 144 | [ |
145 | 145 | 'searchParameter' => $searchParams, |
146 | 146 | 'page' => $currentPage |
@@ -149,13 +149,13 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | // get all metadata records to be shown in results |
152 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
152 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
153 | 153 | |
154 | 154 | // get all sortable metadata records |
155 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
155 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
156 | 156 | |
157 | 157 | // get all documents of given collection |
158 | - $solrResults = null; |
|
158 | + $solrResults = NULL; |
|
159 | 159 | if (is_array($searchParams) && !empty($searchParams)) { |
160 | 160 | $solrResults = $this->documentRepository->findSolrByCollection($collection, $this->settings, $searchParams, $listedMetadata); |
161 | 161 | |
@@ -191,13 +191,13 @@ discard block |
||
191 | 191 | // if search was triggered, get search parameters from POST variables |
192 | 192 | $searchParams = $this->getParametersSafely('searchParameter'); |
193 | 193 | |
194 | - $collection = null; |
|
194 | + $collection = NULL; |
|
195 | 195 | if ($searchParams['collection']['__identity'] && MathUtility::canBeInterpretedAsInteger($searchParams['collection']['__identity'])) { |
196 | 196 | $collection = $this->collectionRepository->findByUid($searchParams['collection']['__identity']); |
197 | 197 | } |
198 | 198 | |
199 | 199 | // output is done by show action |
200 | - $this->forward('show', null, null, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
200 | + $this->forward('show', NULL, NULL, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
201 | 201 | |
202 | 202 | } |
203 | 203 |
@@ -42,8 +42,7 @@ |
||
42 | 42 | * |
43 | 43 | * @access public |
44 | 44 | */ |
45 | -class NewTenantController extends AbstractController |
|
46 | -{ |
|
45 | +class NewTenantController extends AbstractController { |
|
47 | 46 | /** |
48 | 47 | * @access protected |
49 | 48 | * @var int |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | public function addFormatAction(): void |
180 | 180 | { |
181 | 181 | // Include formats definition file. |
182 | - $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
|
182 | + $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/FormatDefaults.php'); |
|
183 | 183 | |
184 | 184 | $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK); |
185 | 185 | // tx_dlf_formats are stored on PID = 0 |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | public function addMetadataAction(): void |
222 | 222 | { |
223 | 223 | // Include metadata definition file. |
224 | - $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
|
224 | + $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/MetadataDefaults.php'); |
|
225 | 225 | |
226 | 226 | // load language file in own array |
227 | 227 | $metadataLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_metadata.xlf', $this->siteLanguages[0]->getTypo3Language()); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | $data['tx_dlf_metadata'][uniqid('NEW')] = [ |
251 | 251 | 'pid' => $this->pid, |
252 | - 'label' => $this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels), |
|
252 | + 'label' => $this->getLLL('metadata.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels), |
|
253 | 253 | 'index_name' => $indexName, |
254 | 254 | 'format' => implode(',', $formatIds), |
255 | 255 | 'default_value' => $values['default_value'], |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | 'pid' => $this->pid, |
289 | 289 | 'sys_language_uid' => $siteLanguage->getLanguageId(), |
290 | 290 | 'l18n_parent' => $id, |
291 | - 'label' => $this->getLLL('metadata.' . $indexName, $siteLanguage->getTypo3Language(), $metadataLabels), |
|
291 | + 'label' => $this->getLLL('metadata.'.$indexName, $siteLanguage->getTypo3Language(), $metadataLabels), |
|
292 | 292 | ]; |
293 | 293 | } |
294 | 294 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | |
315 | 315 | if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
316 | 316 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
317 | - $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
|
317 | + $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels).' (PID '.$this->pid.')'); |
|
318 | 318 | $indexName = Solr::createCore(''); |
319 | 319 | if (!empty($indexName)) { |
320 | 320 | $newRecord->setIndexName($indexName); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | public function addStructureAction(): void |
345 | 345 | { |
346 | 346 | // Include structure definition file. |
347 | - $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
|
347 | + $structureDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/StructureDefaults.php'); |
|
348 | 348 | |
349 | 349 | // load language file in own array |
350 | 350 | $structureLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_structure.xlf', $this->siteLanguages[0]->getTypo3Language()); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $data['tx_dlf_structures'][uniqid('NEW')] = [ |
355 | 355 | 'pid' => $this->pid, |
356 | 356 | 'toplevel' => $values['toplevel'], |
357 | - 'label' => $this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels), |
|
357 | + 'label' => $this->getLLL('structure.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels), |
|
358 | 358 | 'index_name' => $indexName, |
359 | 359 | 'oai_name' => $values['oai_name'], |
360 | 360 | 'thumbnail' => 0, |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | 'pid' => $this->pid, |
380 | 380 | 'sys_language_uid' => $siteLanguage->getLanguageId(), |
381 | 381 | 'l18n_parent' => $id, |
382 | - 'label' => $this->getLLL('structure.' . $indexName, $siteLanguage->getTypo3Language(), $structureLabels), |
|
382 | + 'label' => $this->getLLL('structure.'.$indexName, $siteLanguage->getTypo3Language(), $structureLabels), |
|
383 | 383 | ]; |
384 | 384 | } |
385 | 385 | |
@@ -426,15 +426,15 @@ discard block |
||
426 | 426 | $this->forward('error'); |
427 | 427 | } |
428 | 428 | |
429 | - $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
|
429 | + $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/FormatDefaults.php'); |
|
430 | 430 | $recordInfos['formats']['numCurrent'] = $this->formatRepository->countAll(); |
431 | 431 | $recordInfos['formats']['numDefault'] = count($formatsDefaults); |
432 | 432 | |
433 | - $structuresDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
|
433 | + $structuresDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/StructureDefaults.php'); |
|
434 | 434 | $recordInfos['structures']['numCurrent'] = $this->structureRepository->countByPid($this->pid); |
435 | 435 | $recordInfos['structures']['numDefault'] = count($structuresDefaults); |
436 | 436 | |
437 | - $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
|
437 | + $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/MetadataDefaults.php'); |
|
438 | 438 | $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->countByPid($this->pid); |
439 | 439 | $recordInfos['metadata']['numDefault'] = count($metadataDefaults); |
440 | 440 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | } elseif (isset($langArray['default'][$index][0]['target'])) { |
475 | 475 | return $langArray['default'][$index][0]['target']; |
476 | 476 | } else { |
477 | - return 'Missing translation for ' . $index; |
|
477 | + return 'Missing translation for '.$index; |
|
478 | 478 | } |
479 | 479 | } |
480 | 480 | } |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | $frameworkConfiguration['persistence']['storagePid'] = 0; |
187 | 187 | $this->configurationManager->setConfiguration($frameworkConfiguration); |
188 | 188 | |
189 | - $doPersist = false; |
|
189 | + $doPersist = FALSE; |
|
190 | 190 | |
191 | 191 | foreach ($formatsDefaults as $type => $values) { |
192 | 192 | // if default format record is not found, add it to the repository |
193 | - if ($this->formatRepository->findOneByType($type) === null) { |
|
193 | + if ($this->formatRepository->findOneByType($type) === NULL) { |
|
194 | 194 | $newRecord = GeneralUtility::makeInstance(Format::class); |
195 | 195 | $newRecord->setType($type); |
196 | 196 | $newRecord->setRoot($values['root']); |
@@ -198,12 +198,12 @@ discard block |
||
198 | 198 | $newRecord->setClass($values['class']); |
199 | 199 | $this->formatRepository->add($newRecord); |
200 | 200 | |
201 | - $doPersist = true; |
|
201 | + $doPersist = TRUE; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
205 | 205 | // We must persist here, if we changed anything. |
206 | - if ($doPersist === true) { |
|
206 | + if ($doPersist === TRUE) { |
|
207 | 207 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
208 | 208 | $persistenceManager->persistAll(); |
209 | 209 | } |
@@ -265,13 +265,13 @@ discard block |
||
265 | 265 | ]; |
266 | 266 | } |
267 | 267 | |
268 | - $metadataIds = Helper::processDatabaseAsAdmin($data, [], true); |
|
268 | + $metadataIds = Helper::processDatabaseAsAdmin($data, [], TRUE); |
|
269 | 269 | |
270 | 270 | $insertedMetadata = []; |
271 | 271 | foreach ($metadataIds as $id => $uid) { |
272 | 272 | $metadata = $this->metadataRepository->findByUid($uid); |
273 | 273 | // id array contains also ids of formats |
274 | - if ($metadata != null) { |
|
274 | + if ($metadata != NULL) { |
|
275 | 275 | $insertedMetadata[$uid] = $metadata->getIndexName(); |
276 | 276 | } |
277 | 277 | } |
@@ -307,12 +307,12 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function addSolrCoreAction(): void |
309 | 309 | { |
310 | - $doPersist = false; |
|
310 | + $doPersist = FALSE; |
|
311 | 311 | |
312 | 312 | // load language file in own array |
313 | 313 | $beLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_be.xlf', $this->siteLanguages[0]->getTypo3Language()); |
314 | 314 | |
315 | - if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
|
315 | + if ($this->solrCoreRepository->findOneByPid($this->pid) === NULL) { |
|
316 | 316 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
317 | 317 | $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
318 | 318 | $indexName = Solr::createCore(''); |
@@ -321,12 +321,12 @@ discard block |
||
321 | 321 | |
322 | 322 | $this->solrCoreRepository->add($newRecord); |
323 | 323 | |
324 | - $doPersist = true; |
|
324 | + $doPersist = TRUE; |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | |
328 | 328 | // We must persist here, if we changed anything. |
329 | - if ($doPersist === true) { |
|
329 | + if ($doPersist === TRUE) { |
|
330 | 330 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
331 | 331 | $persistenceManager->persistAll(); |
332 | 332 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | 'thumbnail' => 0, |
361 | 361 | ]; |
362 | 362 | } |
363 | - $structureIds = Helper::processDatabaseAsAdmin($data, [], true); |
|
363 | + $structureIds = Helper::processDatabaseAsAdmin($data, [], TRUE); |
|
364 | 364 | |
365 | 365 | $insertedStructures = []; |
366 | 366 | foreach ($structureIds as $id => $uid) { |
@@ -33,8 +33,7 @@ |
||
33 | 33 | * |
34 | 34 | * @access public |
35 | 35 | */ |
36 | -class SearchController extends AbstractController |
|
37 | -{ |
|
36 | +class SearchController extends AbstractController { |
|
38 | 37 | /** |
39 | 38 | * @access protected |
40 | 39 | * @var CollectionRepository |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
91 | 91 | |
92 | 92 | // output is done by main action |
93 | - $this->forward('main', null, null, ['searchParameter' => $this->searchParams]); |
|
93 | + $this->forward('main', NULL, NULL, ['searchParameter' => $this->searchParams]); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function mainAction(): void |
106 | 106 | { |
107 | - $listViewSearch = false; |
|
107 | + $listViewSearch = FALSE; |
|
108 | 108 | // Quit without doing anything if required variables are not set. |
109 | 109 | if (empty($this->settings['solrcore'])) { |
110 | 110 | $this->logger->warning('Incomplete plugin configuration'); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
120 | 120 | $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']); |
121 | - $listViewSearch = true; |
|
121 | + $listViewSearch = TRUE; |
|
122 | 122 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams); |
123 | 123 | } |
124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $this->redirect( |
147 | 147 | 'main', |
148 | 148 | 'ListView', |
149 | - null, |
|
149 | + NULL, |
|
150 | 150 | [ |
151 | 151 | 'searchParameter' => $this->searchParams, |
152 | 152 | 'page' => $currentPage |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | // An empty form will be shown. |
159 | 159 | if (is_array($this->searchParams) && !empty($this->searchParams)) { |
160 | 160 | // get all sortable metadata records |
161 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
161 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
162 | 162 | |
163 | 163 | // get all metadata records to be shown in results |
164 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
164 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
165 | 165 | |
166 | - $solrResults = null; |
|
166 | + $solrResults = NULL; |
|
167 | 167 | $numResults = 0; |
168 | 168 | // Do not execute the Solr search if used together with ListView plugin. |
169 | 169 | if (!$listViewSearch) { |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | // Get facets from plugin configuration. |
225 | 225 | $facets = []; |
226 | - foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
|
226 | + foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], TRUE) as $facet) { |
|
227 | 227 | $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
228 | 228 | } |
229 | 229 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | { |
381 | 381 | // if collections are given, we prepare the collections query string |
382 | 382 | // extract collections from collection parameter |
383 | - $collections = null; |
|
383 | + $collections = NULL; |
|
384 | 384 | if ($this->searchParams['collection']) { |
385 | 385 | foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) { |
386 | 386 | $collections[] = $this->collectionRepository->findByUid((int) $collectionEntry); |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | // Check if facet is already selected. |
441 | 441 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
442 | 442 | $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
443 | - if ($index !== false) { |
|
443 | + if ($index !== FALSE) { |
|
444 | 444 | // Facet is selected, thus remove it from filter. |
445 | 445 | unset($queryColumn[$index]); |
446 | 446 | $queryColumn = array_values($queryColumn); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | $state = 'ACTIFSUB'; |
449 | 449 | // Reset facets |
450 | 450 | if ($this->settings['resetFacets']) { |
451 | - $entryArray['resetFacet'] = true; |
|
451 | + $entryArray['resetFacet'] = TRUE; |
|
452 | 452 | $entryArray['queryColumn'] = $queryColumn; |
453 | 453 | } |
454 | 454 | } else { |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | } |
560 | 560 | |
561 | 561 | // Get field selector options. |
562 | - $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], true); |
|
562 | + $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], TRUE); |
|
563 | 563 | |
564 | 564 | $slotCountArray = []; |
565 | 565 | for ($i = 0; $i < $this->settings['extendedSlotCount']; $i++) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
125 | - $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']); |
|
125 | + $this->searchParams = array_merge($this->searchParams ? : [], $listRequestData['searchParameter']); |
|
126 | 126 | $listViewSearch = true; |
127 | 127 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams); |
128 | 128 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $simplePagination = new SimplePagination($solrPaginator); |
184 | 184 | |
185 | 185 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
186 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
186 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | $this->view->assign('documents', !empty($solrResults) ? $solrResults : []); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | // Add uHash parameter to suggest parameter to make a basic protection of this form. |
210 | 210 | if ($this->settings['suggest']) { |
211 | - $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest')); |
|
211 | + $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest')); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | $this->view->assign('viewData', $this->viewData); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | // Get facets from plugin configuration. |
230 | 230 | $facets = []; |
231 | 231 | foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
232 | - $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
232 | + $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets)); |
@@ -265,13 +265,13 @@ discard block |
||
265 | 265 | $searchParams = $this->searchParams; |
266 | 266 | if ( |
267 | 267 | (!empty($searchParams['fulltext'])) |
268 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
268 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
269 | 269 | ) { |
270 | 270 | // If the query already is a fulltext query e.g using the facets |
271 | 271 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
272 | 272 | // Search in fulltext field if applicable. Query must not be empty! |
273 | 273 | if (!empty($searchParams['query'])) { |
274 | - $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
274 | + $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
275 | 275 | } |
276 | 276 | } else { |
277 | 277 | // Retain given search field if valid. |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | // add filter query for date search |
289 | 289 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
290 | 290 | // combine dateFrom and dateTo into filterquery as range search |
291 | - $search['params']['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
291 | + $search['params']['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']'; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | // Add extended search query. |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
307 | 307 | ) { |
308 | 308 | if (!empty($search['query'])) { |
309 | - $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
309 | + $search['query'] .= ' '.$searchParams['extOperator'][$i].' '; |
|
310 | 310 | } |
311 | - $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
311 | + $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
312 | 312 | } |
313 | 313 | } |
314 | 314 | } |
@@ -397,24 +397,24 @@ discard block |
||
397 | 397 | foreach ($collections as $collectionEntry) { |
398 | 398 | // check for virtual collections query string |
399 | 399 | if ($collectionEntry->getIndexSearch()) { |
400 | - $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR (' . $collectionEntry->getIndexSearch() . ')'; |
|
400 | + $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collectionEntry->getIndexSearch().')' : ' OR ('.$collectionEntry->getIndexSearch().')'; |
|
401 | 401 | } else { |
402 | - $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"'; |
|
402 | + $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collectionEntry->getIndexName().'"' : ' OR "'.$collectionEntry->getIndexName().'"'; |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
406 | 406 | // distinguish between simple collection browsing and actual searching within the collection(s) |
407 | 407 | if (!empty($collectionsQueryString)) { |
408 | 408 | if (empty($query)) { |
409 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)'; |
|
409 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)'; |
|
410 | 410 | } else { |
411 | - $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))'; |
|
411 | + $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))'; |
|
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
415 | 415 | // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separately |
416 | 416 | if (!empty($virtualCollectionsQueryString)) { |
417 | - $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')'; |
|
417 | + $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')'; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | // combine both querystrings into a single filterquery via OR if both are given, otherwise pass either of those |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $entryArray['doNotLinkIt'] = 0; |
445 | 445 | // Check if facet is already selected. |
446 | 446 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
447 | - $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
|
447 | + $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn); |
|
448 | 448 | if ($index !== false) { |
449 | 449 | // Facet is selected, thus remove it from filter. |
450 | 450 | unset($queryColumn[$index]); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | } |
459 | 459 | } else { |
460 | 460 | // Facet is not selected, thus add it to filter. |
461 | - $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")'; |
|
461 | + $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")'; |
|
462 | 462 | $entryArray['ITEM_STATE'] = 'NO'; |
463 | 463 | } |
464 | 464 | $entryArray['queryColumn'] = $queryColumn; |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $metadata['video_duration'] = [$videoDuration]; |
54 | 54 | } |
55 | 55 | |
56 | - $metadata['duration'] = $metadata['video_duration'] ?: $metadata['audio_duration'] ?: []; |
|
56 | + $metadata['duration'] = $metadata['video_duration'] ? : $metadata['audio_duration'] ? : []; |
|
57 | 57 | |
58 | 58 | if ($useExternalApis) { |
59 | 59 | // TODO? |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class AudioVideoMD implements MetadataInterface |
|
29 | -{ |
|
28 | +class AudioVideoMD implements MetadataInterface { |
|
30 | 29 | /** |
31 | 30 | * Extract some essential AudioMD/VideoMD metadata. |
32 | 31 | * |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * |
39 | 39 | * @return void |
40 | 40 | */ |
41 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = false): void |
|
41 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = FALSE): void |
|
42 | 42 | { |
43 | 43 | $xml->registerXPathNamespace('audiomd', 'http://www.loc.gov/audioMD/'); |
44 | 44 | $xml->registerXPathNamespace('videomd', 'http://www.loc.gov/videoMD/'); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | return ' '; |
125 | 125 | } |
126 | - return htmlspecialchars((string) $attributes['CONTENT']) . ' '; |
|
126 | + return htmlspecialchars((string) $attributes['CONTENT']).' '; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | private function getCoordinates(\SimpleXMLElement $attributes): string |
139 | 139 | { |
140 | - return (string) $attributes['HPOS'] . ' ' . (string) $attributes['VPOS'] . ' ' . (string) $attributes['WIDTH'] . ' ' . (string) $attributes['HEIGHT']; |
|
140 | + return (string) $attributes['HPOS'].' '.(string) $attributes['VPOS'].' '.(string) $attributes['WIDTH'].' '.(string) $attributes['HEIGHT']; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -147,8 +147,7 @@ |
||
147 | 147 | * |
148 | 148 | * @param \SimpleXMLElement &$xml: The XML to register the namespace for |
149 | 149 | */ |
150 | - private function registerAltoNamespace(\SimpleXMLElement &$xml) |
|
151 | - { |
|
150 | + private function registerAltoNamespace(\SimpleXMLElement &$xml) { |
|
152 | 151 | $namespace = $xml->getDocNamespaces(); |
153 | 152 | |
154 | 153 | if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, true)) { |
@@ -151,11 +151,11 @@ |
||
151 | 151 | { |
152 | 152 | $namespace = $xml->getDocNamespaces(); |
153 | 153 | |
154 | - if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, true)) { |
|
154 | + if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, TRUE)) { |
|
155 | 155 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v2#'); |
156 | - } elseif (in_array('http://www.loc.gov/standards/alto/ns-v3#', $namespace, true)) { |
|
156 | + } elseif (in_array('http://www.loc.gov/standards/alto/ns-v3#', $namespace, TRUE)) { |
|
157 | 157 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v3#'); |
158 | - } elseif (in_array('http://www.loc.gov/standards/alto/ns-v4#', $namespace, true)) { |
|
158 | + } elseif (in_array('http://www.loc.gov/standards/alto/ns-v4#', $namespace, TRUE)) { |
|
159 | 159 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v4#'); |
160 | 160 | } |
161 | 161 | } |