@@ -68,7 +68,7 @@ |
||
68 | 68 | $pageGridPagination = new PageGridPagination($pageGridPaginator); |
69 | 69 | |
70 | 70 | $pagination = $this->buildSimplePagination($pageGridPagination, $pageGridPaginator); |
71 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $pageGridPaginator ]); |
|
71 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $pageGridPaginator]); |
|
72 | 72 | |
73 | 73 | $this->view->assign('docUid', $this->requestData['id']); |
74 | 74 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class PageGridController extends AbstractController |
|
27 | -{ |
|
26 | +class PageGridController extends AbstractController { |
|
28 | 27 | /** |
29 | 28 | * The main method of the plugin |
30 | 29 | * |
@@ -27,8 +27,7 @@ |
||
27 | 27 | * |
28 | 28 | * @access public |
29 | 29 | */ |
30 | -class MetadataController extends AbstractController |
|
31 | -{ |
|
30 | +class MetadataController extends AbstractController { |
|
32 | 31 | /** |
33 | 32 | * @access private |
34 | 33 | * @var AbstractDocument |
@@ -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 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | if (empty(array_filter($metadata))) { |
139 | - $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid()); |
|
139 | + $this->logger->warning('No metadata found for document with UID '.$this->document->getUid()); |
|
140 | 140 | return; |
141 | 141 | } |
142 | 142 | ksort($metadata); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $this->parseMetadata($i, $name, $value, $metadata); |
175 | 175 | |
176 | 176 | if (is_array($metadata[$i][$name])) { |
177 | - $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function ($metadataValue) { |
|
177 | + $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) { |
|
178 | 178 | return !empty($metadataValue); |
179 | 179 | })); |
180 | 180 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
392 | 392 | $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), true); |
393 | 393 | if (!empty($superiorTitle)) { |
394 | - $metadata[$i]['title'] = ['[' . $superiorTitle . ']']; |
|
394 | + $metadata[$i]['title'] = ['['.$superiorTitle.']']; |
|
395 | 395 | } |
396 | 396 | } |
397 | 397 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class TableOfContentsController extends AbstractController |
|
27 | -{ |
|
26 | +class TableOfContentsController extends AbstractController { |
|
28 | 27 | /** |
29 | 28 | * This holds the active entries according to the currently selected page |
30 | 29 | * |
@@ -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. |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries. |
164 | - $entryArray['ITEM_STATE'] = ($entryArray['ITEM_STATE'] == 'NO' ? 'IFSUB' : $entryArray['ITEM_STATE'] . 'IFSUB'); |
|
164 | + $entryArray['ITEM_STATE'] = ($entryArray['ITEM_STATE'] == 'NO' ? 'IFSUB' : $entryArray['ITEM_STATE'].'IFSUB'); |
|
165 | 165 | } |
166 | 166 | return $entryArray; |
167 | 167 | } |
@@ -338,16 +338,16 @@ discard block |
||
338 | 338 | $title = ''; |
339 | 339 | foreach ($fields as $field) { |
340 | 340 | if ($field == 'type') { |
341 | - $title .= $this->getTranslatedType($entry['type']) . ' '; |
|
341 | + $title .= $this->getTranslatedType($entry['type']).' '; |
|
342 | 342 | } else { |
343 | - $title .= $entry[$field] . ' '; |
|
343 | + $title .= $entry[$field].' '; |
|
344 | 344 | } |
345 | 345 | } |
346 | 346 | return trim($title); |
347 | 347 | } |
348 | 348 | } |
349 | 349 | } |
350 | - return $label ?: $orderLabel; |
|
350 | + return $label ? : $orderLabel; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | { |
383 | 383 | usort( |
384 | 384 | $menu[0]['_SUB_MENU'], |
385 | - function ($firstElement, $secondElement) { |
|
385 | + function($firstElement, $secondElement) { |
|
386 | 386 | if (!empty($firstElement['orderlabel'])) { |
387 | 387 | return $firstElement['orderlabel'] <=> $secondElement['orderlabel']; |
388 | 388 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | if ($library) { |
76 | 76 | $feedMeta['copyright'] = $library->getLabel(); |
77 | 77 | } else { |
78 | - $this->logger->error('Failed to fetch label of selected library with "' . $this->settings['library'] . '"'); |
|
78 | + $this->logger->error('Failed to fetch label of selected library with "'.$this->settings['library'].'"'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | if ( |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | ) { |
96 | 96 | $superiorTitle = AbstractDocument::getTitle($document->getPartof(), true); |
97 | 97 | if (!empty($superiorTitle)) { |
98 | - $title .= '[' . $superiorTitle . ']'; |
|
98 | + $title .= '['.$superiorTitle.']'; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | // Get title of document. |
102 | 102 | if (!empty($document->getTitle())) { |
103 | - $title .= ' ' . $document->getTitle(); |
|
103 | + $title .= ' '.$document->getTitle(); |
|
104 | 104 | } |
105 | 105 | // Set default title if empty. |
106 | 106 | if (empty($title)) { |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | } |
109 | 109 | // Append volume information. |
110 | 110 | if (!empty($document->getVolume())) { |
111 | - $title .= ', ' . LocalizationUtility::translate('volume', 'dlf') . ' ' . $document->getVolume(); |
|
111 | + $title .= ', '.LocalizationUtility::translate('volume', 'dlf').' '.$document->getVolume(); |
|
112 | 112 | } |
113 | 113 | // Is this document new or updated? |
114 | 114 | if ($document->getCrdate() == $document->getTstamp()) { |
115 | - $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf') . ' ' . trim($title); |
|
115 | + $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf').' '.trim($title); |
|
116 | 116 | } else { |
117 | - $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf') . ' ' . trim($title); |
|
117 | + $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf').' '.trim($title); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | $document->setTitle($title); |
@@ -24,8 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class FeedsController extends AbstractController |
|
28 | -{ |
|
27 | +class FeedsController extends AbstractController { |
|
29 | 28 | |
30 | 29 | /** |
31 | 30 | * @access protected |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | || GeneralUtility::inList($this->settings['collections'], $requestData['collection']) |
85 | 85 | ) { |
86 | 86 | |
87 | - $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], true), $this->settings['limit']); |
|
87 | + $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], TRUE), $this->settings['limit']); |
|
88 | 88 | |
89 | 89 | foreach ($documents as $document) { |
90 | 90 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | if ((empty($document->getTitle()) || !empty($this->settings['prependSuperiorTitle'])) |
94 | 94 | && !empty($document->getPartof()) |
95 | 95 | ) { |
96 | - $superiorTitle = AbstractDocument::getTitle($document->getPartof(), true); |
|
96 | + $superiorTitle = AbstractDocument::getTitle($document->getPartof(), TRUE); |
|
97 | 97 | if (!empty($superiorTitle)) { |
98 | 98 | $title .= '[' . $superiorTitle . ']'; |
99 | 99 | } |
@@ -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 | } |
@@ -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); |
@@ -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 | } |
@@ -288,12 +288,12 @@ discard block |
||
288 | 288 | |
289 | 289 | $docData = $this->getDocumentData((int) $id, $data); |
290 | 290 | |
291 | - $entryKey = $id . '_' . $startPage; |
|
291 | + $entryKey = $id.'_'.$startPage; |
|
292 | 292 | if (!empty($startX)) { |
293 | - $entryKey .= '_' . $startX; |
|
293 | + $entryKey .= '_'.$startX; |
|
294 | 294 | } |
295 | 295 | if (!empty($endX)) { |
296 | - $entryKey .= '_' . $endX; |
|
296 | + $entryKey .= '_'.$endX; |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | $entry = [ |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : (int) $data['endY'], $urlParams); |
353 | 353 | $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : (int) $data['rotation'], $urlParams); |
354 | 354 | |
355 | - $downloadUrl = $this->settings['pdfgenerate'] . $urlParams; |
|
355 | + $downloadUrl = $this->settings['pdfgenerate'].$urlParams; |
|
356 | 356 | |
357 | 357 | $title = $this->document->getTitle(); |
358 | 358 | if (empty($title)) { |
@@ -363,15 +363,15 @@ discard block |
||
363 | 363 | $info = ''; |
364 | 364 | if ($data['startX'] != '' && $data['endX'] != '') { |
365 | 365 | // cutout |
366 | - $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')) . ' '; |
|
366 | + $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')).' '; |
|
367 | 367 | } |
368 | 368 | if ($data['startpage'] == $data['endpage']) { |
369 | 369 | // One page |
370 | - $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage']; |
|
370 | + $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage']; |
|
371 | 371 | } else { |
372 | - $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage'] . '-' . $data['endpage']; |
|
372 | + $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage'].'-'.$data['endpage']; |
|
373 | 373 | } |
374 | - $downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . htmlspecialchars($title) . '</a> (' . $info . ')'; |
|
374 | + $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.htmlspecialchars($title).'</a> ('.$info.')'; |
|
375 | 375 | if ($data['startpage'] == $data['endpage']) { |
376 | 376 | $pageNums = 1; |
377 | 377 | } else { |
@@ -444,12 +444,12 @@ discard block |
||
444 | 444 | if ($piVars['addToBasket'] == 'list') { |
445 | 445 | $documentItem['endpage'] = $this->document->getCurrentDocument()->numPages; |
446 | 446 | } |
447 | - $arrayKey = $documentItem['id'] . '_' . $page; |
|
447 | + $arrayKey = $documentItem['id'].'_'.$page; |
|
448 | 448 | if (!empty($documentItem['startX'])) { |
449 | - $arrayKey .= '_' . $documentItem['startX']; |
|
449 | + $arrayKey .= '_'.$documentItem['startX']; |
|
450 | 450 | } |
451 | 451 | if (!empty($documentItem['endX'])) { |
452 | - $arrayKey .= '_' . $documentItem['endX']; |
|
452 | + $arrayKey .= '_'.$documentItem['endX']; |
|
453 | 453 | } |
454 | 454 | // do not add more than one identical object |
455 | 455 | if (!in_array($arrayKey, $items)) { |
@@ -470,14 +470,14 @@ discard block |
||
470 | 470 | // remove parameter endpage |
471 | 471 | $pdfParams = str_replace(",##endpage##", '', $pdfParams); |
472 | 472 | } |
473 | - $pdfGenerateUrl = $this->settings['pdfgenerate'] . $pdfParams; |
|
473 | + $pdfGenerateUrl = $this->settings['pdfgenerate'].$pdfParams; |
|
474 | 474 | if ($this->settings['pregeneration']) { |
475 | 475 | // send ajax request to webapp |
476 | 476 | $output .= ' |
477 | 477 | <script> |
478 | 478 | $(document).ready(function(){ |
479 | 479 | $.ajax({ |
480 | - url: "' . $pdfGenerateUrl . '", |
|
480 | + url: "' . $pdfGenerateUrl.'", |
|
481 | 481 | }).done(function() { |
482 | 482 | }); |
483 | 483 | }); |
@@ -515,12 +515,12 @@ discard block |
||
515 | 515 | } |
516 | 516 | foreach ($piVars['selected'] as $value) { |
517 | 517 | if (isset($value['id'])) { |
518 | - $arrayKey = $value['id'] . '_' . $value['startpage']; |
|
518 | + $arrayKey = $value['id'].'_'.$value['startpage']; |
|
519 | 519 | if (!empty($value['startX'])) { |
520 | - $arrayKey .= '_' . $value['startX']; |
|
520 | + $arrayKey .= '_'.$value['startX']; |
|
521 | 521 | } |
522 | 522 | if (!empty($value['endX'])) { |
523 | - $arrayKey .= '_' . $value['endX']; |
|
523 | + $arrayKey .= '_'.$value['endX']; |
|
524 | 524 | } |
525 | 525 | if (isset($items[$arrayKey])) { |
526 | 526 | unset($items[$arrayKey]); |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | |
554 | 554 | $mailObject = $this->mailRepository->findByUid(intval($mailId))->getFirst(); |
555 | 555 | |
556 | - $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf')) . "\n"; |
|
556 | + $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf'))."\n"; |
|
557 | 557 | $numberOfPages = 0; |
558 | 558 | $pdfUrl = $this->settings['pdfdownload']; |
559 | 559 | // prepare links |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | if ($docValue['id']) { |
562 | 562 | $explodeId = explode("_", $docValue['id']); |
563 | 563 | $docData = $this->getDocumentData((int) $explodeId[0], $docValue); |
564 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
564 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
565 | 565 | $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage']))); |
566 | 566 | if ($pages === 0) { |
567 | 567 | $numberOfPages = $numberOfPages + 1; |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | } |
573 | 573 | // Remove leading/tailing pdfparamseperator |
574 | 574 | $pdfUrl = trim($pdfUrl, $this->settings['pdfparamseparator']); |
575 | - $mailBody = $mailText . $pdfUrl; |
|
575 | + $mailBody = $mailText.$pdfUrl; |
|
576 | 576 | // Get hook objects. |
577 | 577 | $hookObjects = Helper::getHookObjects('Classes/Controller/BasketController.php'); |
578 | 578 | // Hook for getting a customized mail body. |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | $newActionLog = GeneralUtility::makeInstance(ActionLog::class); |
600 | 600 | $newActionLog->setFileName($pdfUrl); |
601 | 601 | $newActionLog->setCountPages($numberOfPages); |
602 | - $newActionLog->setLabel('Mail: ' . $mailObject->getMail()); |
|
602 | + $newActionLog->setLabel('Mail: '.$mailObject->getMail()); |
|
603 | 603 | |
604 | 604 | if ($GLOBALS["TSFE"]->loginUser) { |
605 | 605 | // internal user |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | foreach ($this->requestData['selected'] as $docId => $docValue) { |
631 | 631 | if ($docValue['id']) { |
632 | 632 | $docData = $this->getDocumentData((int) $docValue['id'], $docValue); |
633 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
633 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
634 | 634 | $numberOfPages += $docData['pageNums']; |
635 | 635 | } |
636 | 636 | } |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | if ($docValue['id']) { |
649 | 649 | $explodeId = explode("_", $docId); |
650 | 650 | $docData = $this->getDocumentData((int) $explodeId[0], $docValue); |
651 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
651 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
652 | 652 | $numberOfPages += $docData['pageNums']; |
653 | 653 | } |
654 | 654 | } |
@@ -665,12 +665,12 @@ discard block |
||
665 | 665 | // internal user |
666 | 666 | $actionLog->setUserId($GLOBALS["TSFE"]->fe_user->user['uid']); |
667 | 667 | $actionLog->setName($GLOBALS["TSFE"]->fe_user->user['username']); |
668 | - $actionLog->setLabel('Print: ' . $printer->getLabel()); |
|
668 | + $actionLog->setLabel('Print: '.$printer->getLabel()); |
|
669 | 669 | } else { |
670 | 670 | // external user |
671 | 671 | $actionLog->setUserId(0); |
672 | 672 | $actionLog->setName('n/a'); |
673 | - $actionLog->setLabel('Print: ' . $printer->getLabel()); |
|
673 | + $actionLog->setLabel('Print: '.$printer->getLabel()); |
|
674 | 674 | } |
675 | 675 | // add action to protocol |
676 | 676 | $this->actionLogRepository->add($actionLog); |
@@ -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,16 +149,16 @@ 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 indexed metadata fields |
155 | - $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true); |
|
155 | + $indexedMetadata = $this->metadataRepository->findByIndexIndexed(TRUE); |
|
156 | 156 | |
157 | 157 | // get all sortable metadata records |
158 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
158 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
159 | 159 | |
160 | 160 | // get all documents of given collection |
161 | - $solrResults = null; |
|
161 | + $solrResults = NULL; |
|
162 | 162 | if (is_array($searchParams) && !empty($searchParams)) { |
163 | 163 | $solrResults = $this->documentRepository->findSolrByCollection($collection, $this->settings, $searchParams, $listedMetadata, $indexedMetadata); |
164 | 164 | |
@@ -194,13 +194,13 @@ discard block |
||
194 | 194 | // if search was triggered, get search parameters from POST variables |
195 | 195 | $searchParams = $this->getParametersSafely('searchParameter'); |
196 | 196 | |
197 | - $collection = null; |
|
197 | + $collection = NULL; |
|
198 | 198 | if ($searchParams['collection']['__identity'] && MathUtility::canBeInterpretedAsInteger($searchParams['collection']['__identity'])) { |
199 | 199 | $collection = $this->collectionRepository->findByUid($searchParams['collection']['__identity']); |
200 | 200 | } |
201 | 201 | |
202 | 202 | // output is done by show action |
203 | - $this->forward('show', null, null, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
203 | + $this->forward('show', NULL, NULL, ['searchParameter' => $searchParams, 'collection' => $collection]); |
|
204 | 204 | |
205 | 205 | } |
206 | 206 |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $simplePagination = new SimplePagination($solrPaginator); |
169 | 169 | |
170 | 170 | $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator); |
171 | - $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]); |
|
171 | + $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $this->view->assign('viewData', $this->viewData); |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | foreach ($collections as $collection) { |
221 | 221 | $solrQuery = ''; |
222 | 222 | if ($collection->getIndexSearch() != '') { |
223 | - $solrQuery .= '(' . $collection->getIndexSearch() . ')'; |
|
223 | + $solrQuery .= '('.$collection->getIndexSearch().')'; |
|
224 | 224 | } else { |
225 | - $solrQuery .= 'collection:("' . Solr::escapeQuery($collection->getIndexName()) . '")'; |
|
225 | + $solrQuery .= 'collection:("'.Solr::escapeQuery($collection->getIndexName()).'")'; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | // We only care about the UID and partOf in the results and want them sorted |
@@ -236,11 +236,11 @@ discard block |
||
236 | 236 | if ($collection->getIndexSearch()) { |
237 | 237 | $params['query'] = $solrQuery; |
238 | 238 | } else { |
239 | - $params['query'] = $solrQuery . ' AND partof:0 AND toplevel:true'; |
|
239 | + $params['query'] = $solrQuery.' AND partof:0 AND toplevel:true'; |
|
240 | 240 | } |
241 | 241 | $partOfNothing = $solr->searchRaw($params); |
242 | 242 | |
243 | - $params['query'] = $solrQuery . ' AND NOT partof:0 AND toplevel:true'; |
|
243 | + $params['query'] = $solrQuery.' AND NOT partof:0 AND toplevel:true'; |
|
244 | 244 | $partOfSomething = $solr->searchRaw($params); |
245 | 245 | |
246 | 246 | $collectionInfo = []; |
@@ -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 |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | $data['tx_dlf_metadata'][uniqid('NEW')] = [ |
252 | 252 | 'pid' => $this->pid, |
253 | - 'label' => $this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels), |
|
253 | + 'label' => $this->getLLL('metadata.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels), |
|
254 | 254 | 'index_name' => $indexName, |
255 | 255 | 'format' => implode(',', $formatIds), |
256 | 256 | 'default_value' => $values['default_value'], |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | 'pid' => $this->pid, |
290 | 290 | 'sys_language_uid' => $siteLanguage->getLanguageId(), |
291 | 291 | 'l18n_parent' => $id, |
292 | - 'label' => $this->getLLL('metadata.' . $indexName, $siteLanguage->getTypo3Language(), $metadataLabels), |
|
292 | + 'label' => $this->getLLL('metadata.'.$indexName, $siteLanguage->getTypo3Language(), $metadataLabels), |
|
293 | 293 | ]; |
294 | 294 | } |
295 | 295 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
317 | 317 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
318 | - $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
|
318 | + $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels).' (PID '.$this->pid.')'); |
|
319 | 319 | $indexName = Solr::createCore(''); |
320 | 320 | if (!empty($indexName)) { |
321 | 321 | $newRecord->setIndexName($indexName); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $data['tx_dlf_structures'][uniqid('NEW')] = [ |
356 | 356 | 'pid' => $this->pid, |
357 | 357 | 'toplevel' => $values['toplevel'], |
358 | - 'label' => $this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels), |
|
358 | + 'label' => $this->getLLL('structure.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels), |
|
359 | 359 | 'index_name' => $indexName, |
360 | 360 | 'oai_name' => $values['oai_name'], |
361 | 361 | 'thumbnail' => 0, |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | 'pid' => $this->pid, |
381 | 381 | 'sys_language_uid' => $siteLanguage->getLanguageId(), |
382 | 382 | 'l18n_parent' => $id, |
383 | - 'label' => $this->getLLL('structure.' . $indexName, $siteLanguage->getTypo3Language(), $structureLabels), |
|
383 | + 'label' => $this->getLLL('structure.'.$indexName, $siteLanguage->getTypo3Language(), $structureLabels), |
|
384 | 384 | ]; |
385 | 385 | } |
386 | 386 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | } elseif (isset($langArray['default'][$index][0]['target'])) { |
476 | 476 | return $langArray['default'][$index][0]['target']; |
477 | 477 | } else { |
478 | - return 'Missing translation for ' . $index; |
|
478 | + return 'Missing translation for '.$index; |
|
479 | 479 | } |
480 | 480 | } |
481 | 481 | |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | */ |
491 | 491 | private function getRecords(string $recordType): array |
492 | 492 | { |
493 | - $filePath = Environment::getPublicPath() . '/typo3conf/ext/dlf/Resources/Private/Data/' . $recordType . 'Defaults.json'; |
|
493 | + $filePath = Environment::getPublicPath().'/typo3conf/ext/dlf/Resources/Private/Data/'.$recordType.'Defaults.json'; |
|
494 | 494 | |
495 | 495 | $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class); |
496 | 496 | $fileObject = $resourceFactory->getFileObjectFromCombinedIdentifier($filePath); |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | $frameworkConfiguration['persistence']['storagePid'] = 0; |
188 | 188 | $this->configurationManager->setConfiguration($frameworkConfiguration); |
189 | 189 | |
190 | - $doPersist = false; |
|
190 | + $doPersist = FALSE; |
|
191 | 191 | |
192 | 192 | foreach ($formatsDefaults as $type => $values) { |
193 | 193 | // if default format record is not found, add it to the repository |
194 | - if ($this->formatRepository->findOneByType($type) === null) { |
|
194 | + if ($this->formatRepository->findOneByType($type) === NULL) { |
|
195 | 195 | $newRecord = GeneralUtility::makeInstance(Format::class); |
196 | 196 | $newRecord->setType($type); |
197 | 197 | $newRecord->setRoot($values['root']); |
@@ -199,12 +199,12 @@ discard block |
||
199 | 199 | $newRecord->setClass($values['class']); |
200 | 200 | $this->formatRepository->add($newRecord); |
201 | 201 | |
202 | - $doPersist = true; |
|
202 | + $doPersist = TRUE; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | |
206 | 206 | // We must persist here, if we changed anything. |
207 | - if ($doPersist === true) { |
|
207 | + if ($doPersist === TRUE) { |
|
208 | 208 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
209 | 209 | $persistenceManager->persistAll(); |
210 | 210 | } |
@@ -266,13 +266,13 @@ discard block |
||
266 | 266 | ]; |
267 | 267 | } |
268 | 268 | |
269 | - $metadataIds = Helper::processDatabaseAsAdmin($data, [], true); |
|
269 | + $metadataIds = Helper::processDatabaseAsAdmin($data, [], TRUE); |
|
270 | 270 | |
271 | 271 | $insertedMetadata = []; |
272 | 272 | foreach ($metadataIds as $id => $uid) { |
273 | 273 | $metadata = $this->metadataRepository->findByUid($uid); |
274 | 274 | // id array contains also ids of formats |
275 | - if ($metadata != null) { |
|
275 | + if ($metadata != NULL) { |
|
276 | 276 | $insertedMetadata[$uid] = $metadata->getIndexName(); |
277 | 277 | } |
278 | 278 | } |
@@ -308,12 +308,12 @@ discard block |
||
308 | 308 | */ |
309 | 309 | public function addSolrCoreAction(): void |
310 | 310 | { |
311 | - $doPersist = false; |
|
311 | + $doPersist = FALSE; |
|
312 | 312 | |
313 | 313 | // load language file in own array |
314 | 314 | $beLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_be.xlf', $this->siteLanguages[0]->getTypo3Language()); |
315 | 315 | |
316 | - if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
|
316 | + if ($this->solrCoreRepository->findOneByPid($this->pid) === NULL) { |
|
317 | 317 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
318 | 318 | $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
319 | 319 | $indexName = Solr::createCore(''); |
@@ -322,12 +322,12 @@ discard block |
||
322 | 322 | |
323 | 323 | $this->solrCoreRepository->add($newRecord); |
324 | 324 | |
325 | - $doPersist = true; |
|
325 | + $doPersist = TRUE; |
|
326 | 326 | } |
327 | 327 | } |
328 | 328 | |
329 | 329 | // We must persist here, if we changed anything. |
330 | - if ($doPersist === true) { |
|
330 | + if ($doPersist === TRUE) { |
|
331 | 331 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
332 | 332 | $persistenceManager->persistAll(); |
333 | 333 | } |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | 'thumbnail' => 0, |
362 | 362 | ]; |
363 | 363 | } |
364 | - $structureIds = Helper::processDatabaseAsAdmin($data, [], true); |
|
364 | + $structureIds = Helper::processDatabaseAsAdmin($data, [], TRUE); |
|
365 | 365 | |
366 | 366 | $insertedStructures = []; |
367 | 367 | foreach ($structureIds as $id => $uid) { |
@@ -495,9 +495,9 @@ discard block |
||
495 | 495 | $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class); |
496 | 496 | $fileObject = $resourceFactory->getFileObjectFromCombinedIdentifier($filePath); |
497 | 497 | |
498 | - if ($fileObject !== null) { |
|
498 | + if ($fileObject !== NULL) { |
|
499 | 499 | $fileContents = $fileObject->getContents(); |
500 | - $records = json_decode($fileContents, true); |
|
500 | + $records = json_decode($fileContents, TRUE); |
|
501 | 501 | |
502 | 502 | if (json_last_error() === JSON_ERROR_NONE) { |
503 | 503 | return $records; |
@@ -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 |
@@ -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; |
@@ -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'); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
125 | 125 | $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']); |
126 | - $listViewSearch = true; |
|
126 | + $listViewSearch = TRUE; |
|
127 | 127 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams); |
128 | 128 | } |
129 | 129 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $this->redirect( |
156 | 156 | 'main', |
157 | 157 | 'ListView', |
158 | - null, |
|
158 | + NULL, |
|
159 | 159 | [ |
160 | 160 | 'searchParameter' => $this->searchParams, |
161 | 161 | 'page' => $currentPage |
@@ -167,15 +167,15 @@ discard block |
||
167 | 167 | // An empty form will be shown. |
168 | 168 | if (is_array($this->searchParams) && !empty($this->searchParams)) { |
169 | 169 | // get all sortable metadata records |
170 | - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); |
|
170 | + $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE); |
|
171 | 171 | |
172 | 172 | // get all metadata records to be shown in results |
173 | - $listedMetadata = $this->metadataRepository->findByIsListed(true); |
|
173 | + $listedMetadata = $this->metadataRepository->findByIsListed(TRUE); |
|
174 | 174 | |
175 | 175 | // get all indexed metadata fields |
176 | - $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true); |
|
176 | + $indexedMetadata = $this->metadataRepository->findByIndexIndexed(TRUE); |
|
177 | 177 | |
178 | - $solrResults = null; |
|
178 | + $solrResults = NULL; |
|
179 | 179 | $numResults = 0; |
180 | 180 | // Do not execute the Solr search if used together with ListView plugin. |
181 | 181 | if (!$listViewSearch) { |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | // Get facets from plugin configuration. |
237 | 237 | $facets = []; |
238 | - foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) { |
|
238 | + foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], TRUE) as $facet) { |
|
239 | 239 | $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']); |
240 | 240 | } |
241 | 241 | |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | { |
393 | 393 | // if collections are given, we prepare the collections query string |
394 | 394 | // extract collections from collection parameter |
395 | - $collections = null; |
|
395 | + $collections = NULL; |
|
396 | 396 | if (array_key_exists('collection', $this->searchParams)) { |
397 | 397 | foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) { |
398 | 398 | $collections[] = $this->collectionRepository->findByUid((int) $collectionEntry); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | // Check if facet is already selected. |
453 | 453 | $queryColumn = array_column($search['params']['filterquery'], 'query'); |
454 | 454 | $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn); |
455 | - if ($index !== false) { |
|
455 | + if ($index !== FALSE) { |
|
456 | 456 | // Facet is selected, thus remove it from filter. |
457 | 457 | unset($queryColumn[$index]); |
458 | 458 | $queryColumn = array_values($queryColumn); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | $state = 'ACTIFSUB'; |
461 | 461 | // Reset facets |
462 | 462 | if ($this->settings['resetFacets']) { |
463 | - $entryArray['resetFacet'] = true; |
|
463 | + $entryArray['resetFacet'] = TRUE; |
|
464 | 464 | $entryArray['queryColumn'] = $queryColumn; |
465 | 465 | } |
466 | 466 | } else { |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | } |
572 | 572 | |
573 | 573 | // Get field selector options. |
574 | - $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], true); |
|
574 | + $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], TRUE); |
|
575 | 575 | |
576 | 576 | $slotCountArray = []; |
577 | 577 | for ($i = 0; $i < $this->settings['extendedSlotCount']; $i++) { |