@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | // There may be a single non-signifying space after the doc-comment asterisk, |
185 | 185 | // which is not included. |
186 | - $text .= preg_replace('#\\s*/?[*/]*\\s?(.*)$#', '$1', $line) . "\n"; |
|
186 | + $text .= preg_replace('#\\s*/?[*/]*\\s?(.*)$#', '$1', $line)."\n"; |
|
187 | 187 | } |
188 | 188 | $text = trim($text); |
189 | 189 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | RST); |
205 | 205 | |
206 | 206 | // Sort tables alphabetically |
207 | - usort($tables, function ($lhs, $rhs) { |
|
207 | + usort($tables, function($lhs, $rhs) { |
|
208 | 208 | return $lhs->name <=> $rhs->name; |
209 | 209 | }); |
210 | 210 | |
@@ -214,13 +214,13 @@ discard block |
||
214 | 214 | // Set header |
215 | 215 | $header = $tableInfo->name; |
216 | 216 | if (!empty($tableInfo->feComment)) { |
217 | - $header .= ': ' . $tableInfo->feComment; |
|
217 | + $header .= ': '.$tableInfo->feComment; |
|
218 | 218 | } |
219 | 219 | $section->setHeader($header); |
220 | 220 | |
221 | 221 | // Set introductory text of subsection |
222 | 222 | if ($tableInfo->modelClass) { |
223 | - $section->addText('Extbase domain model: ``' . $tableInfo->modelClass . '``'); |
|
223 | + $section->addText('Extbase domain model: ``'.$tableInfo->modelClass.'``'); |
|
224 | 224 | } |
225 | 225 | $section->addText($tableInfo->classComment); |
226 | 226 | $section->addText($tableInfo->sqlComment); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | 'description' => 'Description', |
232 | 232 | ]]; |
233 | 233 | |
234 | - $rows = array_map(function ($column) use ($page) { |
|
234 | + $rows = array_map(function($column) use ($page) { |
|
235 | 235 | return [ |
236 | 236 | 'field' => ( |
237 | 237 | $page->format($column->name, ['bold' => $column->isPrimary]) |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | * @subpackage dlf |
33 | 33 | * @access public |
34 | 34 | */ |
35 | -class Generator |
|
36 | -{ |
|
35 | +class Generator { |
|
37 | 36 | /** |
38 | 37 | * @var ObjectManager |
39 | 38 | */ |
@@ -49,8 +48,7 @@ discard block |
||
49 | 48 | */ |
50 | 49 | protected $dataMapper; |
51 | 50 | |
52 | - public function __construct() |
|
53 | - { |
|
51 | + public function __construct() { |
|
54 | 52 | $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
55 | 53 | $this->languageService = $this->objectManager->get(LanguageService::class); |
56 | 54 | $this->dataMapper = $this->objectManager->get(DataMapper::class); |
@@ -167,8 +165,7 @@ discard block |
||
167 | 165 | return $result; |
168 | 166 | } |
169 | 167 | |
170 | - protected function parseDocComment($docComment) |
|
171 | - { |
|
168 | + protected function parseDocComment($docComment) { |
|
172 | 169 | // TODO: Consider using phpDocumentor (though that splits the docblock into summary and description) |
173 | 170 | |
174 | 171 | // Adopted from DocCommentParser in TYPO3 v9 |
@@ -193,8 +190,7 @@ discard block |
||
193 | 190 | /** |
194 | 191 | * Transform table structure into .rst page. |
195 | 192 | */ |
196 | - public function generatePage(array $tables) |
|
197 | - { |
|
193 | + public function generatePage(array $tables) { |
|
198 | 194 | $page = new RstSection(); |
199 | 195 | $page->setHeader('Database Tables'); |
200 | 196 | $page->addText(<<<RST |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function collectTables(): array |
64 | 64 | { |
65 | 65 | $sqlReader = $this->objectManager->get(SqlReader::class); |
66 | - $sqlCode = $sqlReader->getTablesDefinitionString(true); |
|
66 | + $sqlCode = $sqlReader->getTablesDefinitionString(TRUE); |
|
67 | 67 | $createTableStatements = $sqlReader->getCreateTableStatementArray($sqlCode); |
68 | 68 | |
69 | 69 | $tableToClassName = $this->getTableClassMap(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | continue; |
80 | 80 | } |
81 | 81 | |
82 | - $className = $tableToClassName[$tableName] ?? null; |
|
82 | + $className = $tableToClassName[$tableName] ?? NULL; |
|
83 | 83 | |
84 | 84 | $result[] = $this->getTableInfo($table, $className); |
85 | 85 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $isPrimary = []; |
121 | 121 | if (!is_null($primaryKey = $table->getPrimaryKey())) { |
122 | 122 | foreach ($primaryKey->getUnquotedColumns() as $primaryColumn) { |
123 | - $isPrimary[$primaryColumn] = true; |
|
123 | + $isPrimary[$primaryColumn] = TRUE; |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | $result = (object) [ |
142 | 142 | 'name' => $tableName, |
143 | 143 | 'columns' => $columns, |
144 | - 'modelClass' => null, |
|
144 | + 'modelClass' => NULL, |
|
145 | 145 | 'sqlComment' => $table->getComment() ?? '', |
146 | 146 | 'classComment' => '', |
147 | 147 | 'feComment' => $this->languageService->sL($GLOBALS['TCA'][$tableName]['ctrl']['title'] ?? ''), |
148 | 148 | ]; |
149 | 149 | |
150 | 150 | // Integrate doc-comments from model class and its fields |
151 | - if ($className !== null) { |
|
151 | + if ($className !== NULL) { |
|
152 | 152 | $reflection = new ReflectionClass($className); |
153 | 153 | |
154 | 154 | $dataMap = $this->dataMapper->getDataMap($className); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | // In that case, try to guess the column name from the property name. |
159 | 159 | |
160 | 160 | $column = $dataMap->getColumnMap($property->getName()); |
161 | - $columnName = $column === null |
|
161 | + $columnName = $column === NULL |
|
162 | 162 | ? GeneralUtility::camelCaseToLowerCaseUnderscored($property->getName()) |
163 | 163 | : $column->getColumnName(); |
164 | 164 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $lines = explode("\n", $docComment); |
185 | 185 | foreach ($lines as $line) { |
186 | 186 | // Stop parsing at first tag |
187 | - if ($line !== '' && strpos($line, '@') !== false) { |
|
187 | + if ($line !== '' && strpos($line, '@') !== FALSE) { |
|
188 | 188 | break; |
189 | 189 | } |
190 | 190 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | This is a reference of all database tables defined by Kitodo.Presentation. |
209 | 209 | |
210 | 210 | .. tip:: This page is auto-generated. If you would like to edit it, please use doc-comments in the model class, COMMENT fields in ``ext_tables.sql`` if the table does not have one, or TCA labels. Then, you may re-generate the page by running ``composer docs:db`` inside the Kitodo.Presentation base folder. |
211 | -RST); |
|
211 | +rst); |
|
212 | 212 | |
213 | 213 | // Sort tables alphabetically |
214 | 214 | usort($tables, function ($lhs, $rhs) { |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | 'field' => ( |
244 | 244 | $page->format($column->name, ['bold' => $column->isPrimary]) |
245 | 245 | . "\u{00a0}\u{00a0}" |
246 | - . $page->format($column->type->getName(), ['italic' => true]) |
|
246 | + . $page->format($column->type->getName(), ['italic' => TRUE]) |
|
247 | 247 | ), |
248 | 248 | |
249 | 249 | 'description' => $page->paragraphs([ |
250 | - $page->format($column->feComment, ['italic' => true]), |
|
250 | + $page->format($column->feComment, ['italic' => TRUE]), |
|
251 | 251 | $column->fieldComment, |
252 | 252 | $column->sqlComment, |
253 | 253 | ]), |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return void |
27 | 27 | */ |
28 | - public function deleteExpiredTokens($expireTime) |
|
29 | - { |
|
28 | + public function deleteExpiredTokens($expireTime) { |
|
30 | 29 | $query = $this->createQuery(); |
31 | 30 | |
32 | 31 | $constraints = []; |
@@ -18,8 +18,7 @@ |
||
18 | 18 | class MailRepository extends \TYPO3\CMS\Extbase\Persistence\Repository |
19 | 19 | { |
20 | 20 | |
21 | - public function findAllWithPid($pid) |
|
22 | - { |
|
21 | + public function findAllWithPid($pid) { |
|
23 | 22 | /** @var Typo3QuerySettings $querySettings */ |
24 | 23 | $querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class); |
25 | 24 |
@@ -109,14 +109,12 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * constructor |
111 | 111 | */ |
112 | - public function __construct() |
|
113 | - { |
|
112 | + public function __construct() { |
|
114 | 113 | // Do not remove the next line: It would break the functionality |
115 | 114 | $this->initStorageObjects(); |
116 | 115 | } |
117 | 116 | |
118 | - protected function initStorageObjects() |
|
119 | - { |
|
117 | + protected function initStorageObjects() { |
|
120 | 118 | $this->format = new ObjectStorage(); |
121 | 119 | } |
122 | 120 | |
@@ -187,8 +185,7 @@ discard block |
||
187 | 185 | /** |
188 | 186 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\MetadataFormat> $format |
189 | 187 | */ |
190 | - public function getFormat() |
|
191 | - { |
|
188 | + public function getFormat() { |
|
192 | 189 | return $this->format; |
193 | 190 | } |
194 | 191 | |
@@ -207,8 +204,7 @@ discard block |
||
207 | 204 | * |
208 | 205 | * @return void |
209 | 206 | */ |
210 | - public function addFormat(MetadataFormat $format) |
|
211 | - { |
|
207 | + public function addFormat(MetadataFormat $format) { |
|
212 | 208 | $this->format->attach($format); |
213 | 209 | } |
214 | 210 | |
@@ -219,8 +215,7 @@ discard block |
||
219 | 215 | * |
220 | 216 | * @return void |
221 | 217 | */ |
222 | - public function removeFormat(MetadataFormat $formatToRemove) |
|
223 | - { |
|
218 | + public function removeFormat(MetadataFormat $formatToRemove) { |
|
224 | 219 | $this->format->detach($formatToRemove); |
225 | 220 | } |
226 | 221 |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | * @subpackage dlf |
30 | 30 | * @access public |
31 | 31 | */ |
32 | -class MetadataController extends AbstractController |
|
33 | -{ |
|
32 | +class MetadataController extends AbstractController { |
|
34 | 33 | /** |
35 | 34 | * @var CollectionRepository |
36 | 35 | */ |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | /** |
40 | 39 | * @param CollectionRepository $collectionRepository |
41 | 40 | */ |
42 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
43 | - { |
|
41 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
44 | 42 | $this->collectionRepository = $collectionRepository; |
45 | 43 | } |
46 | 44 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | /** |
53 | 51 | * @param MetadataRepository $metadataRepository |
54 | 52 | */ |
55 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
56 | - { |
|
53 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
57 | 54 | $this->metadataRepository = $metadataRepository; |
58 | 55 | } |
59 | 56 | |
@@ -65,16 +62,14 @@ discard block |
||
65 | 62 | /** |
66 | 63 | * @param StructureRepository $structureRepository |
67 | 64 | */ |
68 | - public function injectStructureRepository(StructureRepository $structureRepository) |
|
69 | - { |
|
65 | + public function injectStructureRepository(StructureRepository $structureRepository) { |
|
70 | 66 | $this->structureRepository = $structureRepository; |
71 | 67 | } |
72 | 68 | |
73 | 69 | /** |
74 | 70 | * @return string|void |
75 | 71 | */ |
76 | - public function mainAction() |
|
77 | - { |
|
72 | + public function mainAction() { |
|
78 | 73 | $this->cObj = $this->configurationManager->getContentObject(); |
79 | 74 | |
80 | 75 | // Load current document. |
@@ -130,8 +125,7 @@ discard block |
||
130 | 125 | * |
131 | 126 | * @return string The metadata array ready for output |
132 | 127 | */ |
133 | - protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false) |
|
134 | - { |
|
128 | + protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false) { |
|
135 | 129 | if ($useOriginalIiifManifestMetadata) { |
136 | 130 | $iiifData = []; |
137 | 131 | foreach ($metadataArray as $metadata) { |
@@ -250,8 +244,7 @@ discard block |
||
250 | 244 | } |
251 | 245 | |
252 | 246 | if (is_array($metadataArray[$i][$metadataName])) { |
253 | - $metadataArray[$i][$metadataName] = array_values(array_filter($metadataArray[$i][$metadataName], function($value) |
|
254 | - { |
|
247 | + $metadataArray[$i][$metadataName] = array_values(array_filter($metadataArray[$i][$metadataName], function($value) { |
|
255 | 248 | return !empty($value); |
256 | 249 | })); |
257 | 250 | } |
@@ -273,8 +266,7 @@ discard block |
||
273 | 266 | * |
274 | 267 | * @return array metadata |
275 | 268 | */ |
276 | - private function getMetadata() |
|
277 | - { |
|
269 | + private function getMetadata() { |
|
278 | 270 | $metadata = []; |
279 | 271 | if ($this->settings['rootline'] < 2) { |
280 | 272 | // Get current structure's @ID. |
@@ -312,8 +304,7 @@ discard block |
||
312 | 304 | * |
313 | 305 | * @return array metadata |
314 | 306 | */ |
315 | - private function getMetadataForIds($id, $metadata) |
|
316 | - { |
|
307 | + private function getMetadataForIds($id, $metadata) { |
|
317 | 308 | $useOriginalIiifManifestMetadata = $this->settings['originalIiifMetadata'] == 1 && $this->document->getDoc() instanceof IiifManifest; |
318 | 309 | foreach ($id as $sid) { |
319 | 310 | if ($useOriginalIiifManifestMetadata) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | array_unshift($metadata, $data); |
113 | 113 | } |
114 | 114 | if (empty($metadata)) { |
115 | - $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid()); |
|
115 | + $this->logger->warning('No metadata found for document with UID '.$this->document->getUid()); |
|
116 | 116 | return ''; |
117 | 117 | } |
118 | 118 | ksort($metadata); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | if (empty(implode('', $metadataValue)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
216 | 216 | $superiorTitle = Doc::getTitle($this->document->getPartof(), true); |
217 | 217 | if (!empty($superiorTitle)) { |
218 | - $metadataArray[$i][$metadataName] = ['[' . $superiorTitle . ']']; |
|
218 | + $metadataArray[$i][$metadataName] = ['['.$superiorTitle.']']; |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 | if (!empty($metadataValue)) { |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | // Load current document. |
81 | 81 | $this->loadDocument($this->requestData); |
82 | 82 | if ( |
83 | - $this->document === null |
|
84 | - || $this->document->getDoc() === null |
|
83 | + $this->document === NULL |
|
84 | + || $this->document->getDoc() === NULL |
|
85 | 85 | ) { |
86 | 86 | // Quit without doing anything if required variables are not set. |
87 | 87 | return ''; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @return string The metadata array ready for output |
132 | 132 | */ |
133 | - protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false) |
|
133 | + protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = FALSE) |
|
134 | 134 | { |
135 | 135 | if ($useOriginalIiifManifestMetadata) { |
136 | 136 | $iiifData = []; |
@@ -148,14 +148,14 @@ discard block |
||
148 | 148 | $iiifData[$key] = [ |
149 | 149 | 'label' => $key, |
150 | 150 | 'value' => $group, |
151 | - 'buildUrl' => true, |
|
151 | + 'buildUrl' => TRUE, |
|
152 | 152 | ]; |
153 | 153 | } else { |
154 | 154 | // Data output |
155 | 155 | $iiifData[$key] = [ |
156 | 156 | 'label' => $key, |
157 | 157 | 'value' => $group, |
158 | - 'buildUrl' => false, |
|
158 | + 'buildUrl' => FALSE, |
|
159 | 159 | ]; |
160 | 160 | } |
161 | 161 | } else { |
@@ -172,18 +172,18 @@ discard block |
||
172 | 172 | $iiifData[$key]['data'][] = [ |
173 | 173 | 'label' => $nolabel ? '' : $label, |
174 | 174 | 'value' => $value, |
175 | - 'buildUrl' => true, |
|
175 | + 'buildUrl' => TRUE, |
|
176 | 176 | ]; |
177 | 177 | } else { |
178 | 178 | $iiifData[$key]['data'][] = [ |
179 | 179 | 'label' => $label, |
180 | 180 | 'value' => $value, |
181 | - 'buildUrl' => false, |
|
181 | + 'buildUrl' => FALSE, |
|
182 | 182 | ]; |
183 | 183 | } |
184 | 184 | } |
185 | 185 | } |
186 | - $this->view->assign('useIiif', true); |
|
186 | + $this->view->assign('useIiif', TRUE); |
|
187 | 187 | $this->view->assign('iiifData', $iiifData); |
188 | 188 | } |
189 | 189 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | if ($metadataName == 'title') { |
214 | 214 | // Get title of parent document if needed. |
215 | 215 | if (empty(implode('', $metadataValue)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
216 | - $superiorTitle = Doc::getTitle($this->document->getPartof(), true); |
|
216 | + $superiorTitle = Doc::getTitle($this->document->getPartof(), TRUE); |
|
217 | 217 | if (!empty($superiorTitle)) { |
218 | 218 | $metadataArray[$i][$metadataName] = ['[' . $superiorTitle . ']']; |
219 | 219 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | foreach ($this->requestData['selected'] as $docValue) { |
110 | 110 | if ($docValue['id']) { |
111 | 111 | $docData = $this->getDocumentData($docValue['id'], $docValue); |
112 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
112 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
113 | 113 | $this->redirectToUri($pdfUrl); |
114 | 114 | } |
115 | 115 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($allMails->count() > 0) { |
173 | 173 | $mailSelect[0] = htmlspecialchars(LocalizationUtility::translate('basket.chooseMail', 'dlf')); |
174 | 174 | foreach ($allMails as $mail) { |
175 | - $mailSelect[$mail->getUid()] = htmlspecialchars($mail->getName()) . ' (' . htmlspecialchars($mail->getMail()) . ')'; |
|
175 | + $mailSelect[$mail->getUid()] = htmlspecialchars($mail->getName()).' ('.htmlspecialchars($mail->getMail()).')'; |
|
176 | 176 | } |
177 | 177 | $this->view->assign('mailSelect', $mailSelect); |
178 | 178 | } |
@@ -256,12 +256,12 @@ discard block |
||
256 | 256 | |
257 | 257 | $entryArray['BASKETDATA'] = $docData; |
258 | 258 | |
259 | - $entryKey = $id . '_' . $startpage; |
|
259 | + $entryKey = $id.'_'.$startpage; |
|
260 | 260 | if (!empty($startX)) { |
261 | - $entryKey .= '_' . $startX; |
|
261 | + $entryKey .= '_'.$startX; |
|
262 | 262 | } |
263 | 263 | if (!empty($endX)) { |
264 | - $entryKey .= '_' . $endX; |
|
264 | + $entryKey .= '_'.$endX; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | $entryArray['id'] = $id; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : (int) $data['endY'], $urlParams); |
313 | 313 | $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : (int) $data['rotation'], $urlParams); |
314 | 314 | |
315 | - $downloadUrl = $this->settings['pdfgenerate'] . $urlParams; |
|
315 | + $downloadUrl = $this->settings['pdfgenerate'].$urlParams; |
|
316 | 316 | |
317 | 317 | $title = $this->document->getTitle(); |
318 | 318 | if (empty($title)) { |
@@ -323,15 +323,15 @@ discard block |
||
323 | 323 | $info = ''; |
324 | 324 | if ($data['startX'] != '' && $data['endX'] != '') { |
325 | 325 | // cutout |
326 | - $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')) . ' '; |
|
326 | + $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')).' '; |
|
327 | 327 | } |
328 | 328 | if ($data['startpage'] == $data['endpage']) { |
329 | 329 | // One page |
330 | - $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage']; |
|
330 | + $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage']; |
|
331 | 331 | } else { |
332 | - $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage'] . '-' . $data['endpage']; |
|
332 | + $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage'].'-'.$data['endpage']; |
|
333 | 333 | } |
334 | - $downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . htmlspecialchars($title) . '</a> (' . $info . ')'; |
|
334 | + $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.htmlspecialchars($title).'</a> ('.$info.')'; |
|
335 | 335 | if ($data['startpage'] == $data['endpage']) { |
336 | 336 | $pageNums = 1; |
337 | 337 | } else { |
@@ -407,12 +407,12 @@ discard block |
||
407 | 407 | if ($_piVars['addToBasket'] == 'list') { |
408 | 408 | $documentItem['endpage'] = $this->document->getDoc()->numPages; |
409 | 409 | } |
410 | - $arrayKey = $documentItem['id'] . '_' . $page; |
|
410 | + $arrayKey = $documentItem['id'].'_'.$page; |
|
411 | 411 | if (!empty($documentItem['startX'])) { |
412 | - $arrayKey .= '_' . $documentItem['startX']; |
|
412 | + $arrayKey .= '_'.$documentItem['startX']; |
|
413 | 413 | } |
414 | 414 | if (!empty($documentItem['endX'])) { |
415 | - $arrayKey .= '_' . $documentItem['endX']; |
|
415 | + $arrayKey .= '_'.$documentItem['endX']; |
|
416 | 416 | } |
417 | 417 | // do not add more than one identical object |
418 | 418 | if (!in_array($arrayKey, $items)) { |
@@ -431,14 +431,14 @@ discard block |
||
431 | 431 | // remove parameter endpage |
432 | 432 | $pdfParams = str_replace(",##endpage##", '', $pdfParams); |
433 | 433 | } |
434 | - $pdfGenerateUrl = $this->settings['pdfgenerate'] . $pdfParams; |
|
434 | + $pdfGenerateUrl = $this->settings['pdfgenerate'].$pdfParams; |
|
435 | 435 | if ($this->settings['pregeneration']) { |
436 | 436 | // send ajax request to webapp |
437 | 437 | $output .= ' |
438 | 438 | <script> |
439 | 439 | $(document).ready(function(){ |
440 | 440 | $.ajax({ |
441 | - url: "' . $pdfGenerateUrl . '", |
|
441 | + url: "' . $pdfGenerateUrl.'", |
|
442 | 442 | }).done(function() { |
443 | 443 | }); |
444 | 444 | }); |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | } |
477 | 477 | foreach ($_piVars['selected'] as $value) { |
478 | 478 | if (isset($value['id'])) { |
479 | - $arrayKey = $value['id'] . '_' . $value['startpage']; |
|
479 | + $arrayKey = $value['id'].'_'.$value['startpage']; |
|
480 | 480 | if (!empty($value['startX'])) { |
481 | - $arrayKey .= '_' . $value['startX']; |
|
481 | + $arrayKey .= '_'.$value['startX']; |
|
482 | 482 | } |
483 | 483 | if (!empty($value['endX'])) { |
484 | - $arrayKey .= '_' . $value['endX']; |
|
484 | + $arrayKey .= '_'.$value['endX']; |
|
485 | 485 | } |
486 | 486 | if (isset($items[$arrayKey])) { |
487 | 487 | unset($items[$arrayKey]); |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | |
515 | 515 | $mailObject = $this->mailRepository->findByUid(intval($mailId))->getFirst(); |
516 | 516 | |
517 | - $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf')) . "\n"; |
|
517 | + $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf'))."\n"; |
|
518 | 518 | $numberOfPages = 0; |
519 | 519 | $pdfUrl = $this->settings['pdfdownload']; |
520 | 520 | // prepare links |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | if ($docValue['id']) { |
523 | 523 | $explodeId = explode("_", $docValue['id']); |
524 | 524 | $docData = $this->getDocumentData($explodeId[0], $docValue); |
525 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
525 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
526 | 526 | $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage']))); |
527 | 527 | if ($pages === 0) { |
528 | 528 | $numberOfPages = $numberOfPages + 1; |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | } |
534 | 534 | // Remove leading/tailing pdfparamseperator |
535 | 535 | $pdfUrl = trim($pdfUrl, $this->settings['pdfparamseparator']); |
536 | - $mailBody = $mailText . $pdfUrl; |
|
536 | + $mailBody = $mailText.$pdfUrl; |
|
537 | 537 | // Get hook objects. |
538 | 538 | $hookObjects = Helper::getHookObjects('Classes/Controller/BasketController.php'); |
539 | 539 | // Hook for getting a customized mail body. |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | $newActionLog = GeneralUtility::makeInstance(ActionLog::class); |
561 | 561 | $newActionLog->setFileName($pdfUrl); |
562 | 562 | $newActionLog->setCountPages($numberOfPages); |
563 | - $newActionLog->setLabel('Mail: ' . $mailObject->getMail()); |
|
563 | + $newActionLog->setLabel('Mail: '.$mailObject->getMail()); |
|
564 | 564 | |
565 | 565 | if ($GLOBALS["TSFE"]->loginUser) { |
566 | 566 | // internal user |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | foreach ($this->requestData['selected'] as $docId => $docValue) { |
593 | 593 | if ($docValue['id']) { |
594 | 594 | $docData = $this->getDocumentData($docValue['id'], $docValue); |
595 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
595 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
596 | 596 | $numberOfPages += $docData['pageNums']; |
597 | 597 | } |
598 | 598 | } |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | if ($docValue['id']) { |
611 | 611 | $explodeId = explode("_", $docId); |
612 | 612 | $docData = $this->getDocumentData($explodeId[0], $docValue); |
613 | - $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator']; |
|
613 | + $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator']; |
|
614 | 614 | $numberOfPages += $docData['pageNums']; |
615 | 615 | } |
616 | 616 | } |
@@ -627,12 +627,12 @@ discard block |
||
627 | 627 | // internal user |
628 | 628 | $actionLog->setUserId($GLOBALS["TSFE"]->fe_user->user['uid']); |
629 | 629 | $actionLog->setName($GLOBALS["TSFE"]->fe_user->user['username']); |
630 | - $actionLog->setLabel('Print: ' . $printer->getLabel()); |
|
630 | + $actionLog->setLabel('Print: '.$printer->getLabel()); |
|
631 | 631 | } else { |
632 | 632 | // external user |
633 | 633 | $actionLog->setUserId(0); |
634 | 634 | $actionLog->setName('n/a'); |
635 | - $actionLog->setLabel('Print: ' . $printer->getLabel()); |
|
635 | + $actionLog->setLabel('Print: '.$printer->getLabel()); |
|
636 | 636 | } |
637 | 637 | // add action to protocol |
638 | 638 | $this->actionLogRepository->add($actionLog); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | $countDocs = 0; |
164 | 164 | if ($basket->getDocIds()) { |
165 | - $countDocs = count(json_decode($basket->getDocIds(), true)); |
|
165 | + $countDocs = count(json_decode($basket->getDocIds(), TRUE)); |
|
166 | 166 | } |
167 | 167 | $this->view->assign('countDocs', $countDocs); |
168 | 168 | |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | $basket = $this->basketRepository->findOneByFeUserId((int) $GLOBALS['TSFE']->fe_user->user['uid']); |
213 | 213 | } else { |
214 | 214 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_dlf_basket', ''); |
215 | - $GLOBALS['TSFE']->fe_user->sesData_change = true; |
|
215 | + $GLOBALS['TSFE']->fe_user->sesData_change = TRUE; |
|
216 | 216 | $GLOBALS['TSFE']->fe_user->storeSessionData(); |
217 | 217 | |
218 | 218 | $basket = $this->basketRepository->findOneBySessionId($sessionId); |
219 | 219 | } |
220 | 220 | // session does not exist |
221 | - if ($basket === null) { |
|
221 | + if ($basket === NULL) { |
|
222 | 222 | // create new basket in db |
223 | 223 | $basket = GeneralUtility::makeInstance(Basket::class); |
224 | 224 | $basket->setSessionId($sessionId); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | 'record_id' => $this->document->getRecordId(), |
348 | 348 | ]; |
349 | 349 | } |
350 | - return false; |
|
350 | + return FALSE; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | } else { |
370 | 370 | $page = (int) $_piVars['startpage']; |
371 | 371 | } |
372 | - if ($page != null || $_piVars['addToBasket'] == 'list') { |
|
372 | + if ($page != NULL || $_piVars['addToBasket'] == 'list') { |
|
373 | 373 | $documentItem = [ |
374 | 374 | 'id' => (int) $_piVars['id'], |
375 | 375 | 'startpage' => (int) $_piVars['startpage'], |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | // get document instance to load further information |
392 | 392 | $this->loadDocument(['id' => $documentItem['id']]); |
393 | 393 | if ( |
394 | - $this->document === null |
|
395 | - || $this->document->getDoc() === null |
|
394 | + $this->document === NULL |
|
395 | + || $this->document->getDoc() === NULL |
|
396 | 396 | ) { |
397 | 397 | // Quit without doing anything if required variables are not set. |
398 | 398 | return; |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | $basket->setDocIds(json_encode($items)); |
450 | - if ($basket->getUid() === null) { |
|
450 | + if ($basket->getUid() === NULL) { |
|
451 | 451 | $this->basketRepository->add($basket); |
452 | 452 | } else { |
453 | 453 | $this->basketRepository->update($basket); |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | * @subpackage dlf |
32 | 32 | * @access public |
33 | 33 | */ |
34 | -class BasketController extends AbstractController |
|
35 | -{ |
|
34 | +class BasketController extends AbstractController { |
|
36 | 35 | /** |
37 | 36 | * @var BasketRepository |
38 | 37 | */ |
@@ -41,8 +40,7 @@ discard block |
||
41 | 40 | /** |
42 | 41 | * @param BasketRepository $basketRepository |
43 | 42 | */ |
44 | - public function injectBasketRepository(BasketRepository $basketRepository) |
|
45 | - { |
|
43 | + public function injectBasketRepository(BasketRepository $basketRepository) { |
|
46 | 44 | $this->basketRepository = $basketRepository; |
47 | 45 | } |
48 | 46 | |
@@ -54,8 +52,7 @@ discard block |
||
54 | 52 | /** |
55 | 53 | * @param MailRepository $mailRepository |
56 | 54 | */ |
57 | - public function injectMailRepository(MailRepository $mailRepository) |
|
58 | - { |
|
55 | + public function injectMailRepository(MailRepository $mailRepository) { |
|
59 | 56 | $this->mailRepository = $mailRepository; |
60 | 57 | } |
61 | 58 | |
@@ -67,8 +64,7 @@ discard block |
||
67 | 64 | /** |
68 | 65 | * @param PrinterRepository $printerRepository |
69 | 66 | */ |
70 | - public function injectPrinterRepository(PrinterRepository $printerRepository) |
|
71 | - { |
|
67 | + public function injectPrinterRepository(PrinterRepository $printerRepository) { |
|
72 | 68 | $this->printerRepository = $printerRepository; |
73 | 69 | } |
74 | 70 | |
@@ -80,8 +76,7 @@ discard block |
||
80 | 76 | /** |
81 | 77 | * @param ActionLogRepository $actionLogRepository |
82 | 78 | */ |
83 | - public function injectActionLogRepository(ActionLogRepository $actionLogRepository) |
|
84 | - { |
|
79 | + public function injectActionLogRepository(ActionLogRepository $actionLogRepository) { |
|
85 | 80 | $this->actionLogRepository = $actionLogRepository; |
86 | 81 | } |
87 | 82 | |
@@ -90,8 +85,7 @@ discard block |
||
90 | 85 | * |
91 | 86 | * @return void |
92 | 87 | */ |
93 | - public function basketAction() |
|
94 | - { |
|
88 | + public function basketAction() { |
|
95 | 89 | $basket = $this->getBasketData(); |
96 | 90 | |
97 | 91 | // action remove from basket |
@@ -137,8 +131,7 @@ discard block |
||
137 | 131 | * |
138 | 132 | * @return void |
139 | 133 | */ |
140 | - public function addAction() |
|
141 | - { |
|
134 | + public function addAction() { |
|
142 | 135 | $basket = $this->getBasketData(); |
143 | 136 | |
144 | 137 | if ( |
@@ -156,8 +149,7 @@ discard block |
||
156 | 149 | * |
157 | 150 | * @return void |
158 | 151 | */ |
159 | - public function mainAction() |
|
160 | - { |
|
152 | + public function mainAction() { |
|
161 | 153 | $basket = $this->getBasketData(); |
162 | 154 | |
163 | 155 | $countDocs = 0; |
@@ -203,8 +195,7 @@ discard block |
||
203 | 195 | * |
204 | 196 | * @return Basket The found data from user session. |
205 | 197 | */ |
206 | - protected function getBasketData() |
|
207 | - { |
|
198 | + protected function getBasketData() { |
|
208 | 199 | // get user session |
209 | 200 | $sessionId = $GLOBALS['TSFE']->fe_user->id; |
210 | 201 | |
@@ -238,8 +229,7 @@ discard block |
||
238 | 229 | * |
239 | 230 | * @return string One basket entry |
240 | 231 | */ |
241 | - protected function getEntry($data) |
|
242 | - { |
|
232 | + protected function getEntry($data) { |
|
243 | 233 | if (is_object($data)) { |
244 | 234 | $data = get_object_vars($data); |
245 | 235 | } |
@@ -291,8 +281,7 @@ discard block |
||
291 | 281 | * |
292 | 282 | * @return mixed download url or false |
293 | 283 | */ |
294 | - protected function getDocumentData($id, $data) |
|
295 | - { |
|
284 | + protected function getDocumentData($id, $data) { |
|
296 | 285 | // get document instance to load further information |
297 | 286 | $this->loadDocument(['id' => $id]); |
298 | 287 | if ($this->document) { |
@@ -360,8 +349,7 @@ discard block |
||
360 | 349 | * |
361 | 350 | * @return array Basket data and JavaScript output |
362 | 351 | */ |
363 | - protected function addToBasket($_piVars, $basket) |
|
364 | - { |
|
352 | + protected function addToBasket($_piVars, $basket) { |
|
365 | 353 | $output = ''; |
366 | 354 | |
367 | 355 | if (!$_piVars['startpage']) { |
@@ -468,8 +456,7 @@ discard block |
||
468 | 456 | * |
469 | 457 | * @return Basket basket |
470 | 458 | */ |
471 | - protected function removeFromBasket($_piVars, $basket) |
|
472 | - { |
|
459 | + protected function removeFromBasket($_piVars, $basket) { |
|
473 | 460 | if (!empty($basket->getDocIds())) { |
474 | 461 | $items = json_decode($basket->getDocIds()); |
475 | 462 | $items = get_object_vars($items); |
@@ -507,8 +494,7 @@ discard block |
||
507 | 494 | * |
508 | 495 | * @return void |
509 | 496 | */ |
510 | - protected function sendMail() |
|
511 | - { |
|
497 | + protected function sendMail() { |
|
512 | 498 | // send mail |
513 | 499 | $mailId = $this->requestData['mail_action']; |
514 | 500 | |
@@ -585,8 +571,7 @@ discard block |
||
585 | 571 | * |
586 | 572 | * @return void |
587 | 573 | */ |
588 | - protected function printDocument($basket) |
|
589 | - { |
|
574 | + protected function printDocument($basket) { |
|
590 | 575 | $pdfUrl = $this->settings['pdfprint']; |
591 | 576 | $numberOfPages = 0; |
592 | 577 | foreach ($this->requestData['selected'] as $docId => $docValue) { |
@@ -32,8 +32,7 @@ |
||
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
35 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) |
|
36 | - { |
|
35 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) { |
|
37 | 36 | $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0'); |
38 | 37 | } |
39 | 38 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | public function addFormatAction() |
159 | 159 | { |
160 | 160 | // Include formats definition file. |
161 | - $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
|
161 | + $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/FormatDefaults.php'); |
|
162 | 162 | |
163 | 163 | $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK); |
164 | 164 | // tx_dlf_formats are stored on PID = 0 |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | public function addMetadataAction() |
197 | 197 | { |
198 | 198 | // Include metadata definition file. |
199 | - $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
|
199 | + $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/MetadataDefaults.php'); |
|
200 | 200 | |
201 | 201 | $doPersist = false; |
202 | 202 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | if ($this->metadataRepository->findOneByIndexName($indexName) === null) { |
209 | 209 | |
210 | 210 | $newRecord = GeneralUtility::makeInstance(Metadata::class); |
211 | - $newRecord->setLabel($this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels)); |
|
211 | + $newRecord->setLabel($this->getLLL('metadata.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels)); |
|
212 | 212 | $newRecord->setIndexName($indexName); |
213 | 213 | $newRecord->setDefaultValue($values['default_value']); |
214 | 214 | $newRecord->setWrap($values['wrap'] ? : $GLOBALS['TCA']['tx_dlf_metadata']['columns']['wrap']['config']['default']); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $translatedRecord = GeneralUtility::makeInstance(Metadata::class); |
244 | 244 | $translatedRecord->setL18nParent($newRecord); |
245 | 245 | $translatedRecord->_setProperty('_languageUid', $siteLanguage->getLanguageId()); |
246 | - $translatedRecord->setLabel($this->getLLL('metadata.' . $indexName, $siteLanguage->getTypo3Language(), $metadataLabels)); |
|
246 | + $translatedRecord->setLabel($this->getLLL('metadata.'.$indexName, $siteLanguage->getTypo3Language(), $metadataLabels)); |
|
247 | 247 | $translatedRecord->setIndexName($indexName); |
248 | 248 | $translatedRecord->setWrap($newRecord->getWrap()); |
249 | 249 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
279 | 279 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
280 | - $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
|
280 | + $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels).' (PID '.$this->pid.')'); |
|
281 | 281 | $indexName = Solr::createCore(''); |
282 | 282 | $newRecord->setIndexName($indexName); |
283 | 283 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | public function addStructureAction() |
302 | 302 | { |
303 | 303 | // Include structure definition file. |
304 | - $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
|
304 | + $structureDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/StructureDefaults.php'); |
|
305 | 305 | |
306 | 306 | $doPersist = false; |
307 | 307 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | // if default format record is not found, add it to the repository |
313 | 313 | if ($this->structureRepository->findOneByIndexName($indexName) === null) { |
314 | 314 | $newRecord = GeneralUtility::makeInstance(Structure::class); |
315 | - $newRecord->setLabel($this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structLabels)); |
|
315 | + $newRecord->setLabel($this->getLLL('structure.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $structLabels)); |
|
316 | 316 | $newRecord->setIndexName($indexName); |
317 | 317 | $newRecord->setToplevel($values['toplevel']); |
318 | 318 | $newRecord->setOaiName($values['oai_name']); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $translatedRecord = GeneralUtility::makeInstance(Structure::class); |
327 | 327 | $translatedRecord->setL18nParent($newRecord); |
328 | 328 | $translatedRecord->_setProperty('_languageUid', $siteLanguage->getLanguageId()); |
329 | - $translatedRecord->setLabel($this->getLLL('structure.' . $indexName, $siteLanguage->getTypo3Language(), $structLabels)); |
|
329 | + $translatedRecord->setLabel($this->getLLL('structure.'.$indexName, $siteLanguage->getTypo3Language(), $structLabels)); |
|
330 | 330 | $translatedRecord->setIndexName($indexName); |
331 | 331 | |
332 | 332 | $this->structureRepository->add($translatedRecord); |
@@ -378,15 +378,15 @@ discard block |
||
378 | 378 | $this->forward('error'); |
379 | 379 | } |
380 | 380 | |
381 | - $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
|
381 | + $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/FormatDefaults.php'); |
|
382 | 382 | $recordInfos['formats']['numCurrent'] = $this->formatRepository->countAll(); |
383 | 383 | $recordInfos['formats']['numDefault'] = count($formatsDefaults); |
384 | 384 | |
385 | - $structuresDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
|
385 | + $structuresDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/StructureDefaults.php'); |
|
386 | 386 | $recordInfos['structures']['numCurrent'] = $this->structureRepository->countByPid($this->pid); |
387 | 387 | $recordInfos['structures']['numDefault'] = count($structuresDefaults); |
388 | 388 | |
389 | - $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
|
389 | + $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/MetadataDefaults.php'); |
|
390 | 390 | $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->countByPid($this->pid); |
391 | 391 | $recordInfos['metadata']['numDefault'] = count($metadataDefaults); |
392 | 392 |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | * @subpackage dlf |
45 | 45 | * @access public |
46 | 46 | */ |
47 | -class NewTenantController extends AbstractController |
|
48 | -{ |
|
47 | +class NewTenantController extends AbstractController { |
|
49 | 48 | /** |
50 | 49 | * @var int |
51 | 50 | */ |
@@ -85,8 +84,7 @@ discard block |
||
85 | 84 | /** |
86 | 85 | * @param FormatRepository $formatRepository |
87 | 86 | */ |
88 | - public function injectFormatRepository(FormatRepository $formatRepository) |
|
89 | - { |
|
87 | + public function injectFormatRepository(FormatRepository $formatRepository) { |
|
90 | 88 | $this->formatRepository = $formatRepository; |
91 | 89 | } |
92 | 90 | |
@@ -98,8 +96,7 @@ discard block |
||
98 | 96 | /** |
99 | 97 | * @param MetadataRepository $metadataRepository |
100 | 98 | */ |
101 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
102 | - { |
|
99 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
103 | 100 | $this->metadataRepository = $metadataRepository; |
104 | 101 | } |
105 | 102 | |
@@ -111,8 +108,7 @@ discard block |
||
111 | 108 | /** |
112 | 109 | * @param StructureRepository $structureRepository |
113 | 110 | */ |
114 | - public function injectStructureRepository(StructureRepository $structureRepository) |
|
115 | - { |
|
111 | + public function injectStructureRepository(StructureRepository $structureRepository) { |
|
116 | 112 | $this->structureRepository = $structureRepository; |
117 | 113 | } |
118 | 114 | |
@@ -124,8 +120,7 @@ discard block |
||
124 | 120 | /** |
125 | 121 | * @param SolrCoreRepository $solrCoreRepository |
126 | 122 | */ |
127 | - public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) |
|
128 | - { |
|
123 | + public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) { |
|
129 | 124 | $this->solrCoreRepository = $solrCoreRepository; |
130 | 125 | } |
131 | 126 | |
@@ -133,8 +128,7 @@ discard block |
||
133 | 128 | * Initialization for all actions |
134 | 129 | * |
135 | 130 | */ |
136 | - protected function initializeAction() |
|
137 | - { |
|
131 | + protected function initializeAction() { |
|
138 | 132 | $this->pid = (int) GeneralUtility::_GP('id'); |
139 | 133 | |
140 | 134 | $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK); |
@@ -155,8 +149,7 @@ discard block |
||
155 | 149 | /** |
156 | 150 | * Action adding formats records |
157 | 151 | */ |
158 | - public function addFormatAction() |
|
159 | - { |
|
152 | + public function addFormatAction() { |
|
160 | 153 | // Include formats definition file. |
161 | 154 | $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
162 | 155 | |
@@ -193,8 +186,7 @@ discard block |
||
193 | 186 | /** |
194 | 187 | * Action adding metadata records |
195 | 188 | */ |
196 | - public function addMetadataAction() |
|
197 | - { |
|
189 | + public function addMetadataAction() { |
|
198 | 190 | // Include metadata definition file. |
199 | 191 | $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
200 | 192 | |
@@ -268,8 +260,7 @@ discard block |
||
268 | 260 | /** |
269 | 261 | * Action adding Solr core records |
270 | 262 | */ |
271 | - public function addSolrCoreAction() |
|
272 | - { |
|
263 | + public function addSolrCoreAction() { |
|
273 | 264 | $doPersist = false; |
274 | 265 | |
275 | 266 | // load language file in own array |
@@ -298,8 +289,7 @@ discard block |
||
298 | 289 | /** |
299 | 290 | * Action adding structure records |
300 | 291 | */ |
301 | - public function addStructureAction() |
|
302 | - { |
|
292 | + public function addStructureAction() { |
|
303 | 293 | // Include structure definition file. |
304 | 294 | $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
305 | 295 | |
@@ -351,8 +341,7 @@ discard block |
||
351 | 341 | * @param ViewInterface $view |
352 | 342 | * @return void |
353 | 343 | */ |
354 | - protected function initializeView(ViewInterface $view) |
|
355 | - { |
|
344 | + protected function initializeView(ViewInterface $view) { |
|
356 | 345 | /** @var BackendTemplateView $view */ |
357 | 346 | parent::initializeView($view); |
358 | 347 | if ($this->actionMethodName == 'indexAction') { |
@@ -370,8 +359,7 @@ discard block |
||
370 | 359 | * @access public |
371 | 360 | * |
372 | 361 | */ |
373 | - public function indexAction() |
|
374 | - { |
|
362 | + public function indexAction() { |
|
375 | 363 | $recordInfos = []; |
376 | 364 | |
377 | 365 | if ($this->pageInfo['doktype'] != 254) { |
@@ -401,8 +389,7 @@ discard block |
||
401 | 389 | * @access public |
402 | 390 | * |
403 | 391 | */ |
404 | - public function errorAction() |
|
405 | - { |
|
392 | + public function errorAction() { |
|
406 | 393 | } |
407 | 394 | |
408 | 395 | /** |
@@ -414,8 +401,7 @@ discard block |
||
414 | 401 | * |
415 | 402 | * @access public |
416 | 403 | */ |
417 | - protected function getLLL($index, $lang, $langArray) |
|
418 | - { |
|
404 | + protected function getLLL($index, $lang, $langArray) { |
|
419 | 405 | if (isset($langArray[$lang][$index][0]['target'])) { |
420 | 406 | return $langArray[$lang][$index][0]['target']; |
421 | 407 | } else { |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | $frameworkConfiguration['persistence']['storagePid'] = 0; |
166 | 166 | $this->configurationManager->setConfiguration($frameworkConfiguration); |
167 | 167 | |
168 | - $doPersist = false; |
|
168 | + $doPersist = FALSE; |
|
169 | 169 | |
170 | 170 | foreach ($formatsDefaults as $type => $values) { |
171 | 171 | // if default format record is not found, add it to the repository |
172 | - if ($this->formatRepository->findOneByType($type) === null) { |
|
172 | + if ($this->formatRepository->findOneByType($type) === NULL) { |
|
173 | 173 | $newRecord = GeneralUtility::makeInstance(Format::class); |
174 | 174 | $newRecord->setType($type); |
175 | 175 | $newRecord->setRoot($values['root']); |
@@ -177,12 +177,12 @@ discard block |
||
177 | 177 | $newRecord->setClass($values['class']); |
178 | 178 | $this->formatRepository->add($newRecord); |
179 | 179 | |
180 | - $doPersist = true; |
|
180 | + $doPersist = TRUE; |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
184 | 184 | // We must persist here, if we changed anything. |
185 | - if ($doPersist === true) { |
|
185 | + if ($doPersist === TRUE) { |
|
186 | 186 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
187 | 187 | $persistenceManager->persistAll(); |
188 | 188 | } |
@@ -198,14 +198,14 @@ discard block |
||
198 | 198 | // Include metadata definition file. |
199 | 199 | $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
200 | 200 | |
201 | - $doPersist = false; |
|
201 | + $doPersist = FALSE; |
|
202 | 202 | |
203 | 203 | // load language file in own array |
204 | 204 | $metadataLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_metadata.xlf', $this->siteLanguages[0]->getTypo3Language()); |
205 | 205 | |
206 | 206 | foreach ($metadataDefaults as $indexName => $values) { |
207 | 207 | // if default format record is not found, add it to the repository |
208 | - if ($this->metadataRepository->findOneByIndexName($indexName) === null) { |
|
208 | + if ($this->metadataRepository->findOneByIndexName($indexName) === NULL) { |
|
209 | 209 | |
210 | 210 | $newRecord = GeneralUtility::makeInstance(Metadata::class); |
211 | 211 | $newRecord->setLabel($this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels)); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | foreach ($values['format'] as $format) { |
226 | 226 | $formatRecord = $this->formatRepository->findOneByRoot($format['format_root']); |
227 | 227 | // If formatRecord is null, we cannot create a MetadataFormat record. |
228 | - if ($formatRecord !== null) { |
|
228 | + if ($formatRecord !== NULL) { |
|
229 | 229 | $newMetadataFormat = GeneralUtility::makeInstance(MetadataFormat::class); |
230 | 230 | $newMetadataFormat->setEncoded($formatRecord->getUid()); |
231 | 231 | $newMetadataFormat->setXpath($format['xpath']); |
@@ -252,12 +252,12 @@ discard block |
||
252 | 252 | |
253 | 253 | $this->metadataRepository->add($newRecord); |
254 | 254 | |
255 | - $doPersist = true; |
|
255 | + $doPersist = TRUE; |
|
256 | 256 | } |
257 | 257 | } |
258 | 258 | |
259 | 259 | // We must persist here, if we changed anything. |
260 | - if ($doPersist === true) { |
|
260 | + if ($doPersist === TRUE) { |
|
261 | 261 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
262 | 262 | $persistenceManager->persistAll(); |
263 | 263 | } |
@@ -270,12 +270,12 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public function addSolrCoreAction() |
272 | 272 | { |
273 | - $doPersist = false; |
|
273 | + $doPersist = FALSE; |
|
274 | 274 | |
275 | 275 | // load language file in own array |
276 | 276 | $beLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_be.xlf', $this->siteLanguages[0]->getTypo3Language()); |
277 | 277 | |
278 | - if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { |
|
278 | + if ($this->solrCoreRepository->findOneByPid($this->pid) === NULL) { |
|
279 | 279 | $newRecord = GeneralUtility::makeInstance(SolrCore::class); |
280 | 280 | $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); |
281 | 281 | $indexName = Solr::createCore(''); |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | |
284 | 284 | $this->solrCoreRepository->add($newRecord); |
285 | 285 | |
286 | - $doPersist = true; |
|
286 | + $doPersist = TRUE; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | // We must persist here, if we changed anything. |
290 | - if ($doPersist === true) { |
|
290 | + if ($doPersist === TRUE) { |
|
291 | 291 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
292 | 292 | $persistenceManager->persistAll(); |
293 | 293 | } |
@@ -303,14 +303,14 @@ discard block |
||
303 | 303 | // Include structure definition file. |
304 | 304 | $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
305 | 305 | |
306 | - $doPersist = false; |
|
306 | + $doPersist = FALSE; |
|
307 | 307 | |
308 | 308 | // load language file in own array |
309 | 309 | $structLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_structure.xlf', $this->siteLanguages[0]->getTypo3Language()); |
310 | 310 | |
311 | 311 | foreach ($structureDefaults as $indexName => $values) { |
312 | 312 | // if default format record is not found, add it to the repository |
313 | - if ($this->structureRepository->findOneByIndexName($indexName) === null) { |
|
313 | + if ($this->structureRepository->findOneByIndexName($indexName) === NULL) { |
|
314 | 314 | $newRecord = GeneralUtility::makeInstance(Structure::class); |
315 | 315 | $newRecord->setLabel($this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structLabels)); |
316 | 316 | $newRecord->setIndexName($indexName); |
@@ -332,12 +332,12 @@ discard block |
||
332 | 332 | $this->structureRepository->add($translatedRecord); |
333 | 333 | } |
334 | 334 | |
335 | - $doPersist = true; |
|
335 | + $doPersist = TRUE; |
|
336 | 336 | } |
337 | 337 | } |
338 | 338 | |
339 | 339 | // We must persist here, if we changed anything. |
340 | - if ($doPersist === true) { |
|
340 | + if ($doPersist === TRUE) { |
|
341 | 341 | $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
342 | 342 | $persistenceManager->persistAll(); |
343 | 343 | } |
@@ -120,7 +120,7 @@ |
||
120 | 120 | */ |
121 | 121 | private function getQuery($fields, $parameters) |
122 | 122 | { |
123 | - return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']); |
|
123 | + return $fields['fulltext'].':('.Solr::escapeQuery((string) $parameters['q']).') AND '.$fields['uid'].':'.$this->getUid($parameters['uid']); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -28,16 +28,14 @@ discard block |
||
28 | 28 | * @subpackage dlf |
29 | 29 | * @access public |
30 | 30 | */ |
31 | -class SearchInDocument |
|
32 | -{ |
|
31 | +class SearchInDocument { |
|
33 | 32 | /** |
34 | 33 | * The main method of the eID script |
35 | 34 | * |
36 | 35 | * @param ServerRequestInterface $request |
37 | 36 | * @return ResponseInterface JSON response of search suggestions |
38 | 37 | */ |
39 | - public function main(ServerRequestInterface $request) |
|
40 | - { |
|
38 | + public function main(ServerRequestInterface $request) { |
|
41 | 39 | $output = [ |
42 | 40 | 'documents' => [], |
43 | 41 | 'numFound' => 0 |
@@ -118,8 +116,7 @@ discard block |
||
118 | 116 | * |
119 | 117 | * @return string SOLR query |
120 | 118 | */ |
121 | - private function getQuery($fields, $parameters) |
|
122 | - { |
|
119 | + private function getQuery($fields, $parameters) { |
|
123 | 120 | return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']); |
124 | 121 | } |
125 | 122 | |
@@ -133,8 +130,7 @@ discard block |
||
133 | 130 | * |
134 | 131 | * @return int|string uid of the document |
135 | 132 | */ |
136 | - private function getUid($uid) |
|
137 | - { |
|
133 | + private function getUid($uid) { |
|
138 | 134 | return is_numeric($uid) ? intval($uid) : $uid; |
139 | 135 | } |
140 | 136 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | ]; |
45 | 45 | // Get input parameters and decrypt core name. |
46 | 46 | $parameters = $request->getParsedBody(); |
47 | - if ($parameters === null) { |
|
47 | + if ($parameters === NULL) { |
|
48 | 48 | throw new \InvalidArgumentException('No parameters passed!', 1632322297); |
49 | 49 | } |
50 | 50 | $encrypted = (string) $parameters['encrypted']; |