@@ -55,7 +55,7 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | if ($this->settings['useInternalProxy']) { |
58 | - $absoluteUri = !empty($this->settings['forceAbsoluteUrl']) ? true : false; |
|
58 | + $absoluteUri = !empty($this->settings['forceAbsoluteUrl']) ? TRUE : FALSE; |
|
59 | 59 | |
60 | 60 | $model = $this->uriBuilder->reset() |
61 | 61 | ->setTargetPageUid($GLOBALS['TSFE']->id) |
@@ -24,8 +24,7 @@ discard block |
||
24 | 24 | * @subpackage dlf |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class TableOfContentsController extends AbstractController |
|
28 | -{ |
|
27 | +class TableOfContentsController extends AbstractController { |
|
29 | 28 | /** |
30 | 29 | * This holds the active entries according to the currently selected page |
31 | 30 | * |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | * |
40 | 39 | * @return void |
41 | 40 | */ |
42 | - public function mainAction() |
|
43 | - { |
|
41 | + public function mainAction() { |
|
44 | 42 | // Load current document. |
45 | 43 | $this->loadDocument($this->requestData); |
46 | 44 | if ($this->isDocMissing()) { |
@@ -63,8 +61,7 @@ discard block |
||
63 | 61 | * @access protected |
64 | 62 | * @return array HMENU array |
65 | 63 | */ |
66 | - protected function makeMenuArray() |
|
67 | - { |
|
64 | + protected function makeMenuArray() { |
|
68 | 65 | // Set default values for page if not set. |
69 | 66 | // $this->requestData['page'] may be integer or string (physical structure @ID) |
70 | 67 | if ( |
@@ -140,8 +137,7 @@ discard block |
||
140 | 137 | * |
141 | 138 | * @return array HMENU array for menu entry |
142 | 139 | */ |
143 | - protected function getMenuEntry(array $entry, $recursive = false) |
|
144 | - { |
|
140 | + protected function getMenuEntry(array $entry, $recursive = false) { |
|
145 | 141 | $entry = $this->resolveMenuEntry($entry); |
146 | 142 | |
147 | 143 | $entryArray = []; |
@@ -235,8 +231,7 @@ discard block |
||
235 | 231 | * @param array $entry |
236 | 232 | * @return array |
237 | 233 | */ |
238 | - protected function resolveMenuEntry($entry) |
|
239 | - { |
|
234 | + protected function resolveMenuEntry($entry) { |
|
240 | 235 | // If the menu entry points to the parent document, |
241 | 236 | // resolve to the parent UID set on indexation. |
242 | 237 | $doc = $this->document->getDoc(); |
@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | } |
100 | 100 | // Go through table of contents and create all menu entries. |
101 | 101 | foreach ($this->document->getDoc()->tableOfContents as $entry) { |
102 | - $menuArray[] = $this->getMenuEntry($entry, true); |
|
102 | + $menuArray[] = $this->getMenuEntry($entry, TRUE); |
|
103 | 103 | } |
104 | 104 | } else { |
105 | 105 | // Go through table of contents and create top-level menu entries. |
106 | 106 | foreach ($this->document->getDoc()->tableOfContents as $entry) { |
107 | - $menuArray[] = $this->getMenuEntry($entry, false); |
|
107 | + $menuArray[] = $this->getMenuEntry($entry, FALSE); |
|
108 | 108 | } |
109 | 109 | // Build table of contents from database. |
110 | 110 | $result = $this->documentRepository->getTableOfContentsFromDb($this->document->getUid(), $this->document->getPid(), $this->settings); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | 'pagination' => '', |
124 | 124 | 'targetUid' => $resArray['uid'] |
125 | 125 | ]; |
126 | - $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false); |
|
126 | + $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * |
141 | 141 | * @return array HMENU array for menu entry |
142 | 142 | */ |
143 | - protected function getMenuEntry(array $entry, $recursive = false) |
|
143 | + protected function getMenuEntry(array $entry, $recursive = FALSE) |
|
144 | 144 | { |
145 | 145 | $entry = $this->resolveMenuEntry($entry); |
146 | 146 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | // Build sub-menu if available and called recursively. |
200 | 200 | if ( |
201 | - $recursive === true |
|
201 | + $recursive === TRUE |
|
202 | 202 | && !empty($entry['children']) |
203 | 203 | ) { |
204 | 204 | // Build sub-menu only if one of the following conditions apply: |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | if (in_array($child['id'], $this->activeEntries)) { |
217 | 217 | $entryArray['ITEM_STATE'] = 'ACT'; |
218 | 218 | } |
219 | - $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true); |
|
219 | + $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE); |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries. |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * @subpackage dlf |
27 | 27 | * @access public |
28 | 28 | */ |
29 | -class PageViewController extends AbstractController |
|
30 | -{ |
|
29 | +class PageViewController extends AbstractController { |
|
31 | 30 | /** |
32 | 31 | * Holds the controls to add to the map |
33 | 32 | * |
@@ -65,8 +64,7 @@ discard block |
||
65 | 64 | * |
66 | 65 | * @return void |
67 | 66 | */ |
68 | - public function mainAction() |
|
69 | - { |
|
67 | + public function mainAction() { |
|
70 | 68 | // Load current document. |
71 | 69 | $this->loadDocument($this->requestData); |
72 | 70 | if ($this->isDocMissingOrEmpty()) { |
@@ -118,8 +116,7 @@ discard block |
||
118 | 116 | * |
119 | 117 | * @return array URL and MIME type of fulltext file |
120 | 118 | */ |
121 | - protected function getFulltext($page) |
|
122 | - { |
|
119 | + protected function getFulltext($page) { |
|
123 | 120 | $fulltext = []; |
124 | 121 | // Get fulltext link. |
125 | 122 | $fileGrpsFulltext = GeneralUtility::trimExplode(',', $this->extConf['fileGrpFulltext']); |
@@ -159,8 +156,7 @@ discard block |
||
159 | 156 | * |
160 | 157 | * @return void |
161 | 158 | */ |
162 | - protected function addViewerJS() |
|
163 | - { |
|
159 | + protected function addViewerJS() { |
|
164 | 160 | // Viewer configuration. |
165 | 161 | $viewerConfiguration = '$(document).ready(function() { |
166 | 162 | if (dlfUtils.exists(dlfViewer)) { |
@@ -187,8 +183,7 @@ discard block |
||
187 | 183 | * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as |
188 | 184 | * some information about the canvas. |
189 | 185 | */ |
190 | - protected function getAnnotationContainers($page) |
|
191 | - { |
|
186 | + protected function getAnnotationContainers($page) { |
|
192 | 187 | if ($this->document->getDoc() instanceof IiifManifest) { |
193 | 188 | $canvasId = $this->document->getDoc()->physicalStructure[$page]; |
194 | 189 | $iiif = $this->document->getDoc()->getIiif(); |
@@ -244,8 +239,7 @@ discard block |
||
244 | 239 | * |
245 | 240 | * @return array URL and MIME type of image file |
246 | 241 | */ |
247 | - protected function getImage($page) |
|
248 | - { |
|
242 | + protected function getImage($page) { |
|
249 | 243 | $image = []; |
250 | 244 | // Get @USE value of METS fileGrp. |
251 | 245 | $fileGrpsImages = GeneralUtility::trimExplode(',', $this->extConf['fileGrpImages']); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | // Configure @action URL for form. |
131 | 131 | $uri = $this->uriBuilder->reset() |
132 | 132 | ->setTargetPageUid($GLOBALS['TSFE']->id) |
133 | - ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? true : false) |
|
133 | + ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? TRUE : FALSE) |
|
134 | 134 | ->setArguments([ |
135 | 135 | 'eID' => 'tx_dlf_pageview_proxy', |
136 | 136 | 'url' => $fulltext['url'], |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | if ($iiif instanceof ManifestInterface) { |
196 | 196 | $canvas = $iiif->getContainedResourceById($canvasId); |
197 | 197 | /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */ |
198 | - if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
198 | + if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
199 | 199 | $annotationContainers = []; |
200 | 200 | /* |
201 | 201 | * TODO Analyzing the annotations on the server side requires loading the annotation lists / pages |
@@ -205,11 +205,11 @@ discard block |
||
205 | 205 | * On the other hand, server connections are potentially better than client connections. Downloading annotation lists |
206 | 206 | */ |
207 | 207 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
208 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
208 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
209 | 209 | foreach ($textAnnotations as $annotation) { |
210 | 210 | if ( |
211 | 211 | $annotation->getBody()->getFormat() == 'text/plain' |
212 | - && $annotation->getBody()->getChars() != null |
|
212 | + && $annotation->getBody()->getChars() != NULL |
|
213 | 213 | ) { |
214 | 214 | $annotationListData = []; |
215 | 215 | $annotationListData['uri'] = $annotationContainer->getId(); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | // Configure @action URL for form. |
262 | 262 | $uri = $this->uriBuilder->reset() |
263 | 263 | ->setTargetPageUid($GLOBALS['TSFE']->id) |
264 | - ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? true : false) |
|
264 | + ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? TRUE : FALSE) |
|
265 | 265 | ->setArguments([ |
266 | 266 | 'eID' => 'tx_dlf_pageview_proxy', |
267 | 267 | 'url' => $image['url'], |
@@ -22,15 +22,13 @@ discard block |
||
22 | 22 | * @subpackage dlf |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class PageGridController extends AbstractController |
|
26 | -{ |
|
25 | +class PageGridController extends AbstractController { |
|
27 | 26 | /** |
28 | 27 | * The main method of the plugin |
29 | 28 | * |
30 | 29 | * @return void |
31 | 30 | */ |
32 | - public function mainAction() |
|
33 | - { |
|
31 | + public function mainAction() { |
|
34 | 32 | $this->loadDocument($this->requestData); |
35 | 33 | if ( |
36 | 34 | $this->isDocMissingOrEmpty() |
@@ -64,8 +62,7 @@ discard block |
||
64 | 62 | * |
65 | 63 | * @return array The rendered entry ready for fluid |
66 | 64 | */ |
67 | - protected function getEntry($number, $fileGrpThumbs) |
|
68 | - { |
|
65 | + protected function getEntry($number, $fileGrpThumbs) { |
|
69 | 66 | // Set pagination. |
70 | 67 | $entry['pagination'] = htmlspecialchars($this->document->getDoc()->physicalStructureInfo[$this->document->getDoc()->physicalStructure[$number]]['orderlabel']); |
71 | 68 | $entry['page'] = $number; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | foreach ($year['children'] as $month) { |
128 | 128 | foreach ($month['children'] as $day) { |
129 | 129 | foreach ($day['children'] as $issue) { |
130 | - $title = $issue['label'] ?: $issue['orderlabel']; |
|
130 | + $title = $issue['label'] ? : $issue['orderlabel']; |
|
131 | 131 | if (strtotime($title) !== false) { |
132 | 132 | $title = strftime('%x', strtotime($title)); |
133 | 133 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $_day = date('j', $dateTimestamp); |
172 | 172 | $calendarIssuesByYear[$_year][$_month][$_day][] = $issue; |
173 | 173 | } else { |
174 | - $this->logger->warning('Document with UID ' . $issue['uid'] . 'has no valid date of publication'); |
|
174 | + $this->logger->warning('Document with UID '.$issue['uid'].'has no valid date of publication'); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | // Sort by years. |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | $this->view->assign('calendarData', $calendarData); |
219 | 219 | $this->view->assign('documentId', $this->document->getUid()); |
220 | 220 | $this->view->assign('yearLinkTitle', $yearLinkTitle); |
221 | - $this->view->assign('parentDocumentId', $this->document->getPartof() ?: $this->document->getDoc()->tableOfContents[0]['points']); |
|
222 | - $this->view->assign('allYearDocTitle', $this->document->getDoc()->getTitle($this->document->getPartof()) ?: $this->document->getDoc()->tableOfContents[0]['label']); |
|
221 | + $this->view->assign('parentDocumentId', $this->document->getPartof() ? : $this->document->getDoc()->tableOfContents[0]['points']); |
|
222 | + $this->view->assign('allYearDocTitle', $this->document->getDoc()->getTitle($this->document->getPartof()) ? : $this->document->getDoc()->tableOfContents[0]['label']); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | if (empty($yearLabel)) { |
257 | 257 | // if neither order nor orderlabel is set, use the id... |
258 | - $yearLabel = (string)$id; |
|
258 | + $yearLabel = (string) $id; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $years[] = [ |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | if (is_int($key)) { |
295 | 295 | $yearFilled[] = $yearArray[$key]; |
296 | 296 | } else { |
297 | - $yearFilled[] = ['title' => $min+$i, 'documentId' => '']; |
|
297 | + $yearFilled[] = ['title' => $min + $i, 'documentId' => '']; |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 | $yearArray = $yearFilled; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | protected function getCalendarYear(&$calendarData, $calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) |
324 | 324 | { |
325 | 325 | for ($i = $firstMonth; $i <= $lastMonth; $i++) { |
326 | - $key = $year . '-' . $i; |
|
326 | + $key = $year.'-'.$i; |
|
327 | 327 | |
328 | 328 | $calendarData[$key] = [ |
329 | 329 | 'DAYMON_NAME' => strftime('%a', strtotime('last Monday')), |
@@ -333,16 +333,16 @@ discard block |
||
333 | 333 | 'DAYFRI_NAME' => strftime('%a', strtotime('last Friday')), |
334 | 334 | 'DAYSAT_NAME' => strftime('%a', strtotime('last Saturday')), |
335 | 335 | 'DAYSUN_NAME' => strftime('%a', strtotime('last Sunday')), |
336 | - 'MONTHNAME' => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year, |
|
336 | + 'MONTHNAME' => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year, |
|
337 | 337 | 'CALYEAR' => ($i == $firstMonth) ? $year : '' |
338 | 338 | ]; |
339 | 339 | |
340 | - $firstOfMonth = strtotime($year . '-' . $i . '-1'); |
|
340 | + $firstOfMonth = strtotime($year.'-'.$i.'-1'); |
|
341 | 341 | $lastOfMonth = strtotime('last day of', ($firstOfMonth)); |
342 | 342 | $firstOfMonthStart = strtotime('last Monday', $firstOfMonth); |
343 | 343 | // There are never more than 6 weeks in a month. |
344 | 344 | for ($j = 0; $j <= 5; $j++) { |
345 | - $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart); |
|
345 | + $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart); |
|
346 | 346 | |
347 | 347 | $calendarData[$key]['week'][$j] = [ |
348 | 348 | 'DAYMON' => ['dayValue' => ' '], |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | ]; |
356 | 356 | // Every week has seven days. ;-) |
357 | 357 | for ($k = 0; $k <= 6; $k++) { |
358 | - $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek); |
|
358 | + $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek); |
|
359 | 359 | if ( |
360 | 360 | $currentDayTime >= $firstOfMonth |
361 | 361 | && $currentDayTime <= $lastOfMonth |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | } |
387 | 387 | $dayLinkDiv = $dayLinksText; |
388 | 388 | } |
389 | - switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) { |
|
389 | + switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) { |
|
390 | 390 | case '0': |
391 | 391 | $calendarData[$key]['week'][$j]['DAYSUN']['dayValue'] = strftime('%d', $currentDayTime); |
392 | 392 | if ((int) $dayLinks === (int) date('j', $currentDayTime)) { |