Passed
Pull Request — master (#17)
by
unknown
02:43
created
Classes/Plugin/Search.php 3 patches
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
  * @subpackage dlf
32 32
  * @access public
33 33
  */
34
-class Search extends \Kitodo\Dlf\Common\AbstractPlugin
35
-{
34
+class Search extends \Kitodo\Dlf\Common\AbstractPlugin {
36 35
     public $scriptRelPath = 'Classes/Plugin/Search.php';
37 36
 
38 37
     /**
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
      *
43 42
      * @return void
44 43
      */
45
-    protected function addAutocompleteJS()
46
-    {
44
+    protected function addAutocompleteJS() {
47 45
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
48 46
             ->getQueryBuilderForTable('tx_dlf_documents');
49 47
 
@@ -74,8 +72,7 @@  discard block
 block discarded – undo
74 72
      *
75 73
      * @return string HTML input fields with current document's UID and parent ID
76 74
      */
77
-    protected function addCurrentCollection()
78
-    {
75
+    protected function addCurrentCollection() {
79 76
         // Load current collection.
80 77
         $list = GeneralUtility::makeInstance(DocumentList::class);
81 78
         if (
@@ -107,8 +104,7 @@  discard block
 block discarded – undo
107 104
      *
108 105
      * @return string HTML input fields with current document's UID and parent ID
109 106
      */
110
-    protected function addCurrentDocument()
111
-    {
107
+    protected function addCurrentDocument() {
112 108
         // Load current list object.
113 109
         $list = GeneralUtility::makeInstance(DocumentList::class);
114 110
         // Load current document.
@@ -141,8 +137,7 @@  discard block
 block discarded – undo
141 137
      *
142 138
      * @return string HTML input fields with encrypted core name and hash
143 139
      */
144
-    protected function addEncryptedCoreName()
145
-    {
140
+    protected function addEncryptedCoreName() {
146 141
         // Get core name.
147 142
         $name = Helper::getIndexNameFromUid($this->conf['solrcore'], 'tx_dlf_solrcores');
148 143
         // Encrypt core name.
@@ -164,8 +159,7 @@  discard block
 block discarded – undo
164 159
      *
165 160
      * @return string The extended search form or an empty string
166 161
      */
167
-    protected function addExtendedSearch()
168
-    {
162
+    protected function addExtendedSearch() {
169 163
         $extendedSearch = '';
170 164
         // Quit without doing anything if no fields for extended search are selected.
171 165
         if (
@@ -203,8 +197,7 @@  discard block
 block discarded – undo
203 197
      *
204 198
      * @return string HTML output of facets menu
205 199
      */
206
-    protected function addFacetsMenu()
207
-    {
200
+    protected function addFacetsMenu() {
208 201
         // Check for typoscript configuration to prevent fatal error.
209 202
         if (empty($this->conf['facetsConf.'])) {
210 203
             Helper::devLog('Incomplete plugin configuration', DEVLOG_SEVERITY_WARNING);
@@ -238,8 +231,7 @@  discard block
 block discarded – undo
238 231
      *
239 232
      * @return string HTML output of fulltext switch
240 233
      */
241
-    protected function addFulltextSwitch($isFulltextSearch = 0)
242
-    {
234
+    protected function addFulltextSwitch($isFulltextSearch = 0) {
243 235
         $output = '';
244 236
         // Check for plugin configuration.
245 237
         if (!empty($this->conf['fulltext'])) {
@@ -258,8 +250,7 @@  discard block
 block discarded – undo
258 250
      *
259 251
      * @return string HTML output of logical page field
260 252
      */
261
-    protected function addLogicalPage()
262
-    {
253
+    protected function addLogicalPage() {
263 254
         $output = '';
264 255
         // Check for plugin configuration.
265 256
         if (!empty($this->conf['showLogicalPageField'])) {
@@ -282,8 +273,7 @@  discard block
 block discarded – undo
282 273
      *
283 274
      * @return array The array for the facet's menu entry
284 275
      */
285
-    protected function getFacetsMenuEntry($field, $value, $count, $search, &$state)
286
-    {
276
+    protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) {
287 277
         $entryArray = [];
288 278
         // Translate value.
289 279
         if ($field == 'owner_faceting') {
@@ -339,8 +329,7 @@  discard block
 block discarded – undo
339 329
      *
340 330
      * @return string The content that is displayed on the website
341 331
      */
342
-    public function main($content, $conf)
343
-    {
332
+    public function main($content, $conf) {
344 333
         $this->init($conf);
345 334
         // Disable caching for this plugin.
346 335
         $this->setCache(false);
@@ -540,8 +529,7 @@  discard block
 block discarded – undo
540 529
      *
541 530
      * @return array HMENU array
542 531
      */
543
-    public function makeFacetsMenuArray($content, $conf)
544
-    {
532
+    public function makeFacetsMenuArray($content, $conf) {
545 533
         $this->init($conf);
546 534
         $menuArray = [];
547 535
         // Set default value for facet search.
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         if ($result->rowCount() == 1) {
63 63
             $pageRenderer = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
64
-            $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/Search/Suggester.js');
64
+            $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/Search/Suggester.js');
65 65
         } else {
66 66
             Helper::devLog('No metadata fields configured for search suggestions', DEVLOG_SEVERITY_WARNING);
67 67
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             && $list->metadata['options']['source'] == 'collection'
84 84
         ) {
85 85
             // Get collection's UID.
86
-            return '<input type="hidden" name="' . $this->prefixId . '[collection]" value="' . $list->metadata['options']['select'] . '" />';
86
+            return '<input type="hidden" name="'.$this->prefixId.'[collection]" value="'.$list->metadata['options']['select'].'" />';
87 87
         } elseif (!empty($list->metadata['options']['params']['filterquery'])) {
88 88
             // Get collection's UID from search metadata.
89 89
             foreach ($list->metadata['options']['params']['filterquery'] as $facet) {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                     $collectionId = Helper::getUidFromIndexName(trim($facetKeyVal[1], '(")'), 'tx_dlf_collections');
96 96
                 }
97 97
             }
98
-            return '<input type="hidden" name="' . $this->prefixId . '[collection]" value="' . $collectionId . '" />';
98
+            return '<input type="hidden" name="'.$this->prefixId.'[collection]" value="'.$collectionId.'" />';
99 99
         }
100 100
         return '';
101 101
     }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             $this->loadDocument();
120 120
             // Get document's UID or parent ID.
121 121
             if ($this->doc->ready) {
122
-                return '<input type="hidden" name="' . $this->prefixId . '[id]" value="' . ($this->doc->parentId > 0 ? $this->doc->parentId : $this->doc->uid) . '" />';
122
+                return '<input type="hidden" name="'.$this->prefixId.'[id]" value="'.($this->doc->parentId > 0 ? $this->doc->parentId : $this->doc->uid).'" />';
123 123
             }
124 124
         } elseif (!empty($list->metadata['options']['params']['filterquery'])) {
125 125
             // Get document's UID from search metadata.
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                     $documentId = (int) substr($facetKeyVal[1], 1, strpos($facetKeyVal[1], ')'));
130 130
                 }
131 131
             }
132
-            return '<input type="hidden" name="' . $this->prefixId . '[id]" value="' . $documentId . '" />';
132
+            return '<input type="hidden" name="'.$this->prefixId.'[id]" value="'.$documentId.'" />';
133 133
         }
134 134
         return '';
135 135
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         }
152 152
         // Add encrypted fields to search form.
153 153
         if (is_array($name)) {
154
-            return '<input type="hidden" name="' . $this->prefixId . '[encrypted]" value="' . $name['encrypted'] . '" /><input type="hidden" name="' . $this->prefixId . '[hashed]" value="' . $name['hash'] . '" />';
154
+            return '<input type="hidden" name="'.$this->prefixId.'[encrypted]" value="'.$name['encrypted'].'" /><input type="hidden" name="'.$this->prefixId.'[hashed]" value="'.$name['hash'].'" />';
155 155
         } else {
156 156
             return '';
157 157
         }
@@ -177,19 +177,19 @@  discard block
 block discarded – undo
177 177
         // Get operator options.
178 178
         $operatorOptions = '';
179 179
         foreach (['AND', 'OR', 'NOT'] as $operator) {
180
-            $operatorOptions .= '<option class="tx-dlf-search-operator-option tx-dlf-search-operator-' . $operator . '" value="' . $operator . '">' . $this->pi_getLL($operator, '', true) . '</option>';
180
+            $operatorOptions .= '<option class="tx-dlf-search-operator-option tx-dlf-search-operator-'.$operator.'" value="'.$operator.'">'.$this->pi_getLL($operator, '', true).'</option>';
181 181
         }
182 182
         // Get field selector options.
183 183
         $fieldSelectorOptions = '';
184 184
         $searchFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], true);
185 185
         foreach ($searchFields as $searchField) {
186
-            $fieldSelectorOptions .= '<option class="tx-dlf-search-field-option tx-dlf-search-field-' . $searchField . '" value="' . $searchField . '">' . Helper::translate($searchField, 'tx_dlf_metadata', $this->conf['pages']) . '</option>';
186
+            $fieldSelectorOptions .= '<option class="tx-dlf-search-field-option tx-dlf-search-field-'.$searchField.'" value="'.$searchField.'">'.Helper::translate($searchField, 'tx_dlf_metadata', $this->conf['pages']).'</option>';
187 187
         }
188 188
         for ($i = 0; $i < $this->conf['extendedSlotCount']; $i++) {
189 189
             $markerArray = [
190
-                '###EXT_SEARCH_OPERATOR###' => '<select class="tx-dlf-search-operator tx-dlf-search-operator-' . $i . '" name="' . $this->prefixId . '[extOperator][' . $i . ']">' . $operatorOptions . '</select>',
191
-                '###EXT_SEARCH_FIELDSELECTOR###' => '<select class="tx-dlf-search-field tx-dlf-search-field-' . $i . '" name="' . $this->prefixId . '[extField][' . $i . ']">' . $fieldSelectorOptions . '</select>',
192
-                '###EXT_SEARCH_FIELDQUERY###' => '<input class="tx-dlf-search-query tx-dlf-search-query-' . $i . '" type="text" name="' . $this->prefixId . '[extQuery][' . $i . ']" />'
190
+                '###EXT_SEARCH_OPERATOR###' => '<select class="tx-dlf-search-operator tx-dlf-search-operator-'.$i.'" name="'.$this->prefixId.'[extOperator]['.$i.']">'.$operatorOptions.'</select>',
191
+                '###EXT_SEARCH_FIELDSELECTOR###' => '<select class="tx-dlf-search-field tx-dlf-search-field-'.$i.'" name="'.$this->prefixId.'[extField]['.$i.']">'.$fieldSelectorOptions.'</select>',
192
+                '###EXT_SEARCH_FIELDQUERY###' => '<input class="tx-dlf-search-query tx-dlf-search-query-'.$i.'" type="text" name="'.$this->prefixId.'[extQuery]['.$i.']" />'
193 193
             ];
194 194
             $extendedSearch .= $this->templateService->substituteMarkerArray($this->templateService->getSubpart($this->template, '###EXT_SEARCH_ENTRY###'), $markerArray);
195 195
         }
@@ -217,12 +217,12 @@  discard block
 block discarded – undo
217 217
         // Get facets from plugin configuration.
218 218
         $facets = [];
219 219
         foreach (GeneralUtility::trimExplode(',', $this->conf['facets'], true) as $facet) {
220
-            $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->conf['pages']);
220
+            $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->conf['pages']);
221 221
         }
222 222
         // Render facets menu.
223 223
         $TSconfig = [];
224 224
         $TSconfig['special'] = 'userfunction';
225
-        $TSconfig['special.']['userFunc'] = \Kitodo\Dlf\Plugin\Search::class . '->makeFacetsMenuArray';
225
+        $TSconfig['special.']['userFunc'] = \Kitodo\Dlf\Plugin\Search::class.'->makeFacetsMenuArray';
226 226
         $TSconfig['special.']['facets'] = $facets;
227 227
         $TSconfig['special.']['limit'] = max(intval($this->conf['limitFacets']), 1);
228 228
         $TSconfig = Helper::mergeRecursiveWithOverrule($this->conf['facetsConf.'], $TSconfig);
@@ -243,10 +243,10 @@  discard block
 block discarded – undo
243 243
         $output = '';
244 244
         // Check for plugin configuration.
245 245
         if (!empty($this->conf['fulltext'])) {
246
-            $output .= ' <input class="tx-dlf-search-fulltext" id="tx-dlf-search-fulltext-no" type="radio" name="' . $this->prefixId . '[fulltext]" value="0" ' . ($isFulltextSearch == 0 ? 'checked="checked"' : '') . ' />';
247
-            $output .= ' <label for="tx-dlf-search-fulltext-no">' . $this->pi_getLL('label.inMetadata', '') . '</label>';
248
-            $output .= ' <input class="tx-dlf-search-fulltext" id="tx-dlf-search-fulltext-yes" type="radio" name="' . $this->prefixId . '[fulltext]" value="1" ' . ($isFulltextSearch == 1 ? 'checked="checked"' : '') . '/>';
249
-            $output .= ' <label for="tx-dlf-search-fulltext-yes">' . $this->pi_getLL('label.inFulltext', '') . '</label>';
246
+            $output .= ' <input class="tx-dlf-search-fulltext" id="tx-dlf-search-fulltext-no" type="radio" name="'.$this->prefixId.'[fulltext]" value="0" '.($isFulltextSearch == 0 ? 'checked="checked"' : '').' />';
247
+            $output .= ' <label for="tx-dlf-search-fulltext-no">'.$this->pi_getLL('label.inMetadata', '').'</label>';
248
+            $output .= ' <input class="tx-dlf-search-fulltext" id="tx-dlf-search-fulltext-yes" type="radio" name="'.$this->prefixId.'[fulltext]" value="1" '.($isFulltextSearch == 1 ? 'checked="checked"' : '').'/>';
249
+            $output .= ' <label for="tx-dlf-search-fulltext-yes">'.$this->pi_getLL('label.inFulltext', '').'</label>';
250 250
         }
251 251
         return $output;
252 252
     }
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
         $output = '';
264 264
         // Check for plugin configuration.
265 265
         if (!empty($this->conf['showLogicalPageField'])) {
266
-            $output .= ' <label for="tx-dlf-search-logical-page">' . $this->pi_getLL('label.logicalPage', '') . ': </label>';
267
-            $output .= ' <input class="tx-dlf-search-logical-page" id="tx-dlf-search-logical-page" type="text" name="' . $this->prefixId . '[logicalPage]" />';
266
+            $output .= ' <label for="tx-dlf-search-logical-page">'.$this->pi_getLL('label.logicalPage', '').': </label>';
267
+            $output .= ' <input class="tx-dlf-search-logical-page" id="tx-dlf-search-logical-page" type="text" name="'.$this->prefixId.'[logicalPage]" />';
268 268
         }
269 269
         return $output;
270 270
     }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         $entryArray['doNotLinkIt'] = 0;
306 306
         // Check if facet is already selected.
307 307
         $queryColumn = array_column($search['params']['filterquery'], 'query');
308
-        $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn);
308
+        $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn);
309 309
         if ($index !== false) {
310 310
             // Facet is selected, thus remove it from filter.
311 311
             unset($queryColumn[$index]);
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
             }
323 323
         } else {
324 324
             // Facet is not selected, thus add it to filter.
325
-            $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")';
325
+            $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")';
326 326
             $entryArray['ITEM_STATE'] = 'NO';
327 327
         }
328 328
         $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['query' => $search['query'], 'fq' => $queryColumn]);
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
                 '###ACTION_URL###' => $this->cObj->typoLink_URL($linkConf),
379 379
                 '###LABEL_QUERY###' => (!empty($search['query']) ? htmlspecialchars($search['query']) : $this->pi_getLL('label.query')),
380 380
                 '###LABEL_SUBMIT###' => $this->pi_getLL('label.submit'),
381
-                '###FIELD_QUERY###' => $this->prefixId . '[query]',
381
+                '###FIELD_QUERY###' => $this->prefixId.'[query]',
382 382
                 '###QUERY###' => (!empty($search['query']) ? htmlspecialchars($search['query']) : ''),
383 383
                 '###FULLTEXTSWITCH###' => $this->addFulltextSwitch($list->metadata['fulltextSearch']),
384 384
                 '###FIELD_DOC###' => ($this->conf['searchIn'] == 'document' || $this->conf['searchIn'] == 'all' ? $this->addCurrentDocument() : ''),
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
                 $this->piVars['query'] = empty($matches[1]) ? $this->piVars['query'] : $matches[1];
411 411
                 // Search in fulltext field if applicable. Query must not be empty!
412 412
                 if (!empty($this->piVars['query'])) {
413
-                    $query = 'fulltext:(' . Solr::escapeQuery(trim($this->piVars['query'])) . ')';
413
+                    $query = 'fulltext:('.Solr::escapeQuery(trim($this->piVars['query'])).')';
414 414
                 }
415 415
             } else {
416 416
                 // Retain given search field if valid.
@@ -431,9 +431,9 @@  discard block
 block discarded – undo
431 431
                             && in_array($this->piVars['extField'][$i], $allowedFields)
432 432
                         ) {
433 433
                             if (!empty($query)) {
434
-                                $query .= ' ' . $this->piVars['extOperator'][$i] . ' ';
434
+                                $query .= ' '.$this->piVars['extOperator'][$i].' ';
435 435
                             }
436
-                            $query .= Indexer::getIndexFieldName($this->piVars['extField'][$i], $this->conf['pages']) . ':(' . Solr::escapeQuery($this->piVars['extQuery'][$i]) . ')';
436
+                            $query .= Indexer::getIndexFieldName($this->piVars['extField'][$i], $this->conf['pages']).':('.Solr::escapeQuery($this->piVars['extQuery'][$i]).')';
437 437
                         }
438 438
                     }
439 439
                 }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
                     !empty($this->piVars['id'])
454 454
                     && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['id'])
455 455
                 ) {
456
-                    $params['filterquery'][]['query'] = 'uid:(' . $this->piVars['id'] . ') OR partof:(' . $this->piVars['id'] . ')';
456
+                    $params['filterquery'][]['query'] = 'uid:('.$this->piVars['id'].') OR partof:('.$this->piVars['id'].')';
457 457
                     $label .= htmlspecialchars(sprintf($this->pi_getLL('in', ''), Document::getTitle($this->piVars['id'])));
458 458
                 }
459 459
             }
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                     && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['collection'])
468 468
                 ) {
469 469
                     $index_name = Helper::getIndexNameFromUid($this->piVars['collection'], 'tx_dlf_collections', $this->conf['pages']);
470
-                    $params['filterquery'][]['query'] = 'collection_faceting:("' . Solr::escapeQuery($index_name) . '")';
470
+                    $params['filterquery'][]['query'] = 'collection_faceting:("'.Solr::escapeQuery($index_name).'")';
471 471
                     $label .= sprintf($this->pi_getLL('in', '', true), Helper::translate($index_name, 'tx_dlf_collections', $this->conf['pages']));
472 472
                 }
473 473
             }
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
                     $collIndexNames[] = Solr::escapeQuery(Helper::getIndexNameFromUid(intval($collId), 'tx_dlf_collections', $this->conf['pages']));
480 480
                 }
481 481
                 // Last value is fake and used for distinction in $this->addCurrentCollection()
482
-                $params['filterquery'][]['query'] = 'collection_faceting:("' . implode('" OR "', $collIndexNames) . '" OR "FakeValueForDistinction")';
482
+                $params['filterquery'][]['query'] = 'collection_faceting:("'.implode('" OR "', $collIndexNames).'" OR "FakeValueForDistinction")';
483 483
             }
484 484
             // Set some query parameters.
485 485
             $params['query'] = !empty($query) ? $query : '*';
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
             $linkConf['forceAbsoluteUrl.']['scheme'] = !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http';
530 530
             $linkConf['additionalParams'] = GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false);
531 531
             // Send headers.
532
-            header('Location: ' . GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkConf)));
532
+            header('Location: '.GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkConf)));
533 533
             exit;
534 534
         }
535 535
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
         // Get operator options.
178 178
         $operatorOptions = '';
179 179
         foreach (['AND', 'OR', 'NOT'] as $operator) {
180
-            $operatorOptions .= '<option class="tx-dlf-search-operator-option tx-dlf-search-operator-' . $operator . '" value="' . $operator . '">' . $this->pi_getLL($operator, '', true) . '</option>';
180
+            $operatorOptions .= '<option class="tx-dlf-search-operator-option tx-dlf-search-operator-' . $operator . '" value="' . $operator . '">' . $this->pi_getLL($operator, '', TRUE) . '</option>';
181 181
         }
182 182
         // Get field selector options.
183 183
         $fieldSelectorOptions = '';
184
-        $searchFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], true);
184
+        $searchFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
185 185
         foreach ($searchFields as $searchField) {
186 186
             $fieldSelectorOptions .= '<option class="tx-dlf-search-field-option tx-dlf-search-field-' . $searchField . '" value="' . $searchField . '">' . Helper::translate($searchField, 'tx_dlf_metadata', $this->conf['pages']) . '</option>';
187 187
         }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         }
217 217
         // Get facets from plugin configuration.
218 218
         $facets = [];
219
-        foreach (GeneralUtility::trimExplode(',', $this->conf['facets'], true) as $facet) {
219
+        foreach (GeneralUtility::trimExplode(',', $this->conf['facets'], TRUE) as $facet) {
220 220
             $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->conf['pages']);
221 221
         }
222 222
         // Render facets menu.
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
         // Check if facet is already selected.
307 307
         $queryColumn = array_column($search['params']['filterquery'], 'query');
308 308
         $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn);
309
-        if ($index !== false) {
309
+        if ($index !== FALSE) {
310 310
             // Facet is selected, thus remove it from filter.
311 311
             unset($queryColumn[$index]);
312 312
             $queryColumn = array_values($queryColumn);
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
             //Reset facets
316 316
             if ($this->conf['resetFacets']) {
317 317
                 //remove ($count) for selected facet in template
318
-                $entryArray['count'] = false;
318
+                $entryArray['count'] = FALSE;
319 319
                 //build link to delete selected facet
320 320
                 $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['query' => $search['query'], 'fq' => $queryColumn]);
321 321
                 $entryArray['title'] = sprintf($this->pi_getLL('resetFacet', ''), $entryArray['title']);
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
     {
344 344
         $this->init($conf);
345 345
         // Disable caching for this plugin.
346
-        $this->setCache(false);
346
+        $this->setCache(FALSE);
347 347
         // Quit without doing anything if required variables are not set.
348 348
         if (empty($this->conf['solrcore'])) {
349 349
             Helper::devLog('Incomplete plugin configuration', DEVLOG_SEVERITY_WARNING);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             return $this->pi_wrapInBaseClass($content);
395 395
         } else {
396 396
             // Build label for result list.
397
-            $label = $this->pi_getLL('search', '', true);
397
+            $label = $this->pi_getLL('search', '', TRUE);
398 398
             if (!empty($this->piVars['query'])) {
399 399
                 $label .= htmlspecialchars(sprintf($this->pi_getLL('for', ''), trim($this->piVars['query'])));
400 400
             }
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                 && is_array($this->piVars['extQuery'])
423 423
             ) {
424 424
                 $allowedOperators = ['AND', 'OR', 'NOT'];
425
-                $allowedFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], true);
425
+                $allowedFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
426 426
                 $numberOfExtQueries = count($this->piVars['extQuery']);
427 427
                 for ($i = 0; $i < $numberOfExtQueries; $i++) {
428 428
                     if (!empty($this->piVars['extQuery'][$i])) {
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                 ) {
469 469
                     $index_name = Helper::getIndexNameFromUid($this->piVars['collection'], 'tx_dlf_collections', $this->conf['pages']);
470 470
                     $params['filterquery'][]['query'] = 'collection_faceting:("' . Solr::escapeQuery($index_name) . '")';
471
-                    $label .= sprintf($this->pi_getLL('in', '', true), Helper::translate($index_name, 'tx_dlf_collections', $this->conf['pages']));
471
+                    $label .= sprintf($this->pi_getLL('in', '', TRUE), Helper::translate($index_name, 'tx_dlf_collections', $this->conf['pages']));
472 472
                 }
473 473
             }
474 474
             // Add filter query for collection restrictions.
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
             }
528 528
             $linkConf['forceAbsoluteUrl'] = !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0;
529 529
             $linkConf['forceAbsoluteUrl.']['scheme'] = !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http';
530
-            $linkConf['additionalParams'] = GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false);
530
+            $linkConf['additionalParams'] = GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE);
531 531
             // Send headers.
532 532
             header('Location: ' . GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkConf)));
533 533
             exit;
Please login to merge, or discard this patch.
Classes/Plugin/ListView.php 3 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
             return '';
82 82
         }
83 83
         // Get separator.
84
-        $separator = '<span class="separator">' . $this->pi_getLL('separator', ' - ', true) . '</span>';
84
+        $separator = '<span class="separator">'.$this->pi_getLL('separator', ' - ', true).'</span>';
85 85
         // Add link to previous page.
86 86
         if ($this->piVars['pointer'] > 0) {
87
-            $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '&lt;', true), ['pointer' => $this->piVars['pointer'] - 1], true) . $separator;
87
+            $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '&lt;', true), ['pointer' => $this->piVars['pointer'] - 1], true).$separator;
88 88
         } else {
89
-            $output = '<span>' . $this->pi_getLL('prevPage', '&lt;', true) . '</span>' . $separator;
89
+            $output = '<span>'.$this->pi_getLL('prevPage', '&lt;', true).'</span>'.$separator;
90 90
         }
91 91
         $i = 0;
92 92
         $skip = null;
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
         while ($i < $maxPages) {
95 95
             if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) {
96 96
                 if ($this->piVars['pointer'] != $i) {
97
-                    $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', true), $i + 1), ['pointer' => $i], true) . $separator;
97
+                    $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', true), $i + 1), ['pointer' => $i], true).$separator;
98 98
                 } else {
99
-                    $output .= '<span class="active">' . sprintf($this->pi_getLL('page', '%d', true), $i + 1) . '</span>' . $separator;
99
+                    $output .= '<span class="active">'.sprintf($this->pi_getLL('page', '%d', true), $i + 1).'</span>'.$separator;
100 100
                 }
101 101
                 $skip = true;
102 102
             } elseif ($skip === true) {
103
-                $output .= '<span class="skip">' . $this->pi_getLL('skip', '...', true) . '</span>' . $separator;
103
+                $output .= '<span class="skip">'.$this->pi_getLL('skip', '...', true).'</span>'.$separator;
104 104
                 $skip = false;
105 105
             }
106 106
             $i++;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         if ($this->piVars['pointer'] < $maxPages - 1) {
110 110
             $output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '&gt;', true), ['pointer' => $this->piVars['pointer'] + 1], true);
111 111
         } else {
112
-            $output .= '<span>' . $this->pi_getLL('nextPage', '&gt;', true) . '</span>';
112
+            $output .= '<span>'.$this->pi_getLL('nextPage', '&gt;', true).'</span>';
113 113
         }
114 114
         return $output;
115 115
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                         if (empty($value) && $this->conf['getTitle']) {
147 147
                             $superiorTitle = Document::getTitle($this->list[$number]['uid'], true);
148 148
                             if (!empty($superiorTitle)) {
149
-                                $value = '[' . $superiorTitle . ']';
149
+                                $value = '['.$superiorTitle.']';
150 150
                             }
151 151
                         }
152 152
                         // Set fake title if still not present.
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         }
194 194
         // Add thumbnail.
195 195
         if (!empty($this->list[$number]['thumbnail'])) {
196
-            $markerArray['###THUMBNAIL###'] = '<img alt="' . $imgAlt . '" src="' . $this->list[$number]['thumbnail'] . '" />';
196
+            $markerArray['###THUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$this->list[$number]['thumbnail'].'" />';
197 197
         }
198 198
         // Add preview.
199 199
         if (!empty($this->list[$number]['preview'])) {
@@ -259,28 +259,28 @@  discard block
 block discarded – undo
259 259
             $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', true, false);
260 260
         }
261 261
         // Build HTML form.
262
-        $sorting = '<form action="' . $this->cObj->typoLink_URL($linkConf) . '" method="get"><div><input type="hidden" name="id" value="' . $GLOBALS['TSFE']->id . '" />';
262
+        $sorting = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />';
263 263
         foreach ($this->piVars as $piVar => $value) {
264 264
             if ($piVar != 'order' && $piVar != 'DATA' && !empty($value)) {
265
-                $sorting .= '<input type="hidden" name="' . $this->prefixId . '[' . $piVar . ']" value="' . $value . '" />';
265
+                $sorting .= '<input type="hidden" name="'.$this->prefixId.'['.$piVar.']" value="'.$value.'" />';
266 266
             }
267 267
         }
268 268
         // Select sort field.
269
-        $uniqId = uniqid($prefix . '-');
270
-        $sorting .= '<label for="' . $uniqId . '">' . $this->pi_getLL('orderBy', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[order]" onchange="javascript:this.form.submit();">';
269
+        $uniqId = uniqid($prefix.'-');
270
+        $sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('orderBy', '', true).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();">';
271 271
         // Add relevance sorting if this is a search result list.
272 272
         if ($this->list->metadata['options']['source'] == 'search') {
273
-            $sorting .= '<option value="score"' . (($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '') . '>' . $this->pi_getLL('relevance', '', true) . '</option>';
273
+            $sorting .= '<option value="score"'.(($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '').'>'.$this->pi_getLL('relevance', '', true).'</option>';
274 274
         }
275 275
         foreach ($this->sortables as $index_name => $label) {
276
-            $sorting .= '<option value="' . $index_name . '"' . (($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
276
+            $sorting .= '<option value="'.$index_name.'"'.(($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '').'>'.htmlspecialchars($label).'</option>';
277 277
         }
278 278
         $sorting .= '</select>';
279 279
         // Select sort direction.
280
-        $uniqId = uniqid($prefix . '-');
281
-        $sorting .= '<label for="' . $uniqId . '">' . $this->pi_getLL('direction', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[asc]" onchange="javascript:this.form.submit();">';
282
-        $sorting .= '<option value="1" ' . ($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . $this->pi_getLL('direction.asc', '', true) . '</option>';
283
-        $sorting .= '<option value="0" ' . (!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . $this->pi_getLL('direction.desc', '', true) . '</option>';
280
+        $uniqId = uniqid($prefix.'-');
281
+        $sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('direction', '', true).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[asc]" onchange="javascript:this.form.submit();">';
282
+        $sorting .= '<option value="1" '.($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.$this->pi_getLL('direction.asc', '', true).'</option>';
283
+        $sorting .= '<option value="0" '.(!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.$this->pi_getLL('direction.desc', '', true).'</option>';
284 284
         $sorting .= '</select></div></form>';
285 285
         return $sorting;
286 286
     }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                         if (empty($value) && $this->conf['getTitle']) {
317 317
                             $superiorTitle = Document::getTitle($subpart['uid'], true);
318 318
                             if (!empty($superiorTitle)) {
319
-                                $value = '[' . $superiorTitle . ']';
319
+                                $value = '['.$superiorTitle.']';
320 320
                             }
321 321
                         }
322 322
                         // Set fake title if still not present.
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                         $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
349 349
                         // Add page number for single pages.
350 350
                         if ($_value == 'page') {
351
-                            $value .= ' ' . intval($subpart['page']);
351
+                            $value .= ' '.intval($subpart['page']);
352 352
                         }
353 353
                     } elseif ($index_name == 'language' && !empty($value)) {
354 354
                         // Translate ISO 639 language code.
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             }
370 370
             // Add thumbnail.
371 371
             if (!empty($subpart['thumbnail'])) {
372
-                $markerArray['###SUBTHUMBNAIL###'] = '<img alt="' . $imgAlt . '" src="' . $subpart['thumbnail'] . '" />';
372
+                $markerArray['###SUBTHUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$subpart['thumbnail'].'" />';
373 373
             }
374 374
             // Add preview.
375 375
             if (!empty($subpart['preview'])) {
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
                 || (isset($this->piVars['asc']) && $this->piVars['asc'] != $listMetadata['options']['order.asc'])
482 482
             ) {
483 483
                 // Update list's metadata.
484
-                $listMetadata['options']['params']['sort'] = [$this->piVars['order'] . "_sorting" => (bool) $this->piVars['asc'] ? 'asc' : 'desc'];
484
+                $listMetadata['options']['params']['sort'] = [$this->piVars['order']."_sorting" => (bool) $this->piVars['asc'] ? 'asc' : 'desc'];
485 485
                 $listMetadata['options']['order'] = $this->piVars['order'];
486 486
                 $listMetadata['options']['order.asc'] = (bool) $this->piVars['asc'];
487 487
                 // Reset pointer.
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                 $this->list = $solr->search();
506 506
             }
507 507
             // Add list description
508
-            $listMetadata['description'] = '<p class="tx-dlf-search-numHits">' . htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $this->list->metadata['options']['numberOfHits'], $this->list->metadata['options']['numberOfToplevelHits'])) . '</p>';
508
+            $listMetadata['description'] = '<p class="tx-dlf-search-numHits">'.htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $this->list->metadata['options']['numberOfHits'], $this->list->metadata['options']['numberOfToplevelHits'])).'</p>';
509 509
             $this->list->metadata = $listMetadata;
510 510
             // Save updated list.
511 511
             $this->list->save();
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
         $markerArray['###LISTTITLE###'] = $this->list->metadata['label'];
535 535
         $markerArray['###LISTDESCRIPTION###'] = $this->list->metadata['description'];
536 536
         if (!empty($this->list->metadata['thumbnail'])) {
537
-            $markerArray['###LISTTHUMBNAIL###'] = '<img alt="" src="' . $this->list->metadata['thumbnail'] . '" />';
537
+            $markerArray['###LISTTHUMBNAIL###'] = '<img alt="" src="'.$this->list->metadata['thumbnail'].'" />';
538 538
         } else {
539 539
             $markerArray['###LISTTHUMBNAIL###'] = '';
540 540
         }
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
  * @subpackage dlf
30 30
  * @access public
31 31
  */
32
-class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
33
-{
32
+class ListView extends \Kitodo\Dlf\Common\AbstractPlugin {
34 33
     public $scriptRelPath = 'Classes/Plugin/ListView.php';
35 34
 
36 35
     /**
@@ -72,8 +71,7 @@  discard block
 block discarded – undo
72 71
      *
73 72
      * @return string The rendered page browser ready for output
74 73
      */
75
-    protected function getPageBrowser()
76
-    {
74
+    protected function getPageBrowser() {
77 75
         // Get overall number of pages.
78 76
         $maxPages = intval(ceil($this->list->metadata['options']['numberOfToplevelHits'] / $this->conf['limit']));
79 77
         // Return empty pagebrowser if there is just one page.
@@ -124,8 +122,7 @@  discard block
 block discarded – undo
124 122
      *
125 123
      * @return string The rendered entry ready for output
126 124
      */
127
-    protected function getEntry($number, $template)
128
-    {
125
+    protected function getEntry($number, $template) {
129 126
         $markerArray['###NUMBER###'] = ($this->piVars['pointer'] * $this->conf['limit']) + $number + 1;
130 127
         $markerArray['###METADATA###'] = '';
131 128
         $markerArray['###THUMBNAIL###'] = '';
@@ -227,8 +224,7 @@  discard block
 block discarded – undo
227 224
      *
228 225
      * @return array The parsed fieldwrap
229 226
      */
230
-    private function getFieldWrap($index_name, $wrap)
231
-    {
227
+    private function getFieldWrap($index_name, $wrap) {
232 228
         if (isset($this->fieldwrap[$index_name])) {
233 229
             return $this->fieldwrap[$index_name];
234 230
         } else {
@@ -243,8 +239,7 @@  discard block
 block discarded – undo
243 239
      *
244 240
      * @return string The rendered sorting dialog ready for output
245 241
      */
246
-    protected function getSortingForm()
247
-    {
242
+    protected function getSortingForm() {
248 243
         // Return nothing if there are no sortable metadata fields.
249 244
         if (!count($this->sortables)) {
250 245
             return '';
@@ -295,8 +290,7 @@  discard block
 block discarded – undo
295 290
      *
296 291
      * @return string The rendered entries ready for output
297 292
      */
298
-    protected function getSubEntries($number, $template)
299
-    {
293
+    protected function getSubEntries($number, $template) {
300 294
         $content = '';
301 295
         $noTitle = $this->pi_getLL('noTitle');
302 296
         $highlight_word = preg_replace('/\s\s+/', ';', $this->list->metadata['searchString']);
@@ -399,8 +393,7 @@  discard block
 block discarded – undo
399 393
      *
400 394
      * @return void
401 395
      */
402
-    protected function loadConfig()
403
-    {
396
+    protected function loadConfig() {
404 397
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
405 398
             ->getQueryBuilderForTable('tx_dlf_metadata');
406 399
 
@@ -446,8 +439,7 @@  discard block
 block discarded – undo
446 439
      *
447 440
      * @return string The content that is displayed on the website
448 441
      */
449
-    public function main($content, $conf)
450
-    {
442
+    public function main($content, $conf) {
451 443
         $this->init($conf);
452 444
         // Don't cache the output.
453 445
         $this->setCache(false);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -81,35 +81,35 @@  discard block
 block discarded – undo
81 81
             return '';
82 82
         }
83 83
         // Get separator.
84
-        $separator = '<span class="separator">' . $this->pi_getLL('separator', ' - ', true) . '</span>';
84
+        $separator = '<span class="separator">' . $this->pi_getLL('separator', ' - ', TRUE) . '</span>';
85 85
         // Add link to previous page.
86 86
         if ($this->piVars['pointer'] > 0) {
87
-            $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '&lt;', true), ['pointer' => $this->piVars['pointer'] - 1], true) . $separator;
87
+            $output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '&lt;', TRUE), ['pointer' => $this->piVars['pointer'] - 1], TRUE) . $separator;
88 88
         } else {
89
-            $output = '<span>' . $this->pi_getLL('prevPage', '&lt;', true) . '</span>' . $separator;
89
+            $output = '<span>' . $this->pi_getLL('prevPage', '&lt;', TRUE) . '</span>' . $separator;
90 90
         }
91 91
         $i = 0;
92
-        $skip = null;
92
+        $skip = NULL;
93 93
         // Add links to pages.
94 94
         while ($i < $maxPages) {
95 95
             if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) {
96 96
                 if ($this->piVars['pointer'] != $i) {
97
-                    $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', true), $i + 1), ['pointer' => $i], true) . $separator;
97
+                    $output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1), ['pointer' => $i], TRUE) . $separator;
98 98
                 } else {
99
-                    $output .= '<span class="active">' . sprintf($this->pi_getLL('page', '%d', true), $i + 1) . '</span>' . $separator;
99
+                    $output .= '<span class="active">' . sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1) . '</span>' . $separator;
100 100
                 }
101
-                $skip = true;
102
-            } elseif ($skip === true) {
103
-                $output .= '<span class="skip">' . $this->pi_getLL('skip', '...', true) . '</span>' . $separator;
104
-                $skip = false;
101
+                $skip = TRUE;
102
+            } elseif ($skip === TRUE) {
103
+                $output .= '<span class="skip">' . $this->pi_getLL('skip', '...', TRUE) . '</span>' . $separator;
104
+                $skip = FALSE;
105 105
             }
106 106
             $i++;
107 107
         }
108 108
         // Add link to next page.
109 109
         if ($this->piVars['pointer'] < $maxPages - 1) {
110
-            $output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '&gt;', true), ['pointer' => $this->piVars['pointer'] + 1], true);
110
+            $output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '&gt;', TRUE), ['pointer' => $this->piVars['pointer'] + 1], TRUE);
111 111
         } else {
112
-            $output .= '<span>' . $this->pi_getLL('nextPage', '&gt;', true) . '</span>';
112
+            $output .= '<span>' . $this->pi_getLL('nextPage', '&gt;', TRUE) . '</span>';
113 113
         }
114 114
         return $output;
115 115
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                     if ($index_name == 'title') {
145 145
                         // Get title of parent document if needed.
146 146
                         if (empty($value) && $this->conf['getTitle']) {
147
-                            $superiorTitle = Document::getTitle($this->list[$number]['uid'], true);
147
+                            $superiorTitle = Document::getTitle($this->list[$number]['uid'], TRUE);
148 148
                             if (!empty($superiorTitle)) {
149 149
                                 $value = '[' . $superiorTitle . ']';
150 150
                             }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                             'parameter' => $this->conf['targetPid'],
167 167
                             'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
168 168
                             'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
169
-                            'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
169
+                            'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
170 170
                         ];
171 171
                         $value = $this->cObj->typoLink(htmlspecialchars($value), $conf);
172 172
                     } elseif ($index_name == 'owner' && !empty($value)) {
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
                 'parameter' => $this->conf['targetBasket'],
214 214
                 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
215 215
                 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
216
-                'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
216
+                'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
217 217
             ];
218
-            $link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', true), $conf);
218
+            $link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', TRUE), $conf);
219 219
             $markerArray['###BASKETBUTTON###'] = $link;
220 220
         }
221
-        return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, true), $markerArray);
221
+        return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, TRUE), $markerArray);
222 222
     }
223 223
 
224 224
     /**
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
             'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http']
263 263
         ];
264 264
         if (!empty($this->piVars['logicalPage'])) {
265
-            $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', true, false);
265
+            $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', TRUE, FALSE);
266 266
         }
267 267
         // Build HTML form.
268 268
         $sorting = '<form action="' . $this->cObj->typoLink_URL($linkConf) . '" method="get"><div><input type="hidden" name="id" value="' . $GLOBALS['TSFE']->id . '" />';
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
         }
274 274
         // Select sort field.
275 275
         $uniqId = uniqid($prefix . '-');
276
-        $sorting .= '<label for="' . $uniqId . '">' . $this->pi_getLL('orderBy', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[order]" onchange="javascript:this.form.submit();">';
276
+        $sorting .= '<label for="' . $uniqId . '">' . $this->pi_getLL('orderBy', '', TRUE) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[order]" onchange="javascript:this.form.submit();">';
277 277
         // Add relevance sorting if this is a search result list.
278 278
         if ($this->list->metadata['options']['source'] == 'search') {
279
-            $sorting .= '<option value="score"' . (($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '') . '>' . $this->pi_getLL('relevance', '', true) . '</option>';
279
+            $sorting .= '<option value="score"' . (($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '') . '>' . $this->pi_getLL('relevance', '', TRUE) . '</option>';
280 280
         }
281 281
         foreach ($this->sortables as $index_name => $label) {
282 282
             $sorting .= '<option value="' . $index_name . '"' . (($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
         $sorting .= '</select>';
285 285
         // Select sort direction.
286 286
         $uniqId = uniqid($prefix . '-');
287
-        $sorting .= '<label for="' . $uniqId . '">' . $this->pi_getLL('direction', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[asc]" onchange="javascript:this.form.submit();">';
288
-        $sorting .= '<option value="1" ' . ($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . $this->pi_getLL('direction.asc', '', true) . '</option>';
289
-        $sorting .= '<option value="0" ' . (!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . $this->pi_getLL('direction.desc', '', true) . '</option>';
287
+        $sorting .= '<label for="' . $uniqId . '">' . $this->pi_getLL('direction', '', TRUE) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[asc]" onchange="javascript:this.form.submit();">';
288
+        $sorting .= '<option value="1" ' . ($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . $this->pi_getLL('direction.asc', '', TRUE) . '</option>';
289
+        $sorting .= '<option value="0" ' . (!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . $this->pi_getLL('direction.desc', '', TRUE) . '</option>';
290 290
         $sorting .= '</select></div></form>';
291 291
         return $sorting;
292 292
     }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
                     if ($index_name == 'title') {
321 321
                         // Get title of parent document if needed.
322 322
                         if (empty($value) && $this->conf['getTitle']) {
323
-                            $superiorTitle = Document::getTitle($subpart['uid'], true);
323
+                            $superiorTitle = Document::getTitle($subpart['uid'], TRUE);
324 324
                             if (!empty($superiorTitle)) {
325 325
                                 $value = '[' . $superiorTitle . ']';
326 326
                             }
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
                             'parameter' => $this->conf['targetPid'],
345 345
                             'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
346 346
                             'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
347
-                            'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
347
+                            'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
348 348
                         ];
349 349
                         $value = $this->cObj->typoLink(htmlspecialchars($value), $conf);
350 350
                     } elseif ($index_name == 'owner' && !empty($value)) {
@@ -392,14 +392,14 @@  discard block
 block discarded – undo
392 392
                     'parameter' => $this->conf['targetBasket'],
393 393
                     'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
394 394
                     'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
395
-                    'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
395
+                    'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
396 396
                 ];
397
-                $link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', true), $conf);
397
+                $link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', TRUE), $conf);
398 398
                 $markerArray['###SUBBASKETBUTTON###'] = $link;
399 399
             }
400 400
             $content .= $this->templateService->substituteMarkerArray($template['subentry'], $markerArray);
401 401
         }
402
-        return $this->templateService->substituteSubpart($this->templateService->getSubpart($this->template, '###SUBTEMPLATE###'), '###SUBENTRY###', $content, true);
402
+        return $this->templateService->substituteSubpart($this->templateService->getSubpart($this->template, '###SUBTEMPLATE###'), '###SUBENTRY###', $content, TRUE);
403 403
     }
404 404
 
405 405
     /**
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
     {
461 461
         $this->init($conf);
462 462
         // Don't cache the output.
463
-        $this->setCache(false);
463
+        $this->setCache(FALSE);
464 464
         // Load the list.
465 465
         $this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(DocumentList::class);
466 466
         $currentEntry = $this->piVars['pointer'] * $this->conf['limit'];
@@ -553,11 +553,11 @@  discard block
 block discarded – undo
553 553
             $lastEntry = ($this->piVars['pointer'] * $this->conf['limit']) + $this->conf['limit'];
554 554
             $markerArray['###COUNT###'] = htmlspecialchars(sprintf($this->pi_getLL('count'), $currentEntry, $lastEntry < $this->list->metadata['options']['numberOfToplevelHits'] ? $lastEntry : $this->list->metadata['options']['numberOfToplevelHits'], $this->list->metadata['options']['numberOfToplevelHits']));
555 555
         } else {
556
-            $markerArray['###COUNT###'] = $this->pi_getLL('nohits', '', true);
556
+            $markerArray['###COUNT###'] = $this->pi_getLL('nohits', '', TRUE);
557 557
         }
558 558
         $markerArray['###PAGEBROWSER###'] = $this->getPageBrowser();
559 559
         $markerArray['###SORTING###'] = $this->getSortingForm();
560
-        $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, true), $markerArray);
560
+        $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, TRUE), $markerArray);
561 561
         return $this->pi_wrapInBaseClass($content);
562 562
     }
563 563
 }
Please login to merge, or discard this patch.
Classes/Plugin/PageView.php 3 patches
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
  * @subpackage dlf
26 26
  * @access public
27 27
  */
28
-class PageView extends \Kitodo\Dlf\Common\AbstractPlugin
29
-{
28
+class PageView extends \Kitodo\Dlf\Common\AbstractPlugin {
30 29
     public $scriptRelPath = 'Classes/Plugin/PageView.php';
31 30
 
32 31
     /**
@@ -68,8 +67,7 @@  discard block
 block discarded – undo
68 67
      *
69 68
      * @return void
70 69
      */
71
-    protected function addViewerJS()
72
-    {
70
+    protected function addViewerJS() {
73 71
 
74 72
         $pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
75 73
         // Add OpenLayers library.
@@ -114,8 +112,7 @@  discard block
 block discarded – undo
114 112
      *
115 113
      * @return array Marker array
116 114
      */
117
-    protected function addInteraction()
118
-    {
115
+    protected function addInteraction() {
119 116
         $markerArray = [];
120 117
         if ($this->piVars['id']) {
121 118
             if ($this->conf['crop']) {
@@ -141,8 +138,7 @@  discard block
 block discarded – undo
141 138
      *
142 139
      * @return array Marker array
143 140
      */
144
-    protected function addBasketForm()
145
-    {
141
+    protected function addBasketForm() {
146 142
         $markerArray = [];
147 143
         // Add basket button
148 144
         if ($this->conf['basketButton'] && $this->conf['targetBasket'] && $this->piVars['id']) {
@@ -188,8 +184,7 @@  discard block
 block discarded – undo
188 184
      *
189 185
      * @return array URL and MIME type of image file
190 186
      */
191
-    protected function getImage($page)
192
-    {
187
+    protected function getImage($page) {
193 188
         $image = [];
194 189
         // Get @USE value of METS fileGrp.
195 190
         $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrps']);
@@ -223,8 +218,7 @@  discard block
 block discarded – undo
223 218
      *
224 219
      * @return array URL and MIME type of fulltext file
225 220
      */
226
-    protected function getFulltext($page)
227
-    {
221
+    protected function getFulltext($page) {
228 222
         $fulltext = [];
229 223
         // Get fulltext link.
230 224
         if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']])) {
@@ -253,8 +247,7 @@  discard block
 block discarded – undo
253 247
      * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as
254 248
      *               some information about the canvas.
255 249
      */
256
-    protected function getAnnotationContainers($page)
257
-    {
250
+    protected function getAnnotationContainers($page) {
258 251
         if ($this->doc instanceof IiifManifest) {
259 252
             $canvasId = $this->doc->physicalStructure[$page];
260 253
             $iiif = $this->doc->getIiif();
@@ -311,8 +304,7 @@  discard block
 block discarded – undo
311 304
      *
312 305
      * @return string The content that is displayed on the website
313 306
      */
314
-    public function main($content, $conf)
315
-    {
307
+    public function main($content, $conf) {
316 308
         $this->init($conf);
317 309
         // Load current document.
318 310
         $this->loadDocument();
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -73,33 +73,33 @@  discard block
 block discarded – undo
73 73
 
74 74
         $pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
75 75
         // Add OpenLayers library.
76
-        $pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/OpenLayers/ol3.css');
77
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/OpenLayers/glif.min.js');
78
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/OpenLayers/ol3-dlf.js');
76
+        $pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/OpenLayers/ol3.css');
77
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/OpenLayers/glif.min.js');
78
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/OpenLayers/ol3-dlf.js');
79 79
         // Add viewer library.
80
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/Utility.js');
81
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/OL3.js');
82
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/OL3Styles.js');
83
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/OL3Sources.js');
84
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/AltoParser.js');
85
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/ImageManipulationControl.js');
86
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/FulltextControl.js');
80
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/Utility.js');
81
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/OL3.js');
82
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/OL3Styles.js');
83
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/OL3Sources.js');
84
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/AltoParser.js');
85
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/ImageManipulationControl.js');
86
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/FulltextControl.js');
87 87
         if ($this->doc instanceof IiifManifest) {
88
-            $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/AnnotationParser.js');
89
-            $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/AnnotationControl.js');
88
+            $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/AnnotationParser.js');
89
+            $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/AnnotationControl.js');
90 90
         }
91
-        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Javascript/PageView/PageView.js');
91
+        $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Javascript/PageView/PageView.js');
92 92
         // Add viewer configuration.
93 93
         $viewerConfiguration = '
94 94
             $(document).ready(function() {
95 95
                 if (dlfUtils.exists(dlfViewer)) {
96 96
                     tx_dlf_viewer = new dlfViewer({
97
-                        controls: ["' . implode('", "', $this->controls) . '"],
98
-                        div: "' . $this->conf['elementId'] . '",
99
-                        images: ' . json_encode($this->images) . ',
100
-                        fulltexts: ' . json_encode($this->fulltexts) . ',
101
-                        annotationContainers: ' . json_encode($this->annotationContainers) . ',
102
-                        useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0) . '
97
+                        controls: ["' . implode('", "', $this->controls).'"],
98
+                        div: "' . $this->conf['elementId'].'",
99
+                        images: ' . json_encode($this->images).',
100
+                        fulltexts: ' . json_encode($this->fulltexts).',
101
+                        annotationContainers: ' . json_encode($this->annotationContainers).',
102
+                        useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0).'
103 103
                     });
104 104
                 }
105 105
             });
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
         $markerArray = [];
120 120
         if ($this->piVars['id']) {
121 121
             if ($this->conf['crop']) {
122
-                $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . $this->pi_getLL('editMode', '', true) . '">' . $this->pi_getLL('editMode', '', true) . '</a>';
123
-                $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . $this->pi_getLL('editRemove', '', true) . '">' . $this->pi_getLL('editRemove', '', true) . '</a>';
122
+                $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="'.$this->pi_getLL('editMode', '', true).'">'.$this->pi_getLL('editMode', '', true).'</a>';
123
+                $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="'.$this->pi_getLL('editRemove', '', true).'">'.$this->pi_getLL('editRemove', '', true).'</a>';
124 124
             } else {
125 125
                 $markerArray['###EDITBUTTON###'] = '';
126 126
                 $markerArray['###EDITREMOVE###'] = '';
127 127
             }
128 128
             if ($this->conf['magnifier']) {
129
-                $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . $this->pi_getLL('magnifier', '', true) . '">' . $this->pi_getLL('magnifier', '', true) . '</a>';
129
+                $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="'.$this->pi_getLL('magnifier', '', true).'">'.$this->pi_getLL('magnifier', '', true).'</a>';
130 130
             } else {
131 131
                 $markerArray['###MAGNIFIER###'] = '';
132 132
             }
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
                 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false),
162 162
                 'title' => $label
163 163
             ];
164
-            $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">';
165
-            $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="' . $this->piVars['page'] . '">';
166
-            $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="' . $this->piVars['page'] . '">';
164
+            $output = '<form id="addToBasketForm" action="'.$this->cObj->typoLink_URL($basketConf).'" method="post">';
165
+            $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="'.$this->piVars['page'].'">';
166
+            $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="'.$this->piVars['page'].'">';
167 167
             $output .= '<input type="hidden" name="tx_dlf[startX]" id="startX">';
168 168
             $output .= '<input type="hidden" name="tx_dlf[startY]" id="startY">';
169 169
             $output .= '<input type="hidden" name="tx_dlf[endX]" id="endX">';
170 170
             $output .= '<input type="hidden" name="tx_dlf[endY]" id="endY">';
171 171
             $output .= '<input type="hidden" name="tx_dlf[rotation]" id="rotation">';
172
-            $output .= '<button id="submitBasketForm" onclick="this.form.submit()">' . $label . '</button>';
172
+            $output .= '<button id="submitBasketForm" onclick="this.form.submit()">'.$label.'</button>';
173 173
             $output .= '</form>';
174 174
             $output .= '<script>';
175 175
             $output .= '$(document).ready(function() { $("#submitBasketForm").click(function() { $("#addToBasketForm").submit(); }); });';
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
                         'parameter' => $GLOBALS['TSFE']->id,
206 206
                         'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
207 207
                         'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
208
-                        'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($image['url']),
208
+                        'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($image['url']),
209 209
                     ];
210 210
                     $image['url'] = $this->cObj->typoLink_URL($linkConf);
211 211
                 }
212 212
                 $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]);
213 213
                 break;
214 214
             } else {
215
-                Helper::devLog('File not found in fileGrp "' . $fileGrp . '"', DEVLOG_SEVERITY_WARNING);
215
+                Helper::devLog('File not found in fileGrp "'.$fileGrp.'"', DEVLOG_SEVERITY_WARNING);
216 216
             }
217 217
         }
218 218
         return $image;
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
                     'parameter' => $GLOBALS['TSFE']->id,
240 240
                     'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
241 241
                     'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
242
-                    'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($fulltext['url']),
242
+                    'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($fulltext['url']),
243 243
                 ];
244 244
                 $fulltext['url'] = $this->cObj->typoLink_URL($linkConf);
245 245
             }
246 246
             $fulltext['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']]);
247 247
         } else {
248
-            Helper::devLog('File not found in fileGrp "' . $this->conf['fileGrpFulltext'] . '"', DEVLOG_SEVERITY_WARNING);
248
+            Helper::devLog('File not found in fileGrp "'.$this->conf['fileGrpFulltext'].'"', DEVLOG_SEVERITY_WARNING);
249 249
         }
250 250
         return $fulltext;
251 251
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
         $markerArray = [];
120 120
         if ($this->piVars['id']) {
121 121
             if ($this->conf['crop']) {
122
-                $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . $this->pi_getLL('editMode', '', true) . '">' . $this->pi_getLL('editMode', '', true) . '</a>';
123
-                $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . $this->pi_getLL('editRemove', '', true) . '">' . $this->pi_getLL('editRemove', '', true) . '</a>';
122
+                $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . $this->pi_getLL('editMode', '', TRUE) . '">' . $this->pi_getLL('editMode', '', TRUE) . '</a>';
123
+                $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . $this->pi_getLL('editRemove', '', TRUE) . '">' . $this->pi_getLL('editRemove', '', TRUE) . '</a>';
124 124
             } else {
125 125
                 $markerArray['###EDITBUTTON###'] = '';
126 126
                 $markerArray['###EDITREMOVE###'] = '';
127 127
             }
128 128
             if ($this->conf['magnifier']) {
129
-                $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . $this->pi_getLL('magnifier', '', true) . '">' . $this->pi_getLL('magnifier', '', true) . '</a>';
129
+                $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . $this->pi_getLL('magnifier', '', TRUE) . '">' . $this->pi_getLL('magnifier', '', TRUE) . '</a>';
130 130
             } else {
131 131
                 $markerArray['###MAGNIFIER###'] = '';
132 132
             }
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
         $markerArray = [];
147 147
         // Add basket button
148 148
         if ($this->conf['basketButton'] && $this->conf['targetBasket'] && $this->piVars['id']) {
149
-            $label = $this->pi_getLL('addBasket', '', true);
149
+            $label = $this->pi_getLL('addBasket', '', TRUE);
150 150
             $params = [
151 151
                 'id' => $this->piVars['id'],
152
-                'addToBasket' => true
152
+                'addToBasket' => TRUE
153 153
             ];
154 154
             if (empty($this->piVars['page'])) {
155 155
                 $params['page'] = 1;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                 'parameter' => $this->conf['targetBasket'],
159 159
                 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
160 160
                 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
161
-                'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false),
161
+                'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', TRUE, FALSE),
162 162
                 'title' => $label
163 163
             ];
164 164
             $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">';
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             if ($iiif instanceof ManifestInterface) {
268 268
                 $canvas = $iiif->getContainedResourceById($canvasId);
269 269
                 /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */
270
-                if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
270
+                if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
271 271
                     $annotationContainers = [];
272 272
                     /*
273 273
                      *  TODO Analyzing the annotations on the server side requires loading the annotation lists / pages
@@ -277,11 +277,11 @@  discard block
 block discarded – undo
277 277
                      *  On the other hand, server connections are potentially better than client connections. Downloading annotation lists
278 278
                      */
279 279
                     foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) {
280
-                        if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) {
280
+                        if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) {
281 281
                             foreach ($textAnnotations as $annotation) {
282 282
                                 if (
283 283
                                     $annotation->getBody()->getFormat() == 'text/plain'
284
-                                    && $annotation->getBody()->getChars() != null
284
+                                    && $annotation->getBody()->getChars() != NULL
285 285
                                 ) {
286 286
                                     $annotationListData = [];
287 287
                                     $annotationListData['uri'] = $annotationContainer->getId();
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         // Load current document.
324 324
         $this->loadDocument();
325 325
         if (
326
-            $this->doc === null
326
+            $this->doc === NULL
327 327
             || $this->doc->numPages < 1
328 328
         ) {
329 329
             // Quit without doing anything if required variables are not set.
Please login to merge, or discard this patch.
Classes/Plugin/Navigation.php 3 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
             'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
70 70
             'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http']
71 71
         ];
72
-        $output = '<form action="' . $this->cObj->typoLink_URL($linkConf) . '" method="get"><div><input type="hidden" name="id" value="' . $GLOBALS['TSFE']->id . '" />';
72
+        $output = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />';
73 73
         // Add plugin variables.
74 74
         foreach ($this->piVars as $piVar => $value) {
75 75
             if ($piVar != 'page' && $piVar != 'DATA' && !empty($value)) {
76
-                $output .= '<input type="hidden" name="' . $this->prefixId . '[' . $piVar . ']" value="' . $value . '" />';
76
+                $output .= '<input type="hidden" name="'.$this->prefixId.'['.$piVar.']" value="'.$value.'" />';
77 77
             }
78 78
         }
79 79
         // Add page selector.
80
-        $uniqId = uniqid(Helper::getUnqualifiedClassName(get_class($this)) . '-');
81
-        $output .= '<label for="' . $uniqId . '">' . $this->pi_getLL('selectPage', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[page]" onchange="javascript:this.form.submit();"' . ($this->doc->numPages < 1 ? ' disabled="disabled"' : '') . '>';
80
+        $uniqId = uniqid(Helper::getUnqualifiedClassName(get_class($this)).'-');
81
+        $output .= '<label for="'.$uniqId.'">'.$this->pi_getLL('selectPage', '', true).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[page]" onchange="javascript:this.form.submit();"'.($this->doc->numPages < 1 ? ' disabled="disabled"' : '').'>';
82 82
         for ($i = 1; $i <= $this->doc->numPages; $i++) {
83
-            $output .= '<option value="' . $i . '"' . ($this->piVars['page'] == $i ? ' selected="selected"' : '') . '>[' . $i . ']' . ($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel'] ? ' - ' . htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel']) : '') . '</option>';
83
+            $output .= '<option value="'.$i.'"'.($this->piVars['page'] == $i ? ' selected="selected"' : '').'>['.$i.']'.($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel'] ? ' - '.htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel']) : '').'</option>';
84 84
         }
85 85
         $output .= '</select></div></form>';
86 86
         return $output;
@@ -138,53 +138,53 @@  discard block
 block discarded – undo
138 138
         if ($this->piVars['page'] > 1) {
139 139
             $markerArray['###FIRST###'] = $this->makeLink($this->pi_getLL('firstPage', '', true), ['page' => 1]);
140 140
         } else {
141
-            $markerArray['###FIRST###'] = '<span title="' . $this->pi_getLL('firstPage', '', true) . '">' . $this->pi_getLL('firstPage', '', true) . '</span>';
141
+            $markerArray['###FIRST###'] = '<span title="'.$this->pi_getLL('firstPage', '', true).'">'.$this->pi_getLL('firstPage', '', true).'</span>';
142 142
         }
143 143
         // Link back X pages.
144 144
         if ($this->piVars['page'] > $pageSteps) {
145 145
             $markerArray['###BACK###'] = $this->makeLink(sprintf($this->pi_getLL('backXPages', '', true), $pageSteps), ['page' => $this->piVars['page'] - $pageSteps]);
146 146
         } else {
147
-            $markerArray['###BACK###'] = '<span title="' . sprintf($this->pi_getLL('backXPages', '', true), $pageSteps) . '">' . sprintf($this->pi_getLL('backXPages', '', true), $pageSteps) . '</span>';
147
+            $markerArray['###BACK###'] = '<span title="'.sprintf($this->pi_getLL('backXPages', '', true), $pageSteps).'">'.sprintf($this->pi_getLL('backXPages', '', true), $pageSteps).'</span>';
148 148
         }
149 149
         // Link to previous page.
150 150
         if ($this->piVars['page'] > (1 + $this->piVars['double'])) {
151 151
             $markerArray['###PREVIOUS###'] = $this->makeLink($this->pi_getLL('prevPage', '', true), ['page' => $this->piVars['page'] - (1 + $this->piVars['double'])]);
152 152
         } else {
153
-            $markerArray['###PREVIOUS###'] = '<span title="' . $this->pi_getLL('prevPage', '', true) . '">' . $this->pi_getLL('prevPage', '', true) . '</span>';
153
+            $markerArray['###PREVIOUS###'] = '<span title="'.$this->pi_getLL('prevPage', '', true).'">'.$this->pi_getLL('prevPage', '', true).'</span>';
154 154
         }
155 155
         // Link to next page.
156 156
         if ($this->piVars['page'] < ($this->doc->numPages - $this->piVars['double'])) {
157 157
             $markerArray['###NEXT###'] = $this->makeLink($this->pi_getLL('nextPage', '', true), ['page' => $this->piVars['page'] + (1 + $this->piVars['double'])]);
158 158
         } else {
159
-            $markerArray['###NEXT###'] = '<span title="' . $this->pi_getLL('nextPage', '', true) . '">' . $this->pi_getLL('nextPage', '', true) . '</span>';
159
+            $markerArray['###NEXT###'] = '<span title="'.$this->pi_getLL('nextPage', '', true).'">'.$this->pi_getLL('nextPage', '', true).'</span>';
160 160
         }
161 161
         // Link forward X pages.
162 162
         if ($this->piVars['page'] <= ($this->doc->numPages - $pageSteps)) {
163 163
             $markerArray['###FORWARD###'] = $this->makeLink(sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps), ['page' => $this->piVars['page'] + $pageSteps]);
164 164
         } else {
165
-            $markerArray['###FORWARD###'] = '<span title="' . sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps) . '">' . sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps) . '</span>';
165
+            $markerArray['###FORWARD###'] = '<span title="'.sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps).'">'.sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps).'</span>';
166 166
         }
167 167
         // Link to last page.
168 168
         if ($this->piVars['page'] < $this->doc->numPages) {
169 169
             $markerArray['###LAST###'] = $this->makeLink($this->pi_getLL('lastPage', '', true), ['page' => $this->doc->numPages]);
170 170
         } else {
171
-            $markerArray['###LAST###'] = '<span title="' . $this->pi_getLL('lastPage', '', true) . '">' . $this->pi_getLL('lastPage', '', true) . '</span>';
171
+            $markerArray['###LAST###'] = '<span title="'.$this->pi_getLL('lastPage', '', true).'">'.$this->pi_getLL('lastPage', '', true).'</span>';
172 172
         }
173 173
         // Add double page switcher.
174 174
         if ($this->doc->numPages > 0) {
175 175
             if (!$this->piVars['double']) {
176
-                $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', true), ['double' => 1], 'class="tx-dlf-navigation-doubleOn" title="' . $this->pi_getLL('doublePageOn', '', true) . '"');
176
+                $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', true), ['double' => 1], 'class="tx-dlf-navigation-doubleOn" title="'.$this->pi_getLL('doublePageOn', '', true).'"');
177 177
             } else {
178
-                $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', true), ['double' => 0], 'class="tx-dlf-navigation-doubleOff" title="' . $this->pi_getLL('doublePageOff', '', true) . '"');
178
+                $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', true), ['double' => 0], 'class="tx-dlf-navigation-doubleOff" title="'.$this->pi_getLL('doublePageOff', '', true).'"');
179 179
             }
180 180
             if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) {
181
-                $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', true), ['page' => $this->piVars['page'] + 1], 'title="' . $this->pi_getLL('doublePage+1', '', true) . '"');
181
+                $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', true), ['page' => $this->piVars['page'] + 1], 'title="'.$this->pi_getLL('doublePage+1', '', true).'"');
182 182
             } else {
183
-                $markerArray['###DOUBLEPAGE+1###'] = '<span title="' . $this->pi_getLL('doublePage+1', '', true) . '">' . $this->pi_getLL('doublePage+1', '', true) . '</span>';
183
+                $markerArray['###DOUBLEPAGE+1###'] = '<span title="'.$this->pi_getLL('doublePage+1', '', true).'">'.$this->pi_getLL('doublePage+1', '', true).'</span>';
184 184
             }
185 185
         } else {
186
-            $markerArray['###DOUBLEPAGE###'] = '<span title="' . $this->pi_getLL('doublePageOn', '', true) . '">' . $this->pi_getLL('doublePageOn', '', true) . '</span>';
187
-            $markerArray['###DOUBLEPAGE+1###'] = '<span title="' . $this->pi_getLL('doublePage+1', '', true) . '">' . $this->pi_getLL('doublePage+1', '', true) . '</span>';
186
+            $markerArray['###DOUBLEPAGE###'] = '<span title="'.$this->pi_getLL('doublePageOn', '', true).'">'.$this->pi_getLL('doublePageOn', '', true).'</span>';
187
+            $markerArray['###DOUBLEPAGE+1###'] = '<span title="'.$this->pi_getLL('doublePage+1', '', true).'">'.$this->pi_getLL('doublePage+1', '', true).'</span>';
188 188
         }
189 189
         // Add page selector.
190 190
         $markerArray['###PAGESELECT###'] = $this->getPageSelector();
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
23 23
  * @subpackage dlf
24 24
  * @access public
25 25
  */
26
-class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin
27
-{
26
+class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin {
28 27
     public $scriptRelPath = 'Classes/Plugin/Navigation.php';
29 28
 
30 29
     /**
@@ -34,8 +33,7 @@  discard block
 block discarded – undo
34 33
      *
35 34
      * @return string Link to the list view ready to output
36 35
      */
37
-    protected function getLinkToListview()
38
-    {
36
+    protected function getLinkToListview() {
39 37
         if (!empty($this->conf['targetPid'])) {
40 38
             // Load the list.
41 39
             $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(DocumentList::class);
@@ -61,8 +59,7 @@  discard block
 block discarded – undo
61 59
      *
62 60
      * @return string Page selector ready to output
63 61
      */
64
-    protected function getPageSelector()
65
-    {
62
+    protected function getPageSelector() {
66 63
         // Configure @action URL for form.
67 64
         $linkConf = [
68 65
             'parameter' => $GLOBALS['TSFE']->id,
@@ -96,8 +93,7 @@  discard block
 block discarded – undo
96 93
      *
97 94
      * @return string The content that is displayed on the website
98 95
      */
99
-    public function main($content, $conf)
100
-    {
96
+    public function main($content, $conf) {
101 97
         $this->init($conf);
102 98
         // Turn cache on.
103 99
         $this->setCache(true);
@@ -212,8 +208,7 @@  discard block
 block discarded – undo
212 208
      *
213 209
      * @return string Typolink ready to output
214 210
      */
215
-    protected function makeLink($label, array $overrulePIvars = [], $aTagParams = '')
216
-    {
211
+    protected function makeLink($label, array $overrulePIvars = [], $aTagParams = '') {
217 212
         // Merge plugin variables with new set of values.
218 213
         if (is_array($this->piVars)) {
219 214
             $piVars = $this->piVars;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
                     'parameter' => $this->conf['targetPid'],
47 47
                     'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
48 48
                     'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
49
-                    'title' => $this->pi_getLL('linkToList', '', true)
49
+                    'title' => $this->pi_getLL('linkToList', '', TRUE)
50 50
                 ];
51
-                return $this->cObj->typoLink($this->pi_getLL('linkToList', '', true), $conf);
51
+                return $this->cObj->typoLink($this->pi_getLL('linkToList', '', TRUE), $conf);
52 52
             }
53 53
         }
54 54
         return '';
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         }
79 79
         // Add page selector.
80 80
         $uniqId = uniqid(Helper::getUnqualifiedClassName(get_class($this)) . '-');
81
-        $output .= '<label for="' . $uniqId . '">' . $this->pi_getLL('selectPage', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[page]" onchange="javascript:this.form.submit();"' . ($this->doc->numPages < 1 ? ' disabled="disabled"' : '') . '>';
81
+        $output .= '<label for="' . $uniqId . '">' . $this->pi_getLL('selectPage', '', TRUE) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[page]" onchange="javascript:this.form.submit();"' . ($this->doc->numPages < 1 ? ' disabled="disabled"' : '') . '>';
82 82
         for ($i = 1; $i <= $this->doc->numPages; $i++) {
83 83
             $output .= '<option value="' . $i . '"' . ($this->piVars['page'] == $i ? ' selected="selected"' : '') . '>[' . $i . ']' . ($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel'] ? ' - ' . htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel']) : '') . '</option>';
84 84
         }
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
     {
101 101
         $this->init($conf);
102 102
         // Turn cache on.
103
-        $this->setCache(true);
103
+        $this->setCache(TRUE);
104 104
         // Load current document.
105 105
         $this->loadDocument();
106
-        if ($this->doc === null) {
106
+        if ($this->doc === NULL) {
107 107
             // Quit without doing anything if required variables are not set.
108 108
             return $content;
109 109
         } else {
@@ -136,67 +136,67 @@  discard block
 block discarded – undo
136 136
         $pageSteps = $this->conf['pageStep'] * ($this->piVars['double'] + 1);
137 137
         // Link to first page.
138 138
         if ($this->piVars['page'] > 1) {
139
-            $markerArray['###FIRST###'] = $this->makeLink($this->pi_getLL('firstPage', '', true), ['page' => 1]);
139
+            $markerArray['###FIRST###'] = $this->makeLink($this->pi_getLL('firstPage', '', TRUE), ['page' => 1]);
140 140
         } else {
141
-            $markerArray['###FIRST###'] = '<span title="' . $this->pi_getLL('firstPage', '', true) . '">' . $this->pi_getLL('firstPage', '', true) . '</span>';
141
+            $markerArray['###FIRST###'] = '<span title="' . $this->pi_getLL('firstPage', '', TRUE) . '">' . $this->pi_getLL('firstPage', '', TRUE) . '</span>';
142 142
         }
143 143
         // Link back X pages.
144 144
         if ($this->piVars['page'] > $pageSteps) {
145
-            $markerArray['###BACK###'] = $this->makeLink(sprintf($this->pi_getLL('backXPages', '', true), $pageSteps), ['page' => $this->piVars['page'] - $pageSteps]);
145
+            $markerArray['###BACK###'] = $this->makeLink(sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps), ['page' => $this->piVars['page'] - $pageSteps]);
146 146
         } else {
147
-            $markerArray['###BACK###'] = '<span title="' . sprintf($this->pi_getLL('backXPages', '', true), $pageSteps) . '">' . sprintf($this->pi_getLL('backXPages', '', true), $pageSteps) . '</span>';
147
+            $markerArray['###BACK###'] = '<span title="' . sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps) . '">' . sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps) . '</span>';
148 148
         }
149 149
         // Link to previous page.
150 150
         if ($this->piVars['page'] > (1 + $this->piVars['double'])) {
151
-            $markerArray['###PREVIOUS###'] = $this->makeLink($this->pi_getLL('prevPage', '', true), ['page' => $this->piVars['page'] - (1 + $this->piVars['double'])]);
151
+            $markerArray['###PREVIOUS###'] = $this->makeLink($this->pi_getLL('prevPage', '', TRUE), ['page' => $this->piVars['page'] - (1 + $this->piVars['double'])]);
152 152
         } else {
153
-            $markerArray['###PREVIOUS###'] = '<span title="' . $this->pi_getLL('prevPage', '', true) . '">' . $this->pi_getLL('prevPage', '', true) . '</span>';
153
+            $markerArray['###PREVIOUS###'] = '<span title="' . $this->pi_getLL('prevPage', '', TRUE) . '">' . $this->pi_getLL('prevPage', '', TRUE) . '</span>';
154 154
         }
155 155
         // Link to next page.
156 156
         if ($this->piVars['page'] < ($this->doc->numPages - $this->piVars['double'])) {
157
-            $markerArray['###NEXT###'] = $this->makeLink($this->pi_getLL('nextPage', '', true), ['page' => $this->piVars['page'] + (1 + $this->piVars['double'])]);
157
+            $markerArray['###NEXT###'] = $this->makeLink($this->pi_getLL('nextPage', '', TRUE), ['page' => $this->piVars['page'] + (1 + $this->piVars['double'])]);
158 158
         } else {
159
-            $markerArray['###NEXT###'] = '<span title="' . $this->pi_getLL('nextPage', '', true) . '">' . $this->pi_getLL('nextPage', '', true) . '</span>';
159
+            $markerArray['###NEXT###'] = '<span title="' . $this->pi_getLL('nextPage', '', TRUE) . '">' . $this->pi_getLL('nextPage', '', TRUE) . '</span>';
160 160
         }
161 161
         // Link forward X pages.
162 162
         if ($this->piVars['page'] <= ($this->doc->numPages - $pageSteps)) {
163
-            $markerArray['###FORWARD###'] = $this->makeLink(sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps), ['page' => $this->piVars['page'] + $pageSteps]);
163
+            $markerArray['###FORWARD###'] = $this->makeLink(sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps), ['page' => $this->piVars['page'] + $pageSteps]);
164 164
         } else {
165
-            $markerArray['###FORWARD###'] = '<span title="' . sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps) . '">' . sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps) . '</span>';
165
+            $markerArray['###FORWARD###'] = '<span title="' . sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps) . '">' . sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps) . '</span>';
166 166
         }
167 167
         // Link to last page.
168 168
         if ($this->piVars['page'] < $this->doc->numPages) {
169
-            $markerArray['###LAST###'] = $this->makeLink($this->pi_getLL('lastPage', '', true), ['page' => $this->doc->numPages]);
169
+            $markerArray['###LAST###'] = $this->makeLink($this->pi_getLL('lastPage', '', TRUE), ['page' => $this->doc->numPages]);
170 170
         } else {
171
-            $markerArray['###LAST###'] = '<span title="' . $this->pi_getLL('lastPage', '', true) . '">' . $this->pi_getLL('lastPage', '', true) . '</span>';
171
+            $markerArray['###LAST###'] = '<span title="' . $this->pi_getLL('lastPage', '', TRUE) . '">' . $this->pi_getLL('lastPage', '', TRUE) . '</span>';
172 172
         }
173 173
         // Add double page switcher.
174 174
         if ($this->doc->numPages > 0) {
175 175
             if (!$this->piVars['double']) {
176
-                $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', true), ['double' => 1], 'class="tx-dlf-navigation-doubleOn" title="' . $this->pi_getLL('doublePageOn', '', true) . '"');
176
+                $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', TRUE), ['double' => 1], 'class="tx-dlf-navigation-doubleOn" title="' . $this->pi_getLL('doublePageOn', '', TRUE) . '"');
177 177
             } else {
178
-                $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', true), ['double' => 0], 'class="tx-dlf-navigation-doubleOff" title="' . $this->pi_getLL('doublePageOff', '', true) . '"');
178
+                $markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', TRUE), ['double' => 0], 'class="tx-dlf-navigation-doubleOff" title="' . $this->pi_getLL('doublePageOff', '', TRUE) . '"');
179 179
             }
180 180
             if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) {
181
-                $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', true), ['page' => $this->piVars['page'] + 1], 'title="' . $this->pi_getLL('doublePage+1', '', true) . '"');
181
+                $markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', TRUE), ['page' => $this->piVars['page'] + 1], 'title="' . $this->pi_getLL('doublePage+1', '', TRUE) . '"');
182 182
             } else {
183
-                $markerArray['###DOUBLEPAGE+1###'] = '<span title="' . $this->pi_getLL('doublePage+1', '', true) . '">' . $this->pi_getLL('doublePage+1', '', true) . '</span>';
183
+                $markerArray['###DOUBLEPAGE+1###'] = '<span title="' . $this->pi_getLL('doublePage+1', '', TRUE) . '">' . $this->pi_getLL('doublePage+1', '', TRUE) . '</span>';
184 184
             }
185 185
         } else {
186
-            $markerArray['###DOUBLEPAGE###'] = '<span title="' . $this->pi_getLL('doublePageOn', '', true) . '">' . $this->pi_getLL('doublePageOn', '', true) . '</span>';
187
-            $markerArray['###DOUBLEPAGE+1###'] = '<span title="' . $this->pi_getLL('doublePage+1', '', true) . '">' . $this->pi_getLL('doublePage+1', '', true) . '</span>';
186
+            $markerArray['###DOUBLEPAGE###'] = '<span title="' . $this->pi_getLL('doublePageOn', '', TRUE) . '">' . $this->pi_getLL('doublePageOn', '', TRUE) . '</span>';
187
+            $markerArray['###DOUBLEPAGE+1###'] = '<span title="' . $this->pi_getLL('doublePage+1', '', TRUE) . '">' . $this->pi_getLL('doublePage+1', '', TRUE) . '</span>';
188 188
         }
189 189
         // Add page selector.
190 190
         $markerArray['###PAGESELECT###'] = $this->getPageSelector();
191 191
         // Add link to listview if applicable.
192 192
         $markerArray['###LINKLISTVIEW###'] = $this->getLinkToListview();
193 193
         // Fill some language labels if available.
194
-        $markerArray['###ZOOM_IN###'] = $this->pi_getLL('zoom-in', '', true);
195
-        $markerArray['###ZOOM_OUT###'] = $this->pi_getLL('zoom-out', '', true);
196
-        $markerArray['###ZOOM_FULLSCREEN###'] = $this->pi_getLL('zoom-fullscreen', '', true);
197
-        $markerArray['###ROTATE_LEFT###'] = $this->pi_getLL('rotate-left', '', true);
198
-        $markerArray['###ROTATE_RIGHT###'] = $this->pi_getLL('rotate-right', '', true);
199
-        $markerArray['###ROTATE_RESET###'] = $this->pi_getLL('rotate-reset', '', true);
194
+        $markerArray['###ZOOM_IN###'] = $this->pi_getLL('zoom-in', '', TRUE);
195
+        $markerArray['###ZOOM_OUT###'] = $this->pi_getLL('zoom-out', '', TRUE);
196
+        $markerArray['###ZOOM_FULLSCREEN###'] = $this->pi_getLL('zoom-fullscreen', '', TRUE);
197
+        $markerArray['###ROTATE_LEFT###'] = $this->pi_getLL('rotate-left', '', TRUE);
198
+        $markerArray['###ROTATE_RIGHT###'] = $this->pi_getLL('rotate-right', '', TRUE);
199
+        $markerArray['###ROTATE_RESET###'] = $this->pi_getLL('rotate-reset', '', TRUE);
200 200
         $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
201 201
         return $this->pi_wrapInBaseClass($content);
202 202
     }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
228 228
             'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
229 229
             'ATagParams' => $aTagParams,
230
-            'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', true, false),
230
+            'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', TRUE, FALSE),
231 231
             'title' => $label
232 232
         ];
233 233
         return $this->cObj->typoLink($label, $conf);
Please login to merge, or discard this patch.
Classes/Common/AbstractPlugin.php 3 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $templateFile = $this->conf['templateFile'];
77 77
         } else {
78 78
             // Load default template from extension.
79
-            $templateFile = 'EXT:' . $this->extKey . '/Resources/Private/Templates/' . Helper::getUnqualifiedClassName(get_class($this)) . '.tmpl';
79
+            $templateFile = 'EXT:'.$this->extKey.'/Resources/Private/Templates/'.Helper::getUnqualifiedClassName(get_class($this)).'.tmpl';
80 80
         }
81 81
         // Substitute strings like "EXT:" in given template file location.
82 82
         $fileResource = $GLOBALS['TSFE']->tmpl->getFileName($templateFile);
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
             $conf = Helper::mergeRecursiveWithOverrule($flexFormConf, $conf);
103 103
         }
104 104
         // Read plugin TS configuration.
105
-        $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '.'];
105
+        $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_'.strtolower(Helper::getUnqualifiedClassName(get_class($this))).'.'];
106 106
         if (is_array($pluginConf)) {
107 107
             $conf = Helper::mergeRecursiveWithOverrule($pluginConf, $conf);
108 108
         }
109 109
         // Read general TS configuration.
110
-        $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.'];
110
+        $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId.'.'];
111 111
         if (is_array($generalConf)) {
112 112
             $conf = Helper::mergeRecursiveWithOverrule($generalConf, $conf);
113 113
         }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         // Set default plugin variables.
126 126
         $this->pi_setPiVarDefaults();
127 127
         // Load translation files.
128
-        $this->pi_loadLL('EXT:' . $this->extKey . '/Resources/Private/Language/' . Helper::getUnqualifiedClassName(get_class($this)) . '.xml');
128
+        $this->pi_loadLL('EXT:'.$this->extKey.'/Resources/Private/Language/'.Helper::getUnqualifiedClassName(get_class($this)).'.xml');
129 129
     }
130 130
 
131 131
     /**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             if (!$this->doc->ready) {
150 150
                 // Destroy the incomplete object.
151 151
                 $this->doc = null;
152
-                Helper::devLog('Failed to load document with UID ' . $this->piVars['id'], DEVLOG_SEVERITY_ERROR);
152
+                Helper::devLog('Failed to load document with UID '.$this->piVars['id'], DEVLOG_SEVERITY_ERROR);
153 153
             } else {
154 154
                 // Set configuration PID.
155 155
                 $this->doc->cPid = $this->conf['pages'];
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
                 // Try to load document.
178 178
                 $this->loadDocument();
179 179
             } else {
180
-                Helper::devLog('Failed to load document with record ID "' . $this->piVars['recordId'] . '"', DEVLOG_SEVERITY_ERROR);
180
+                Helper::devLog('Failed to load document with record ID "'.$this->piVars['recordId'].'"', DEVLOG_SEVERITY_ERROR);
181 181
             }
182 182
         } else {
183
-            Helper::devLog('Invalid UID ' . $this->piVars['id'] . ' or PID ' . $this->conf['pages'] . ' for document loading', DEVLOG_SEVERITY_ERROR);
183
+            Helper::devLog('Invalid UID '.$this->piVars['id'].' or PID '.$this->conf['pages'].' for document loading', DEVLOG_SEVERITY_ERROR);
184 184
         }
185 185
     }
186 186
 
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
         if (!$cache) {
234 234
             $conf['no_cache'] = true;
235 235
         }
236
-        $conf['parameter'] = $altPageId ?: ($this->pi_tmpPageId ?: 'current');
237
-        $conf['additionalParams'] = $this->conf['parent.']['addParams'] . HttpUtility::buildQueryString($urlParameters, '&', true) . $this->pi_moreParams;
236
+        $conf['parameter'] = $altPageId ? : ($this->pi_tmpPageId ? : 'current');
237
+        $conf['additionalParams'] = $this->conf['parent.']['addParams'].HttpUtility::buildQueryString($urlParameters, '&', true).$this->pi_moreParams;
238 238
         // Add additional configuration for absolute URLs.
239 239
         $conf['forceAbsoluteUrl'] = !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0;
240 240
         $conf['forceAbsoluteUrl.']['scheme'] = !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http';
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
     {
256 256
         if (!$this->frontendController->config['config']['disableWrapInBaseClass']) {
257 257
             // Use class name instead of $this->prefixId for content wrapping because $this->prefixId is the same for all plugins.
258
-            $content = '<div class="tx-dlf-' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '">' . $content . '</div>';
258
+            $content = '<div class="tx-dlf-'.strtolower(Helper::getUnqualifiedClassName(get_class($this))).'">'.$content.'</div>';
259 259
             if (!$this->frontendController->config['config']['disablePrefixComment']) {
260
-                $content = "\n\n<!-- BEGIN: Content of extension '" . $this->extKey . "', plugin '" . Helper::getUnqualifiedClassName(get_class($this)) . "' -->\n\n" . $content . "\n\n<!-- END: Content of extension '" . $this->extKey . "', plugin '" . Helper::getUnqualifiedClassName(get_class($this)) . "' -->\n\n";
260
+                $content = "\n\n<!-- BEGIN: Content of extension '".$this->extKey."', plugin '".Helper::getUnqualifiedClassName(get_class($this))."' -->\n\n".$content."\n\n<!-- END: Content of extension '".$this->extKey."', plugin '".Helper::getUnqualifiedClassName(get_class($this))."' -->\n\n";
261 261
             }
262 262
         }
263 263
         return $content;
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
  * @access public
27 27
  * @abstract
28 28
  */
29
-abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
30
-{
29
+abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
31 30
     public $extKey = 'dlf';
32 31
     public $prefixId = 'tx_dlf';
33 32
     public $scriptRelPath = 'Classes/Common/AbstractPlugin.php';
@@ -68,8 +67,7 @@  discard block
 block discarded – undo
68 67
      *
69 68
      * @return void
70 69
      */
71
-    protected function getTemplate($part = '###TEMPLATE###')
72
-    {
70
+    protected function getTemplate($part = '###TEMPLATE###') {
73 71
         $this->templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
74 72
         if (!empty($this->conf['templateFile'])) {
75 73
             // Load template file from configuration.
@@ -93,8 +91,7 @@  discard block
 block discarded – undo
93 91
      *
94 92
      * @return void
95 93
      */
96
-    protected function init(array $conf)
97
-    {
94
+    protected function init(array $conf) {
98 95
         // Read FlexForm configuration.
99 96
         $flexFormConf = [];
100 97
         $this->cObj->readFlexformIntoConf($this->cObj->data['pi_flexform'], $flexFormConf);
@@ -135,8 +132,7 @@  discard block
 block discarded – undo
135 132
      *
136 133
      * @return void
137 134
      */
138
-    protected function loadDocument()
139
-    {
135
+    protected function loadDocument() {
140 136
         // Check for required variable.
141 137
         if (
142 138
             !empty($this->piVars['id'])
@@ -207,8 +203,7 @@  discard block
 block discarded – undo
207 203
      *
208 204
      * @return array The resulting typoscript array
209 205
      */
210
-    protected function parseTS($string = '')
211
-    {
206
+    protected function parseTS($string = '') {
212 207
         $parser = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::class);
213 208
         $parser->parse($string);
214 209
         return $parser->setup;
@@ -227,8 +222,7 @@  discard block
 block discarded – undo
227 222
      *
228 223
      * @return string The input string wrapped in <a> tags
229 224
      */
230
-    public function pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0)
231
-    {
225
+    public function pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0) {
232 226
         $conf = [];
233 227
         if (!$cache) {
234 228
             $conf['no_cache'] = true;
@@ -251,8 +245,7 @@  discard block
 block discarded – undo
251 245
      *
252 246
      * @return string HTML content wrapped, ready to return to the parent object.
253 247
      */
254
-    public function pi_wrapInBaseClass($content)
255
-    {
248
+    public function pi_wrapInBaseClass($content) {
256 249
         if (!$this->frontendController->config['config']['disableWrapInBaseClass']) {
257 250
             // Use class name instead of $this->prefixId for content wrapping because $this->prefixId is the same for all plugins.
258 251
             $content = '<div class="tx-dlf-' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '">' . $content . '</div>';
@@ -272,8 +265,7 @@  discard block
 block discarded – undo
272 265
      *
273 266
      * @return void
274 267
      */
275
-    protected function setCache($cache = true)
276
-    {
268
+    protected function setCache($cache = true) {
277 269
         if ($cache) {
278 270
             // Set cObject type to "USER" (default).
279 271
             $this->pi_USER_INT_obj = false;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
     public $prefixId = 'tx_dlf';
33 33
     public $scriptRelPath = 'Classes/Common/AbstractPlugin.php';
34 34
     // Plugins are cached by default (@see setCache()).
35
-    public $pi_USER_INT_obj = false;
36
-    public $pi_checkCHash = true;
35
+    public $pi_USER_INT_obj = FALSE;
36
+    public $pi_checkCHash = TRUE;
37 37
 
38 38
     /**
39 39
      * This holds the current document
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             $this->doc = Document::getInstance($this->piVars['id'], $pid);
149 149
             if (!$this->doc->ready) {
150 150
                 // Destroy the incomplete object.
151
-                $this->doc = null;
151
+                $this->doc = NULL;
152 152
                 Helper::devLog('Failed to load document with UID ' . $this->piVars['id'], DEVLOG_SEVERITY_ERROR);
153 153
             } else {
154 154
                 // Set configuration PID.
@@ -227,14 +227,14 @@  discard block
 block discarded – undo
227 227
      *
228 228
      * @return string The input string wrapped in <a> tags
229 229
      */
230
-    public function pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0)
230
+    public function pi_linkTP($str, $urlParameters = [], $cache = FALSE, $altPageId = 0)
231 231
     {
232 232
         $conf = [];
233 233
         if (!$cache) {
234
-            $conf['no_cache'] = true;
234
+            $conf['no_cache'] = TRUE;
235 235
         }
236 236
         $conf['parameter'] = $altPageId ?: ($this->pi_tmpPageId ?: 'current');
237
-        $conf['additionalParams'] = $this->conf['parent.']['addParams'] . HttpUtility::buildQueryString($urlParameters, '&', true) . $this->pi_moreParams;
237
+        $conf['additionalParams'] = $this->conf['parent.']['addParams'] . HttpUtility::buildQueryString($urlParameters, '&', TRUE) . $this->pi_moreParams;
238 238
         // Add additional configuration for absolute URLs.
239 239
         $conf['forceAbsoluteUrl'] = !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0;
240 240
         $conf['forceAbsoluteUrl.']['scheme'] = !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http';
@@ -272,20 +272,20 @@  discard block
 block discarded – undo
272 272
      *
273 273
      * @return void
274 274
      */
275
-    protected function setCache($cache = true)
275
+    protected function setCache($cache = TRUE)
276 276
     {
277 277
         if ($cache) {
278 278
             // Set cObject type to "USER" (default).
279
-            $this->pi_USER_INT_obj = false;
280
-            $this->pi_checkCHash = true;
279
+            $this->pi_USER_INT_obj = FALSE;
280
+            $this->pi_checkCHash = TRUE;
281 281
             if (count($this->piVars)) {
282 282
                 // Check cHash or disable caching.
283 283
                 $GLOBALS['TSFE']->reqCHash();
284 284
             }
285 285
         } else {
286 286
             // Set cObject type to "USER_INT".
287
-            $this->pi_USER_INT_obj = true;
288
-            $this->pi_checkCHash = false;
287
+            $this->pi_USER_INT_obj = TRUE;
288
+            $this->pi_checkCHash = FALSE;
289 289
             // Plugins are of type "USER" by default, so convert it to "USER_INT".
290 290
             $this->cObj->convertToUserIntObject();
291 291
         }
Please login to merge, or discard this patch.