Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 39ad46...5c2c02 )
by Sebastian
16s
created
plugins/metadata/class.tx_dlf_metadata.php 2 patches
Indentation   +229 added lines, -229 removed lines patch added patch discarded remove patch
@@ -20,391 +20,391 @@
 block discarded – undo
20 20
  */
21 21
 class tx_dlf_metadata extends tx_dlf_plugin {
22 22
 
23
-	public $scriptRelPath = 'plugins/metadata/class.tx_dlf_metadata.php';
23
+    public $scriptRelPath = 'plugins/metadata/class.tx_dlf_metadata.php';
24 24
 
25
-	/**
26
-	 * This holds the hook objects
27
-	 *
28
-	 * @var	array
29
-	 * @access protected
30
-	 */
31
-	protected $hookObjects = array ();
25
+    /**
26
+     * This holds the hook objects
27
+     *
28
+     * @var	array
29
+     * @access protected
30
+     */
31
+    protected $hookObjects = array ();
32 32
 
33
-	/**
34
-	 * The main method of the PlugIn
35
-	 *
36
-	 * @access	public
37
-	 *
38
-	 * @param	string		$content: The PlugIn content
39
-	 * @param	array		$conf: The PlugIn configuration
40
-	 *
41
-	 * @return	string		The content that is displayed on the website
42
-	 */
43
-	public function main($content, $conf) {
33
+    /**
34
+     * The main method of the PlugIn
35
+     *
36
+     * @access	public
37
+     *
38
+     * @param	string		$content: The PlugIn content
39
+     * @param	array		$conf: The PlugIn configuration
40
+     *
41
+     * @return	string		The content that is displayed on the website
42
+     */
43
+    public function main($content, $conf) {
44 44
 
45
-		$this->init($conf);
45
+        $this->init($conf);
46 46
 
47
-		// Turn cache on.
48
-		$this->setCache(TRUE);
47
+        // Turn cache on.
48
+        $this->setCache(TRUE);
49 49
 
50
-		// Load current document.
51
-		$this->loadDocument();
50
+        // Load current document.
51
+        $this->loadDocument();
52 52
 
53
-		if ($this->doc === NULL) {
53
+        if ($this->doc === NULL) {
54 54
 
55
-			// Quit without doing anything if required variables are not set.
56
-			return $content;
55
+            // Quit without doing anything if required variables are not set.
56
+            return $content;
57 57
 
58
-		} else {
58
+        } else {
59 59
 
60
-			// Set default values if not set.
61
-			if (!isset($this->conf['rootline'])) {
60
+            // Set default values if not set.
61
+            if (!isset($this->conf['rootline'])) {
62 62
 
63
-				$this->conf['rootline'] = 0;
63
+                $this->conf['rootline'] = 0;
64 64
 
65
-			}
65
+            }
66 66
 
67
-		}
67
+        }
68 68
 
69
-		$metadata = array ();
69
+        $metadata = array ();
70 70
 
71
-		if ($this->conf['rootline'] < 2) {
71
+        if ($this->conf['rootline'] < 2) {
72 72
 
73
-			// Get current structure's @ID.
74
-			$ids = array ();
73
+            // Get current structure's @ID.
74
+            $ids = array ();
75 75
 
76
-			if (!empty($this->doc->physicalStructure[$this->piVars['page']]) && !empty($this->doc->smLinks['p2l'][$this->doc->physicalStructure[$this->piVars['page']]])) {
76
+            if (!empty($this->doc->physicalStructure[$this->piVars['page']]) && !empty($this->doc->smLinks['p2l'][$this->doc->physicalStructure[$this->piVars['page']]])) {
77 77
 
78
-				foreach ($this->doc->smLinks['p2l'][$this->doc->physicalStructure[$this->piVars['page']]] as $logId) {
78
+                foreach ($this->doc->smLinks['p2l'][$this->doc->physicalStructure[$this->piVars['page']]] as $logId) {
79 79
 
80
-					$count = count($this->doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*'));
80
+                    $count = count($this->doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*'));
81 81
 
82
-					$ids[$count][] = $logId;
82
+                    $ids[$count][] = $logId;
83 83
 
84
-				}
84
+                }
85 85
 
86
-			}
86
+            }
87 87
 
88
-			ksort($ids);
88
+            ksort($ids);
89 89
 
90
-			reset($ids);
90
+            reset($ids);
91 91
 
92
-			// Check if we should display all metadata up to the root.
93
-			if ($this->conf['rootline'] == 1) {
92
+            // Check if we should display all metadata up to the root.
93
+            if ($this->conf['rootline'] == 1) {
94 94
 
95
-				foreach ($ids as $id) {
95
+                foreach ($ids as $id) {
96 96
 
97
-					foreach ($id as $sid) {
97
+                    foreach ($id as $sid) {
98 98
 
99
-						$data = $this->doc->getMetadata($sid, $this->conf['pages']);
99
+                        $data = $this->doc->getMetadata($sid, $this->conf['pages']);
100 100
 
101
-						if (!empty($data)) {
101
+                        if (!empty($data)) {
102 102
 
103
-							$data['_id'] = $sid;
103
+                            $data['_id'] = $sid;
104 104
 
105
-							$metadata[] = $data;
105
+                            $metadata[] = $data;
106 106
 
107
-						}
107
+                        }
108 108
 
109
-					}
109
+                    }
110 110
 
111
-				}
111
+                }
112 112
 
113
-			} else {
113
+            } else {
114 114
 
115
-				$id = array_pop($ids);
115
+                $id = array_pop($ids);
116 116
 
117
-				if (is_array($id)) {
117
+                if (is_array($id)) {
118 118
 
119
-					foreach ($id as $sid) {
119
+                    foreach ($id as $sid) {
120 120
 
121
-						$data = $this->doc->getMetadata($sid, $this->conf['pages']);
121
+                        $data = $this->doc->getMetadata($sid, $this->conf['pages']);
122 122
 
123
-						if (!empty($data)) {
123
+                        if (!empty($data)) {
124 124
 
125
-							$data['_id'] = $sid;
125
+                            $data['_id'] = $sid;
126 126
 
127
-							$metadata[] = $data;
127
+                            $metadata[] = $data;
128 128
 
129
-						}
129
+                        }
130 130
 
131
-					}
131
+                    }
132 132
 
133
-				}
133
+                }
134 134
 
135
-			}
135
+            }
136 136
 
137
-		}
137
+        }
138 138
 
139
-		// Get titledata?
140
-		if (empty($metadata) || ($this->conf['rootline'] == 1 && $metadata[0]['_id'] != $this->doc->toplevelId)) {
139
+        // Get titledata?
140
+        if (empty($metadata) || ($this->conf['rootline'] == 1 && $metadata[0]['_id'] != $this->doc->toplevelId)) {
141 141
 
142
-			$data = $this->doc->getTitleData($this->conf['pages']);
142
+            $data = $this->doc->getTitleData($this->conf['pages']);
143 143
 
144
-			$data['_id'] = $this->doc->toplevelId;
144
+            $data['_id'] = $this->doc->toplevelId;
145 145
 
146
-			array_unshift($metadata, $data);
146
+            array_unshift($metadata, $data);
147 147
 
148
-		}
148
+        }
149 149
 
150
-		if (empty($metadata)) {
150
+        if (empty($metadata)) {
151 151
 
152
-			if (TYPO3_DLOG) {
152
+            if (TYPO3_DLOG) {
153 153
 
154
-				\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_metadata->main('.$content.', [data])] No metadata found for document with UID "'.$this->doc->uid.'"', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
154
+                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_metadata->main('.$content.', [data])] No metadata found for document with UID "'.$this->doc->uid.'"', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
155 155
 
156
-			}
156
+            }
157 157
 
158
-			return $content;
158
+            return $content;
159 159
 
160
-		}
160
+        }
161 161
 
162
-		ksort($metadata);
162
+        ksort($metadata);
163 163
 
164
-		// Get hook objects.
165
-		$this->hookObjects = tx_dlf_helper::getHookObjects($this->scriptRelPath);
164
+        // Get hook objects.
165
+        $this->hookObjects = tx_dlf_helper::getHookObjects($this->scriptRelPath);
166 166
 
167
-		// Hook for getting a customized title bar (requested by SBB).
168
-		foreach ($this->hookObjects as $hookObj) {
167
+        // Hook for getting a customized title bar (requested by SBB).
168
+        foreach ($this->hookObjects as $hookObj) {
169 169
 
170
-			if (method_exists($hookObj, 'main_customizeTitleBarGetCustomTemplate')) {
170
+            if (method_exists($hookObj, 'main_customizeTitleBarGetCustomTemplate')) {
171 171
 
172
-				$hookObj->main_customizeTitleBarGetCustomTemplate($this, $metadata);
172
+                $hookObj->main_customizeTitleBarGetCustomTemplate($this, $metadata);
173 173
 
174
-			}
174
+            }
175 175
 
176
-		}
176
+        }
177 177
 
178
-		$content .= $this->printMetadata($metadata);
178
+        $content .= $this->printMetadata($metadata);
179 179
 
180
-		return $this->pi_wrapInBaseClass($content);
180
+        return $this->pi_wrapInBaseClass($content);
181 181
 
182
-	}
182
+    }
183 183
 
184
-	/**
185
-	 * Prepares the metadata array for output
186
-	 *
187
-	 * @access	protected
188
-	 *
189
-	 * @param	array		$metadataArray: The metadata array
190
-	 *
191
-	 * @return	string		The metadata array ready for output
192
-	 */
193
-	protected function printMetadata(array $metadataArray) {
184
+    /**
185
+     * Prepares the metadata array for output
186
+     *
187
+     * @access	protected
188
+     *
189
+     * @param	array		$metadataArray: The metadata array
190
+     *
191
+     * @return	string		The metadata array ready for output
192
+     */
193
+    protected function printMetadata(array $metadataArray) {
194 194
 
195
-		// Load template file.
196
-		if (!empty($this->conf['templateFile'])) {
195
+        // Load template file.
196
+        if (!empty($this->conf['templateFile'])) {
197 197
 
198
-			$this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
198
+            $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
199 199
 
200
-		} else {
200
+        } else {
201 201
 
202
-			$this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/metadata/template.tmpl'), '###TEMPLATE###');
202
+            $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/metadata/template.tmpl'), '###TEMPLATE###');
203 203
 
204
-		}
204
+        }
205 205
 
206
-		$output = '';
206
+        $output = '';
207 207
 
208
-		$subpart['block'] = $this->cObj->getSubpart($this->template, '###BLOCK###');
208
+        $subpart['block'] = $this->cObj->getSubpart($this->template, '###BLOCK###');
209 209
 
210
-		// Get list of metadata to show.
211
-		$metaList = array ();
210
+        // Get list of metadata to show.
211
+        $metaList = array ();
212 212
 
213
-		$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
214
-			'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.wrap AS wrap',
215
-			'tx_dlf_metadata',
216
-			'tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata').' AND (sys_language_uid IN (-1,0) OR (sys_language_uid = ' .$GLOBALS['TSFE']->sys_language_uid. ' AND l18n_parent = 0))',
217
-			'',
218
-			'tx_dlf_metadata.sorting',
219
-			''
220
-		);
213
+        $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
214
+            'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.wrap AS wrap',
215
+            'tx_dlf_metadata',
216
+            'tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata').' AND (sys_language_uid IN (-1,0) OR (sys_language_uid = ' .$GLOBALS['TSFE']->sys_language_uid. ' AND l18n_parent = 0))',
217
+            '',
218
+            'tx_dlf_metadata.sorting',
219
+            ''
220
+        );
221 221
 
222
-		while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
222
+        while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
223 223
 
224
-			if (is_array($resArray) && $resArray['sys_language_uid'] != $GLOBALS['TSFE']->sys_language_content && $GLOBALS['TSFE']->sys_language_contentOL) {
224
+            if (is_array($resArray) && $resArray['sys_language_uid'] != $GLOBALS['TSFE']->sys_language_content && $GLOBALS['TSFE']->sys_language_contentOL) {
225 225
 
226
-					$resArray = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_dlf_metadata', $resArray, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL);
226
+                    $resArray = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_dlf_metadata', $resArray, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL);
227 227
 
228
-				}
228
+                }
229 229
 
230
-				if ($resArray) {
231
-					// get correct language uid for translated realurl link
232
-					$link_uid = ($resArray['_LOCALIZED_UID']) ? $resArray['_LOCALIZED_UID'] : $resArray['uid'];
230
+                if ($resArray) {
231
+                    // get correct language uid for translated realurl link
232
+                    $link_uid = ($resArray['_LOCALIZED_UID']) ? $resArray['_LOCALIZED_UID'] : $resArray['uid'];
233 233
 
234
-					// do stuff with the row entry data	like built HTML or prepare further usage
235
-					if ($this->conf['showFull'] || $resArray['is_listed']) {
234
+                    // do stuff with the row entry data	like built HTML or prepare further usage
235
+                    if ($this->conf['showFull'] || $resArray['is_listed']) {
236 236
 
237
-						$metaList[$resArray['index_name']] = array (
238
-							'wrap' => $resArray['wrap'],
239
-							'label' => tx_dlf_helper::translate($resArray['index_name'], 'tx_dlf_metadata', $this->conf['pages'])
240
-						);
237
+                        $metaList[$resArray['index_name']] = array (
238
+                            'wrap' => $resArray['wrap'],
239
+                            'label' => tx_dlf_helper::translate($resArray['index_name'], 'tx_dlf_metadata', $this->conf['pages'])
240
+                        );
241 241
 
242
-					}
242
+                    }
243 243
 
244
-				}
244
+                }
245 245
 
246
-		}
246
+        }
247 247
 
248
-		// Get list of collections to show.
249
-		$collList = array ();
248
+        // Get list of collections to show.
249
+        $collList = array ();
250 250
 
251
-		$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
252
-			'tx_dlf_collections.index_name AS index_name',
253
-			'tx_dlf_collections',
254
-			'tx_dlf_collections.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_collections'),
255
-			'',
256
-			'',
257
-			''
258
-		);
251
+        $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
252
+            'tx_dlf_collections.index_name AS index_name',
253
+            'tx_dlf_collections',
254
+            'tx_dlf_collections.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_collections'),
255
+            '',
256
+            '',
257
+            ''
258
+        );
259 259
 
260
-		while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
260
+        while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
261 261
 
262
-			$collList[] = $resArray['index_name'];
262
+            $collList[] = $resArray['index_name'];
263 263
 
264
-		}
264
+        }
265 265
 
266
-		// Save original data array.
267
-		$cObjData = $this->cObj->data;
266
+        // Save original data array.
267
+        $cObjData = $this->cObj->data;
268 268
 
269
-		// Parse the metadata arrays.
270
-		foreach ($metadataArray as $metadata) {
269
+        // Parse the metadata arrays.
270
+        foreach ($metadataArray as $metadata) {
271 271
 
272
-			$markerArray['###METADATA###'] = '';
272
+            $markerArray['###METADATA###'] = '';
273 273
 
274
-			// Reset content object's data array.
275
-			$this->cObj->data = $cObjData;
274
+            // Reset content object's data array.
275
+            $this->cObj->data = $cObjData;
276 276
 
277
-			// Load all the metadata values into the content object's data array.
278
-			foreach ($metadata as $index_name => $value) {
277
+            // Load all the metadata values into the content object's data array.
278
+            foreach ($metadata as $index_name => $value) {
279 279
 
280
-				if (is_array($value)) {
280
+                if (is_array($value)) {
281 281
 
282
-					$this->cObj->data[$index_name] = implode($this->conf['separator'], $value);
282
+                    $this->cObj->data[$index_name] = implode($this->conf['separator'], $value);
283 283
 
284
-				} else {
284
+                } else {
285 285
 
286
-					$this->cObj->data[$index_name] = $value;
286
+                    $this->cObj->data[$index_name] = $value;
287 287
 
288
-				}
288
+                }
289 289
 
290
-			}
290
+            }
291 291
 
292
-			// Process each metadate.
293
-			foreach ($metaList as $index_name => $metaConf) {
292
+            // Process each metadate.
293
+            foreach ($metaList as $index_name => $metaConf) {
294 294
 
295
-				$parsedValue = '';
295
+                $parsedValue = '';
296 296
 
297
-				$fieldwrap = $this->parseTS($metaConf['wrap']);
297
+                $fieldwrap = $this->parseTS($metaConf['wrap']);
298 298
 
299
-				do {
299
+                do {
300 300
 
301
-					$value = @array_shift($metadata[$index_name]);
301
+                    $value = @array_shift($metadata[$index_name]);
302 302
 
303
-					if ($index_name == 'title') {
303
+                    if ($index_name == 'title') {
304 304
 
305
-						// Get title of parent document if needed.
306
-						if (empty($value) && $this->conf['getTitle'] && $this->doc->parentId) {
305
+                        // Get title of parent document if needed.
306
+                        if (empty($value) && $this->conf['getTitle'] && $this->doc->parentId) {
307 307
 
308
-							$superiorTitle = tx_dlf_document::getTitle($this->doc->parentId, TRUE);
308
+                            $superiorTitle = tx_dlf_document::getTitle($this->doc->parentId, TRUE);
309 309
 
310
-							if (!empty($superiorTitle)) {
310
+                            if (!empty($superiorTitle)) {
311 311
 
312
-								$value = '['.$superiorTitle.']';
312
+                                $value = '['.$superiorTitle.']';
313 313
 
314
-							}
314
+                            }
315 315
 
316
-						}
316
+                        }
317 317
 
318
-						if (!empty($value)) {
318
+                        if (!empty($value)) {
319 319
 
320
-							$value = htmlspecialchars($value);
320
+                            $value = htmlspecialchars($value);
321 321
 
322
-							// Link title to pageview.
323
-							if ($this->conf['linkTitle'] && $metadata['_id']) {
322
+                            // Link title to pageview.
323
+                            if ($this->conf['linkTitle'] && $metadata['_id']) {
324 324
 
325
-								$details = $this->doc->getLogicalStructure($metadata['_id']);
325
+                                $details = $this->doc->getLogicalStructure($metadata['_id']);
326 326
 
327
-								$value = $this->pi_linkTP($value, array ($this->prefixId => array ('id' => $this->doc->uid, 'page' => (!empty($details['points']) ? intval($details['points']) : 1))), TRUE, $this->conf['targetPid']);
327
+                                $value = $this->pi_linkTP($value, array ($this->prefixId => array ('id' => $this->doc->uid, 'page' => (!empty($details['points']) ? intval($details['points']) : 1))), TRUE, $this->conf['targetPid']);
328 328
 
329
-							}
329
+                            }
330 330
 
331
-						}
331
+                        }
332 332
 
333
-					} elseif ($index_name == 'owner' && !empty($value)) {
333
+                    } elseif ($index_name == 'owner' && !empty($value)) {
334 334
 
335
-						// Translate name of holding library.
336
-						$value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
335
+                        // Translate name of holding library.
336
+                        $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
337 337
 
338
-					} elseif ($index_name == 'type' && !empty($value)) {
338
+                    } elseif ($index_name == 'type' && !empty($value)) {
339 339
 
340
-						// Translate document type.
341
-						$value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
340
+                        // Translate document type.
341
+                        $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
342 342
 
343
-					} elseif ($index_name == 'collection' && !empty($value)) {
343
+                    } elseif ($index_name == 'collection' && !empty($value)) {
344 344
 
345
-						// Check if collections isn't hidden.
346
-						if (in_array($value, $collList)) {
345
+                        // Check if collections isn't hidden.
346
+                        if (in_array($value, $collList)) {
347 347
 
348
-							// Translate collection.
349
-							$value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_collections', $this->conf['pages']));
348
+                            // Translate collection.
349
+                            $value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_collections', $this->conf['pages']));
350 350
 
351
-						} else {
351
+                        } else {
352 352
 
353
-							$value = '';
353
+                            $value = '';
354 354
 
355
-						}
355
+                        }
356 356
 
357
-					} elseif ($index_name == 'language' && !empty($value)) {
357
+                    } elseif ($index_name == 'language' && !empty($value)) {
358 358
 
359
-						// Translate ISO 639 language code.
360
-						$value = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
359
+                        // Translate ISO 639 language code.
360
+                        $value = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
361 361
 
362
-					} elseif (!empty($value)) {
362
+                    } elseif (!empty($value)) {
363 363
 
364
-						// Sanitize value for output.
365
-						$value = htmlspecialchars($value);
364
+                        // Sanitize value for output.
365
+                        $value = htmlspecialchars($value);
366 366
 
367
-					}
367
+                    }
368 368
 
369
-					// Hook for getting a customized value (requested by SBB).
370
-					foreach ($this->hookObjects as $hookObj) {
369
+                    // Hook for getting a customized value (requested by SBB).
370
+                    foreach ($this->hookObjects as $hookObj) {
371 371
 
372
-						if (method_exists($hookObj, 'printMetadata_customizeMetadata')) {
372
+                        if (method_exists($hookObj, 'printMetadata_customizeMetadata')) {
373 373
 
374
-							$hookObj->printMetadata_customizeMetadata($value);
374
+                            $hookObj->printMetadata_customizeMetadata($value);
375 375
 
376
-						}
376
+                        }
377 377
 
378
-					}
378
+                    }
379 379
 
380
-					$value = $this->cObj->stdWrap($value, $fieldwrap['value.']);
380
+                    $value = $this->cObj->stdWrap($value, $fieldwrap['value.']);
381 381
 
382
-					if (!empty($value)) {
382
+                    if (!empty($value)) {
383 383
 
384
-						$parsedValue .= $value;
384
+                        $parsedValue .= $value;
385 385
 
386
-					}
386
+                    }
387 387
 
388
-				} while (count($metadata[$index_name]));
388
+                } while (count($metadata[$index_name]));
389 389
 
390
-				if (!empty($parsedValue)) {
390
+                if (!empty($parsedValue)) {
391 391
 
392
-					$field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']);
392
+                    $field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']);
393 393
 
394
-					$field .= $parsedValue;
394
+                    $field .= $parsedValue;
395 395
 
396
-					$markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
396
+                    $markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
397 397
 
398
-				}
398
+                }
399 399
 
400
-			}
400
+            }
401 401
 
402
-			$output .= $this->cObj->substituteMarkerArray($subpart['block'], $markerArray);
402
+            $output .= $this->cObj->substituteMarkerArray($subpart['block'], $markerArray);
403 403
 
404
-		}
404
+        }
405 405
 
406
-		return $this->cObj->substituteSubpart($this->template, '###BLOCK###', $output, TRUE);
406
+        return $this->cObj->substituteSubpart($this->template, '###BLOCK###', $output, TRUE);
407 407
 
408
-	}
408
+    }
409 409
 
410 410
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@
 block discarded – undo
213 213
 		$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
214 214
 			'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.wrap AS wrap',
215 215
 			'tx_dlf_metadata',
216
-			'tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata').' AND (sys_language_uid IN (-1,0) OR (sys_language_uid = ' .$GLOBALS['TSFE']->sys_language_uid. ' AND l18n_parent = 0))',
216
+			'tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata').' AND (sys_language_uid IN (-1,0) OR (sys_language_uid = '.$GLOBALS['TSFE']->sys_language_uid.' AND l18n_parent = 0))',
217 217
 			'',
218 218
 			'tx_dlf_metadata.sorting',
219 219
 			''
Please login to merge, or discard this patch.
plugins/collection/class.tx_dlf_collection.php 1 patch
Indentation   +261 added lines, -261 removed lines patch added patch discarded remove patch
@@ -19,414 +19,414 @@
 block discarded – undo
19 19
  */
20 20
 class tx_dlf_collection extends tx_dlf_plugin {
21 21
 
22
-	public $scriptRelPath = 'plugins/collection/class.tx_dlf_collection.php';
22
+    public $scriptRelPath = 'plugins/collection/class.tx_dlf_collection.php';
23 23
 
24
-	/**
25
-	 * This holds the hook objects
26
-	 *
27
-	 * @var	array
28
-	 * @access protected
29
-	 */
30
-	protected $hookObjects = array ();
24
+    /**
25
+     * This holds the hook objects
26
+     *
27
+     * @var	array
28
+     * @access protected
29
+     */
30
+    protected $hookObjects = array ();
31 31
 
32
-	/**
33
-	 * The main method of the PlugIn
34
-	 *
35
-	 * @access	public
36
-	 *
37
-	 * @param	string		$content: The PlugIn content
38
-	 * @param	array		$conf: The PlugIn configuration
39
-	 *
40
-	 * @return	string		The content that is displayed on the website
41
-	 */
42
-	public function main($content, $conf) {
32
+    /**
33
+     * The main method of the PlugIn
34
+     *
35
+     * @access	public
36
+     *
37
+     * @param	string		$content: The PlugIn content
38
+     * @param	array		$conf: The PlugIn configuration
39
+     *
40
+     * @return	string		The content that is displayed on the website
41
+     */
42
+    public function main($content, $conf) {
43 43
 
44
-		$this->init($conf);
44
+        $this->init($conf);
45 45
 
46
-		// Turn cache on.
47
-		$this->setCache(TRUE);
46
+        // Turn cache on.
47
+        $this->setCache(TRUE);
48 48
 
49
-		// Quit without doing anything if required configuration variables are not set.
50
-		if (empty($this->conf['pages'])) {
49
+        // Quit without doing anything if required configuration variables are not set.
50
+        if (empty($this->conf['pages'])) {
51 51
 
52
-			if (TYPO3_DLOG) {
52
+            if (TYPO3_DLOG) {
53 53
 
54
-				\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_collection->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
54
+                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_collection->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
55 55
 
56
-			}
56
+            }
57 57
 
58
-			return $content;
58
+            return $content;
59 59
 
60
-		}
60
+        }
61 61
 
62
-		// Load template file.
63
-		if (!empty($this->conf['templateFile'])) {
62
+        // Load template file.
63
+        if (!empty($this->conf['templateFile'])) {
64 64
 
65
-			$this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
65
+            $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
66 66
 
67
-		} else {
67
+        } else {
68 68
 
69
-			$this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/collection/template.tmpl'), '###TEMPLATE###');
69
+            $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/collection/template.tmpl'), '###TEMPLATE###');
70 70
 
71
-		}
71
+        }
72 72
 
73
-		// Get hook objects.
74
-		$this->hookObjects = tx_dlf_helper::getHookObjects($this->scriptRelPath);
73
+        // Get hook objects.
74
+        $this->hookObjects = tx_dlf_helper::getHookObjects($this->scriptRelPath);
75 75
 
76
-		if (!empty($this->piVars['collection'])) {
76
+        if (!empty($this->piVars['collection'])) {
77 77
 
78
-			$this->showSingleCollection(intval($this->piVars['collection']));
78
+            $this->showSingleCollection(intval($this->piVars['collection']));
79 79
 
80
-		} else {
80
+        } else {
81 81
 
82
-			$content .= $this->showCollectionList();
82
+            $content .= $this->showCollectionList();
83 83
 
84
-		}
84
+        }
85 85
 
86
-		return $this->pi_wrapInBaseClass($content);
86
+        return $this->pi_wrapInBaseClass($content);
87 87
 
88
-	}
88
+    }
89 89
 
90
-	/**
91
-	 * Builds a collection list
92
-	 *
93
-	 * @access	protected
94
-	 *
95
-	 * @return	string		The list of collections ready to output
96
-	 */
97
-	protected function showCollectionList() {
90
+    /**
91
+     * Builds a collection list
92
+     *
93
+     * @access	protected
94
+     *
95
+     * @return	string		The list of collections ready to output
96
+     */
97
+    protected function showCollectionList() {
98 98
 
99
-		$additionalWhere = '';
99
+        $additionalWhere = '';
100 100
 
101
-		$orderBy = 'tx_dlf_collections.label';
101
+        $orderBy = 'tx_dlf_collections.label';
102 102
 
103
-		// Handle collections set by configuration.
104
-		if ($this->conf['collections']) {
103
+        // Handle collections set by configuration.
104
+        if ($this->conf['collections']) {
105 105
 
106
-			if (count(explode(',', $this->conf['collections'])) == 1 && empty($this->conf['dont_show_single'])) {
106
+            if (count(explode(',', $this->conf['collections'])) == 1 && empty($this->conf['dont_show_single'])) {
107 107
 
108
-				$this->showSingleCollection(intval(trim($this->conf['collections'], ' ,')));
108
+                $this->showSingleCollection(intval(trim($this->conf['collections'], ' ,')));
109 109
 
110
-			}
110
+            }
111 111
 
112
-			$additionalWhere .= ' AND tx_dlf_collections.uid IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).')';
112
+            $additionalWhere .= ' AND tx_dlf_collections.uid IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).')';
113 113
 
114
-			$orderBy = 'FIELD(tx_dlf_collections.uid, '.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).')';
114
+            $orderBy = 'FIELD(tx_dlf_collections.uid, '.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).')';
115 115
 
116
-		}
116
+        }
117 117
 
118
-		// Should user-defined collections be shown?
119
-		if (empty($this->conf['show_userdefined'])) {
118
+        // Should user-defined collections be shown?
119
+        if (empty($this->conf['show_userdefined'])) {
120 120
 
121
-			$additionalWhere .= ' AND tx_dlf_collections.fe_cruser_id=0';
121
+            $additionalWhere .= ' AND tx_dlf_collections.fe_cruser_id=0';
122 122
 
123
-		} elseif ($this->conf['show_userdefined'] > 0) {
123
+        } elseif ($this->conf['show_userdefined'] > 0) {
124 124
 
125
-			if (!empty($GLOBALS['TSFE']->fe_user->user['uid'])) {
125
+            if (!empty($GLOBALS['TSFE']->fe_user->user['uid'])) {
126 126
 
127
-				$additionalWhere .= ' AND tx_dlf_collections.fe_cruser_id='.intval($GLOBALS['TSFE']->fe_user->user['uid']);
127
+                $additionalWhere .= ' AND tx_dlf_collections.fe_cruser_id='.intval($GLOBALS['TSFE']->fe_user->user['uid']);
128 128
 
129
-			} else {
129
+            } else {
130 130
 
131
-				$additionalWhere .= ' AND NOT tx_dlf_collections.fe_cruser_id=0';
131
+                $additionalWhere .= ' AND NOT tx_dlf_collections.fe_cruser_id=0';
132 132
 
133
-			}
133
+            }
134 134
 
135
-		}
135
+        }
136 136
 
137
-		// Get collections.
138
-		$result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
139
-			'tx_dlf_collections.uid AS uid,tx_dlf_collections.label AS label,tx_dlf_collections.thumbnail AS thumbnail,tx_dlf_collections.description AS description,tx_dlf_collections.priority AS priority,COUNT(tx_dlf_documents.uid) AS titles',
140
-			'tx_dlf_documents',
141
-			'tx_dlf_relations',
142
-			'tx_dlf_collections',
143
-			'AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_documents.partof=0 AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
144
-			'tx_dlf_collections.uid',
145
-			$orderBy,
146
-			''
147
-		);
137
+        // Get collections.
138
+        $result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
139
+            'tx_dlf_collections.uid AS uid,tx_dlf_collections.label AS label,tx_dlf_collections.thumbnail AS thumbnail,tx_dlf_collections.description AS description,tx_dlf_collections.priority AS priority,COUNT(tx_dlf_documents.uid) AS titles',
140
+            'tx_dlf_documents',
141
+            'tx_dlf_relations',
142
+            'tx_dlf_collections',
143
+            'AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_documents.partof=0 AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
144
+            'tx_dlf_collections.uid',
145
+            $orderBy,
146
+            ''
147
+        );
148 148
 
149
-		$count = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
149
+        $count = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
150 150
 
151
-		$content = '';
151
+        $content = '';
152 152
 
153
-		if ($count == 1 && empty($this->conf['dont_show_single'])) {
153
+        if ($count == 1 && empty($this->conf['dont_show_single'])) {
154 154
 
155
-			$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
155
+            $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
156 156
 
157
-			$this->showSingleCollection(intval($resArray['uid']));
157
+            $this->showSingleCollection(intval($resArray['uid']));
158 158
 
159
-		} elseif ($count > 0) {
159
+        } elseif ($count > 0) {
160 160
 
161
-			// Get number of volumes per collection.
162
-			$resultVolumes = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
163
-				'tx_dlf_collections.uid AS uid,COUNT(tx_dlf_documents.uid) AS volumes',
164
-				'tx_dlf_documents',
165
-				'tx_dlf_relations',
166
-				'tx_dlf_collections',
167
-				'AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND NOT tx_dlf_documents.uid IN (SELECT DISTINCT tx_dlf_documents.partof FROM tx_dlf_documents WHERE NOT tx_dlf_documents.partof=0'.tx_dlf_helper::whereClause('tx_dlf_documents').') AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
168
-				'tx_dlf_collections.uid',
169
-				'',
170
-				''
171
-			);
161
+            // Get number of volumes per collection.
162
+            $resultVolumes = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
163
+                'tx_dlf_collections.uid AS uid,COUNT(tx_dlf_documents.uid) AS volumes',
164
+                'tx_dlf_documents',
165
+                'tx_dlf_relations',
166
+                'tx_dlf_collections',
167
+                'AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND NOT tx_dlf_documents.uid IN (SELECT DISTINCT tx_dlf_documents.partof FROM tx_dlf_documents WHERE NOT tx_dlf_documents.partof=0'.tx_dlf_helper::whereClause('tx_dlf_documents').') AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
168
+                'tx_dlf_collections.uid',
169
+                '',
170
+                ''
171
+            );
172 172
 
173
-			$volumes = array ();
173
+            $volumes = array ();
174 174
 
175
-			while ($resArrayVolumes = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultVolumes)) {
175
+            while ($resArrayVolumes = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultVolumes)) {
176 176
 
177
-				$volumes[$resArrayVolumes['uid']] = $resArrayVolumes['volumes'];
177
+                $volumes[$resArrayVolumes['uid']] = $resArrayVolumes['volumes'];
178 178
 
179
-			}
179
+            }
180 180
 
181
-			// Process results.
182
-			while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
181
+            // Process results.
182
+            while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
183 183
 
184
-				// Generate random but unique array key taking priority into account.
185
-				do {
184
+                // Generate random but unique array key taking priority into account.
185
+                do {
186 186
 
187
-					$_key = ($resArray['priority'] * 1000) + mt_rand(0, 1000);
187
+                    $_key = ($resArray['priority'] * 1000) + mt_rand(0, 1000);
188 188
 
189
-				} while (!empty($markerArray[$_key]));
189
+                } while (!empty($markerArray[$_key]));
190 190
 
191
-				// Merge plugin variables with new set of values.
192
-				$additionalParams = array ('collection' => $resArray['uid']);
191
+                // Merge plugin variables with new set of values.
192
+                $additionalParams = array ('collection' => $resArray['uid']);
193 193
 
194
-				if (is_array($this->piVars)) {
194
+                if (is_array($this->piVars)) {
195 195
 
196
-					$piVars = $this->piVars;
196
+                    $piVars = $this->piVars;
197 197
 
198
-					unset($piVars['DATA']);
198
+                    unset($piVars['DATA']);
199 199
 
200
-					$additionalParams = tx_dlf_helper::array_merge_recursive_overrule($piVars, $additionalParams);
200
+                    $additionalParams = tx_dlf_helper::array_merge_recursive_overrule($piVars, $additionalParams);
201 201
 
202
-				}
202
+                }
203 203
 
204
-				// Build typolink configuration array.
205
-				$conf = array (
206
-					'useCacheHash' => 1,
207
-					'parameter' => $GLOBALS['TSFE']->id,
208
-					'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
209
-				);
204
+                // Build typolink configuration array.
205
+                $conf = array (
206
+                    'useCacheHash' => 1,
207
+                    'parameter' => $GLOBALS['TSFE']->id,
208
+                    'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
209
+                );
210 210
 
211
-				// Link collection's title to list view.
212
-				$markerArray[$_key]['###TITLE###'] = $this->cObj->typoLink(htmlspecialchars($resArray['label']), $conf);
211
+                // Link collection's title to list view.
212
+                $markerArray[$_key]['###TITLE###'] = $this->cObj->typoLink(htmlspecialchars($resArray['label']), $conf);
213 213
 
214
-				// Add feed link if applicable.
215
-				if (!empty($this->conf['targetFeed'])) {
214
+                // Add feed link if applicable.
215
+                if (!empty($this->conf['targetFeed'])) {
216 216
 
217
-					$img = '<img src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'res/icons/txdlffeeds.png" alt="'.$this->pi_getLL('feedAlt', '', TRUE).'" title="'.$this->pi_getLL('feedTitle', '', TRUE).'" />';
217
+                    $img = '<img src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'res/icons/txdlffeeds.png" alt="'.$this->pi_getLL('feedAlt', '', TRUE).'" title="'.$this->pi_getLL('feedTitle', '', TRUE).'" />';
218 218
 
219
-					$markerArray[$_key]['###FEED###'] = $this->pi_linkTP($img, array ($this->prefixId => array ('collection' => $resArray['uid'])), FALSE, $this->conf['targetFeed']);
219
+                    $markerArray[$_key]['###FEED###'] = $this->pi_linkTP($img, array ($this->prefixId => array ('collection' => $resArray['uid'])), FALSE, $this->conf['targetFeed']);
220 220
 
221
-				} else {
221
+                } else {
222 222
 
223
-					$markerArray[$_key]['###FEED###'] = '';
223
+                    $markerArray[$_key]['###FEED###'] = '';
224 224
 
225
-				}
225
+                }
226 226
 
227
-				// Add thumbnail.
228
-				if (!empty($resArray['thumbnail'])) {
227
+                // Add thumbnail.
228
+                if (!empty($resArray['thumbnail'])) {
229 229
 
230
-					$markerArray[$_key]['###THUMBNAIL###'] = '<img alt="" title="'.htmlspecialchars($resArray['label']).'" src="'.$resArray['thumbnail'].'" />';
230
+                    $markerArray[$_key]['###THUMBNAIL###'] = '<img alt="" title="'.htmlspecialchars($resArray['label']).'" src="'.$resArray['thumbnail'].'" />';
231 231
 
232
-				} else {
232
+                } else {
233 233
 
234
-					$markerArray[$_key]['###THUMBNAIL###'] = '';
234
+                    $markerArray[$_key]['###THUMBNAIL###'] = '';
235 235
 
236
-				}
236
+                }
237 237
 
238
-				// Add description.
239
-				$markerArray[$_key]['###DESCRIPTION###'] = $this->pi_RTEcssText($resArray['description']);
238
+                // Add description.
239
+                $markerArray[$_key]['###DESCRIPTION###'] = $this->pi_RTEcssText($resArray['description']);
240 240
 
241
-				// Build statistic's output.
242
-				$labelTitles = $this->pi_getLL(($resArray['titles'] > 1 ? 'titles' : 'title'), '', FALSE);
241
+                // Build statistic's output.
242
+                $labelTitles = $this->pi_getLL(($resArray['titles'] > 1 ? 'titles' : 'title'), '', FALSE);
243 243
 
244
-				$markerArray[$_key]['###COUNT_TITLES###'] = htmlspecialchars($resArray['titles'].$labelTitles);
244
+                $markerArray[$_key]['###COUNT_TITLES###'] = htmlspecialchars($resArray['titles'].$labelTitles);
245 245
 
246
-				$labelVolumes = $this->pi_getLL(($volumes[$resArray['uid']] > 1 ? 'volumes' : 'volume'), '', FALSE);
246
+                $labelVolumes = $this->pi_getLL(($volumes[$resArray['uid']] > 1 ? 'volumes' : 'volume'), '', FALSE);
247 247
 
248
-				$markerArray[$_key]['###COUNT_VOLUMES###'] = htmlspecialchars($volumes[$resArray['uid']].$labelVolumes);
248
+                $markerArray[$_key]['###COUNT_VOLUMES###'] = htmlspecialchars($volumes[$resArray['uid']].$labelVolumes);
249 249
 
250
-			}
250
+            }
251 251
 
252
-			// Randomize sorting?
253
-			if (!empty($this->conf['randomize'])) {
252
+            // Randomize sorting?
253
+            if (!empty($this->conf['randomize'])) {
254 254
 
255
-				ksort($markerArray, SORT_NUMERIC);
255
+                ksort($markerArray, SORT_NUMERIC);
256 256
 
257
-				// Don't cache the output.
258
-				$this->setCache(FALSE);
257
+                // Don't cache the output.
258
+                $this->setCache(FALSE);
259 259
 
260
-			}
260
+            }
261 261
 
262
-			$entry = $this->cObj->getSubpart($this->template, '###ENTRY###');
262
+            $entry = $this->cObj->getSubpart($this->template, '###ENTRY###');
263 263
 
264
-			foreach ($markerArray as $marker) {
264
+            foreach ($markerArray as $marker) {
265 265
 
266
-				$content .= $this->cObj->substituteMarkerArray($entry, $marker);
266
+                $content .= $this->cObj->substituteMarkerArray($entry, $marker);
267 267
 
268
-			}
268
+            }
269 269
 
270
-			// Hook for getting custom collection hierarchies/subentries (requested by SBB).
271
-			foreach ($this->hookObjects as $hookObj) {
270
+            // Hook for getting custom collection hierarchies/subentries (requested by SBB).
271
+            foreach ($this->hookObjects as $hookObj) {
272 272
 
273
-				if (method_exists($hookObj, 'showCollectionList_getCustomCollectionList')) {
273
+                if (method_exists($hookObj, 'showCollectionList_getCustomCollectionList')) {
274 274
 
275
-					$hookObj->showCollectionList_getCustomCollectionList($this, $this->conf['templateFile'], $content, $markerArray);
275
+                    $hookObj->showCollectionList_getCustomCollectionList($this, $this->conf['templateFile'], $content, $markerArray);
276 276
 
277
-				}
277
+                }
278 278
 
279
-			}
279
+            }
280 280
 
281
-			return $this->cObj->substituteSubpart($this->template, '###ENTRY###', $content, TRUE);
281
+            return $this->cObj->substituteSubpart($this->template, '###ENTRY###', $content, TRUE);
282 282
 
283
-		}
283
+        }
284 284
 
285
-		return $content;
285
+        return $content;
286 286
 
287
-	}
287
+    }
288 288
 
289
-	/**
290
-	 * Builds a collection's list
291
-	 *
292
-	 * @access	protected
293
-	 *
294
-	 * @param	integer		$id: The collection's UID
295
-	 *
296
-	 * @return	void
297
-	 */
298
-	protected function showSingleCollection($id) {
289
+    /**
290
+     * Builds a collection's list
291
+     *
292
+     * @access	protected
293
+     *
294
+     * @param	integer		$id: The collection's UID
295
+     *
296
+     * @return	void
297
+     */
298
+    protected function showSingleCollection($id) {
299 299
 
300
-		// Should user-defined collections be shown?
301
-		if (empty($this->conf['show_userdefined'])) {
300
+        // Should user-defined collections be shown?
301
+        if (empty($this->conf['show_userdefined'])) {
302 302
 
303
-			$additionalWhere = ' AND tx_dlf_collections.fe_cruser_id=0';
303
+            $additionalWhere = ' AND tx_dlf_collections.fe_cruser_id=0';
304 304
 
305
-		} elseif ($this->conf['show_userdefined'] > 0) {
305
+        } elseif ($this->conf['show_userdefined'] > 0) {
306 306
 
307
-			$additionalWhere = ' AND NOT tx_dlf_collections.fe_cruser_id=0';
307
+            $additionalWhere = ' AND NOT tx_dlf_collections.fe_cruser_id=0';
308 308
 
309
-		}
309
+        }
310 310
 
311
-		// Get all documents in collection.
312
-		$result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
313
-			'tx_dlf_collections.index_name AS index_name,tx_dlf_collections.label AS collLabel,tx_dlf_collections.description AS collDesc,tx_dlf_collections.thumbnail AS collThumb,tx_dlf_collections.fe_cruser_id AS userid,tx_dlf_documents.uid AS uid,tx_dlf_documents.metadata_sorting AS metadata_sorting,tx_dlf_documents.volume_sorting AS volume_sorting,tx_dlf_documents.partof AS partof',
314
-			'tx_dlf_documents',
315
-			'tx_dlf_relations',
316
-			'tx_dlf_collections',
317
-			'AND tx_dlf_collections.uid='.intval($id).' AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
318
-			'',
319
-			'tx_dlf_documents.title_sorting ASC',
320
-			''
321
-		);
311
+        // Get all documents in collection.
312
+        $result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
313
+            'tx_dlf_collections.index_name AS index_name,tx_dlf_collections.label AS collLabel,tx_dlf_collections.description AS collDesc,tx_dlf_collections.thumbnail AS collThumb,tx_dlf_collections.fe_cruser_id AS userid,tx_dlf_documents.uid AS uid,tx_dlf_documents.metadata_sorting AS metadata_sorting,tx_dlf_documents.volume_sorting AS volume_sorting,tx_dlf_documents.partof AS partof',
314
+            'tx_dlf_documents',
315
+            'tx_dlf_relations',
316
+            'tx_dlf_collections',
317
+            'AND tx_dlf_collections.uid='.intval($id).' AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
318
+            '',
319
+            'tx_dlf_documents.title_sorting ASC',
320
+            ''
321
+        );
322 322
 
323
-		$toplevel = array ();
323
+        $toplevel = array ();
324 324
 
325
-		$subparts = array ();
325
+        $subparts = array ();
326 326
 
327
-		$listMetadata = array ();
327
+        $listMetadata = array ();
328 328
 
329
-		// Process results.
330
-		while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
329
+        // Process results.
330
+        while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
331 331
 
332
-			if (empty($listMetadata)) {
332
+            if (empty($listMetadata)) {
333 333
 
334
-				$listMetadata = array (
335
-					'label' => htmlspecialchars($resArray['collLabel']),
336
-					'description' => $this->pi_RTEcssText($resArray['collDesc']),
337
-					'thumbnail' => htmlspecialchars($resArray['collThumb']),
338
-					'options' => array (
339
-						'source' => 'collection',
340
-						'select' => $id,
341
-						'userid' => $resArray['userid'],
342
-						'params' => array ('fq' => array ('collection_faceting:("'.$resArray['index_name'].'")')),
343
-						'core' => '',
344
-						'pid' => $this->conf['pages'],
345
-						'order' => 'title',
346
-						'order.asc' => TRUE
347
-					)
348
-				);
334
+                $listMetadata = array (
335
+                    'label' => htmlspecialchars($resArray['collLabel']),
336
+                    'description' => $this->pi_RTEcssText($resArray['collDesc']),
337
+                    'thumbnail' => htmlspecialchars($resArray['collThumb']),
338
+                    'options' => array (
339
+                        'source' => 'collection',
340
+                        'select' => $id,
341
+                        'userid' => $resArray['userid'],
342
+                        'params' => array ('fq' => array ('collection_faceting:("'.$resArray['index_name'].'")')),
343
+                        'core' => '',
344
+                        'pid' => $this->conf['pages'],
345
+                        'order' => 'title',
346
+                        'order.asc' => TRUE
347
+                    )
348
+                );
349 349
 
350
-			}
350
+            }
351 351
 
352
-			// Split toplevel documents from volumes.
353
-			if ($resArray['partof'] == 0) {
352
+            // Split toplevel documents from volumes.
353
+            if ($resArray['partof'] == 0) {
354 354
 
355
-				// Prepare document's metadata for sorting.
356
-				$sorting = unserialize($resArray['metadata_sorting']);
355
+                // Prepare document's metadata for sorting.
356
+                $sorting = unserialize($resArray['metadata_sorting']);
357 357
 
358
-				if (!empty($sorting['type']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($sorting['type'])) {
358
+                if (!empty($sorting['type']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($sorting['type'])) {
359 359
 
360
-					$sorting['type'] = tx_dlf_helper::getIndexName($sorting['type'], 'tx_dlf_structures', $this->conf['pages']);
360
+                    $sorting['type'] = tx_dlf_helper::getIndexName($sorting['type'], 'tx_dlf_structures', $this->conf['pages']);
361 361
 
362
-				}
362
+                }
363 363
 
364
-				if (!empty($sorting['owner']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($sorting['owner'])) {
364
+                if (!empty($sorting['owner']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($sorting['owner'])) {
365 365
 
366
-					$sorting['owner'] = tx_dlf_helper::getIndexName($sorting['owner'], 'tx_dlf_libraries', $this->conf['pages']);
366
+                    $sorting['owner'] = tx_dlf_helper::getIndexName($sorting['owner'], 'tx_dlf_libraries', $this->conf['pages']);
367 367
 
368
-				}
368
+                }
369 369
 
370
-				if (!empty($sorting['collection']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($sorting['collection'])) {
370
+                if (!empty($sorting['collection']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($sorting['collection'])) {
371 371
 
372
-					$sorting['collection'] = tx_dlf_helper::getIndexName($sorting['collection'], 'tx_dlf_collections', $this->conf['pages']);
372
+                    $sorting['collection'] = tx_dlf_helper::getIndexName($sorting['collection'], 'tx_dlf_collections', $this->conf['pages']);
373 373
 
374
-				}
374
+                }
375 375
 
376
-				$toplevel[$resArray['uid']] = array (
377
-					'u' => $resArray['uid'],
378
-					'h' => '',
379
-					's' => $sorting,
380
-					'p' => array ()
381
-				);
376
+                $toplevel[$resArray['uid']] = array (
377
+                    'u' => $resArray['uid'],
378
+                    'h' => '',
379
+                    's' => $sorting,
380
+                    'p' => array ()
381
+                );
382 382
 
383
-			} else {
383
+            } else {
384 384
 
385
-				$subparts[$resArray['partof']][$resArray['volume_sorting']] = $resArray['uid'];
385
+                $subparts[$resArray['partof']][$resArray['volume_sorting']] = $resArray['uid'];
386 386
 
387
-			}
387
+            }
388 388
 
389
-		}
389
+        }
390 390
 
391
-		// Add volumes to the corresponding toplevel documents.
392
-		foreach ($subparts as $partof => $parts) {
391
+        // Add volumes to the corresponding toplevel documents.
392
+        foreach ($subparts as $partof => $parts) {
393 393
 
394
-			if (!empty($toplevel[$partof])) {
394
+            if (!empty($toplevel[$partof])) {
395 395
 
396
-				ksort($parts);
396
+                ksort($parts);
397 397
 
398
-				foreach ($parts as $part) {
398
+                foreach ($parts as $part) {
399 399
 
400
-					$toplevel[$partof]['p'][] = array ('u' => $part);
400
+                    $toplevel[$partof]['p'][] = array ('u' => $part);
401 401
 
402
-				}
402
+                }
403 403
 
404
-			}
404
+            }
405 405
 
406
-		}
406
+        }
407 407
 
408
-		// Save list of documents.
409
-		$list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
408
+        // Save list of documents.
409
+        $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
410 410
 
411
-		$list->reset();
411
+        $list->reset();
412 412
 
413
-		$list->add(array_values($toplevel));
413
+        $list->add(array_values($toplevel));
414 414
 
415
-		$list->metadata = $listMetadata;
415
+        $list->metadata = $listMetadata;
416 416
 
417
-		$list->save();
417
+        $list->save();
418 418
 
419
-		// Clean output buffer.
420
-		\TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
419
+        // Clean output buffer.
420
+        \TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
421 421
 
422
-		// Send headers.
423
-		header('Location: '.\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL(array ('parameter' => $this->conf['targetPid']))));
422
+        // Send headers.
423
+        header('Location: '.\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL(array ('parameter' => $this->conf['targetPid']))));
424 424
 
425
-		// Flush output buffer and end script processing.
426
-		ob_end_flush();
425
+        // Flush output buffer and end script processing.
426
+        ob_end_flush();
427 427
 
428
-		exit;
428
+        exit;
429 429
 
430
-	}
430
+    }
431 431
 
432 432
 }
Please login to merge, or discard this patch.
plugins/search/class.tx_dlf_search_suggest.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -20,43 +20,43 @@
 block discarded – undo
20 20
  */
21 21
 class tx_dlf_search_suggest extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
22 22
 
23
-	public $scriptRelPath = 'plugins/search/class.tx_dlf_search_suggest.php';
23
+    public $scriptRelPath = 'plugins/search/class.tx_dlf_search_suggest.php';
24 24
 
25
-	/**
26
-	 * The main method of the PlugIn
27
-	 *
28
-	 * @access	public
29
-	 *
30
-	 * @param	string		$content: The PlugIn content
31
-	 * @param	array		$conf: The PlugIn configuration
32
-	 *
33
-	 * @return	void
34
-	 */
35
-	public function main($content = '', $conf = array ()) {
25
+    /**
26
+     * The main method of the PlugIn
27
+     *
28
+     * @access	public
29
+     *
30
+     * @param	string		$content: The PlugIn content
31
+     * @param	array		$conf: The PlugIn configuration
32
+     *
33
+     * @return	void
34
+     */
35
+    public function main($content = '', $conf = array ()) {
36 36
 
37
-		if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('encrypted') != '' && \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('hashed') != '') {
37
+        if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('encrypted') != '' && \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('hashed') != '') {
38 38
 
39
-			$core = tx_dlf_helper::decrypt(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('encrypted'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('hashed'));
39
+            $core = tx_dlf_helper::decrypt(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('encrypted'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('hashed'));
40 40
 
41
-		}
41
+        }
42 42
 
43
-		if (!empty($core)) {
43
+        if (!empty($core)) {
44 44
 
45
-			$url = trim(tx_dlf_solr::getSolrUrl($core), '/').'/suggest/?q='.tx_dlf_solr::escapeQuery(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('q'));
45
+            $url = trim(tx_dlf_solr::getSolrUrl($core), '/').'/suggest/?q='.tx_dlf_solr::escapeQuery(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('q'));
46 46
 
47
-			if ($stream = fopen($url, 'r')) {
47
+            if ($stream = fopen($url, 'r')) {
48 48
 
49
-				$content .= stream_get_contents($stream);
49
+                $content .= stream_get_contents($stream);
50 50
 
51
-				fclose($stream);
51
+                fclose($stream);
52 52
 
53
-			}
53
+            }
54 54
 
55
-		}
55
+        }
56 56
 
57
-		echo $content;
57
+        echo $content;
58 58
 
59
-	}
59
+    }
60 60
 
61 61
 }
62 62
 
Please login to merge, or discard this patch.
plugins/search/class.tx_dlf_search.php 2 patches
Indentation   +515 added lines, -515 removed lines patch added patch discarded remove patch
@@ -20,834 +20,834 @@
 block discarded – undo
20 20
  */
21 21
 class tx_dlf_search extends tx_dlf_plugin {
22 22
 
23
-	public $scriptRelPath = 'plugins/search/class.tx_dlf_search.php';
23
+    public $scriptRelPath = 'plugins/search/class.tx_dlf_search.php';
24 24
 
25
-	/**
26
-	 * Adds the JS files necessary for search suggestions
27
-	 *
28
-	 * @access	protected
29
-	 *
30
-	 * @return	void
31
-	 */
32
-	protected function addAutocompleteJS() {
25
+    /**
26
+     * Adds the JS files necessary for search suggestions
27
+     *
28
+     * @access	protected
29
+     *
30
+     * @return	void
31
+     */
32
+    protected function addAutocompleteJS() {
33 33
 
34
-		// Check if there are any metadata to suggest.
35
-		$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
36
-			'tx_dlf_metadata.*',
37
-			'tx_dlf_metadata',
38
-			'tx_dlf_metadata.index_autocomplete=1 AND tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'),
39
-			'',
40
-			'',
41
-			'1'
42
-		);
34
+        // Check if there are any metadata to suggest.
35
+        $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
36
+            'tx_dlf_metadata.*',
37
+            'tx_dlf_metadata',
38
+            'tx_dlf_metadata.index_autocomplete=1 AND tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'),
39
+            '',
40
+            '',
41
+            '1'
42
+        );
43 43
 
44 44
 
45
-		if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
45
+        if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
46 46
 
47
-			$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId.'_search_suggest'] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/search/tx_dlf_search_suggest.js"></script>';
47
+            $GLOBALS['TSFE']->additionalHeaderData[$this->prefixId.'_search_suggest'] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/search/tx_dlf_search_suggest.js"></script>';
48 48
 
49
-		} else {
49
+        } else {
50 50
 
51
-			if (TYPO3_DLOG) {
51
+            if (TYPO3_DLOG) {
52 52
 
53
-				\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->addAutocompleteJS()] No metadata fields configured for search suggestions', $this->extKey, SYSLOG_SEVERITY_WARNING);
53
+                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->addAutocompleteJS()] No metadata fields configured for search suggestions', $this->extKey, SYSLOG_SEVERITY_WARNING);
54 54
 
55
-			}
55
+            }
56 56
 
57
-		}
57
+        }
58 58
 
59
-	}
59
+    }
60 60
 
61
-	/**
62
-	 * Adds the current collection's UID to the search form
63
-	 *
64
-	 * @access	protected
65
-	 *
66
-	 * @return	string		HTML input fields with current document's UID and parent ID
67
-	 */
68
-	protected function addCurrentCollection() {
61
+    /**
62
+     * Adds the current collection's UID to the search form
63
+     *
64
+     * @access	protected
65
+     *
66
+     * @return	string		HTML input fields with current document's UID and parent ID
67
+     */
68
+    protected function addCurrentCollection() {
69 69
 
70
-		// Load current collection.
71
-		$list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
70
+        // Load current collection.
71
+        $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
72 72
 
73
-		if (!empty($list->metadata['options']['source']) && $list->metadata['options']['source'] == 'collection') {
73
+        if (!empty($list->metadata['options']['source']) && $list->metadata['options']['source'] == 'collection') {
74 74
 
75
-			// Get collection's UID.
76
-			return '<input type="hidden" name="'.$this->prefixId.'[collection]" value="'.$list->metadata['options']['select'].'" />';
75
+            // Get collection's UID.
76
+            return '<input type="hidden" name="'.$this->prefixId.'[collection]" value="'.$list->metadata['options']['select'].'" />';
77 77
 
78
-		} elseif (!empty($list->metadata['options']['params']['fq'])) {
78
+        } elseif (!empty($list->metadata['options']['params']['fq'])) {
79 79
 
80
-			// Get collection's UID from search metadata.
81
-			foreach ($list->metadata['options']['params']['fq'] as $id => $facet) {
80
+            // Get collection's UID from search metadata.
81
+            foreach ($list->metadata['options']['params']['fq'] as $id => $facet) {
82 82
 
83
-				$facetKeyVal = explode(':', $facet, 2);
83
+                $facetKeyVal = explode(':', $facet, 2);
84 84
 
85
-				if ($facetKeyVal[0] == 'collection_faceting' && !strpos($facetKeyVal[1], '" OR "')) {
85
+                if ($facetKeyVal[0] == 'collection_faceting' && !strpos($facetKeyVal[1], '" OR "')) {
86 86
 
87
-					$collectionId = tx_dlf_helper::getIdFromIndexName(trim($facetKeyVal[1], '(")'), 'tx_dlf_collections');
87
+                    $collectionId = tx_dlf_helper::getIdFromIndexName(trim($facetKeyVal[1], '(")'), 'tx_dlf_collections');
88 88
 
89
-				}
89
+                }
90 90
 
91
-			}
91
+            }
92 92
 
93
-			return '<input type="hidden" name="'.$this->prefixId.'[collection]" value="'.$collectionId.'" />';
93
+            return '<input type="hidden" name="'.$this->prefixId.'[collection]" value="'.$collectionId.'" />';
94 94
 
95
-		}
95
+        }
96 96
 
97
-		return '';
97
+        return '';
98 98
 
99
-	}
99
+    }
100 100
 
101
-	/**
102
-	 * Adds the current document's UID or parent ID to the search form
103
-	 *
104
-	 * @access	protected
105
-	 *
106
-	 * @return	string		HTML input fields with current document's UID and parent ID
107
-	 */
108
-	protected function addCurrentDocument() {
101
+    /**
102
+     * Adds the current document's UID or parent ID to the search form
103
+     *
104
+     * @access	protected
105
+     *
106
+     * @return	string		HTML input fields with current document's UID and parent ID
107
+     */
108
+    protected function addCurrentDocument() {
109 109
 
110
-		// Load current list object.
111
-		$list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
110
+        // Load current list object.
111
+        $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
112 112
 
113
-		// Load current document.
114
-		if (!empty($this->piVars['id']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['id'])) {
113
+        // Load current document.
114
+        if (!empty($this->piVars['id']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['id'])) {
115 115
 
116
-			$this->loadDocument();
116
+            $this->loadDocument();
117 117
 
118
-			// Get document's UID or parent ID.
119
-			if ($this->doc->ready) {
118
+            // Get document's UID or parent ID.
119
+            if ($this->doc->ready) {
120 120
 
121
-				return '<input type="hidden" name="'.$this->prefixId.'[id]" value="'.($this->doc->parentId > 0 ? $this->doc->parentId : $this->doc->uid).'" />';
121
+                return '<input type="hidden" name="'.$this->prefixId.'[id]" value="'.($this->doc->parentId > 0 ? $this->doc->parentId : $this->doc->uid).'" />';
122 122
 
123
-			}
123
+            }
124 124
 
125
-		} elseif (!empty($list->metadata['options']['params']['fq'])) {
125
+        } elseif (!empty($list->metadata['options']['params']['fq'])) {
126 126
 
127
-			// Get document's UID from search metadata.
128
-			foreach ($list->metadata['options']['params']['fq'] as $id => $facet) {
127
+            // Get document's UID from search metadata.
128
+            foreach ($list->metadata['options']['params']['fq'] as $id => $facet) {
129 129
 
130
-				$facetKeyVal = explode(':', $facet);
130
+                $facetKeyVal = explode(':', $facet);
131 131
 
132
-				if ($facetKeyVal[0] == 'uid') {
132
+                if ($facetKeyVal[0] == 'uid') {
133 133
 
134
-					$documentId = (int) substr($facetKeyVal[1], 1, strpos($facetKeyVal[1], ')'));
134
+                    $documentId = (int) substr($facetKeyVal[1], 1, strpos($facetKeyVal[1], ')'));
135 135
 
136
-				}
136
+                }
137 137
 
138
-			}
138
+            }
139 139
 
140
-			return '<input type="hidden" name="'.$this->prefixId.'[id]" value="'.$documentId.'" />';
140
+            return '<input type="hidden" name="'.$this->prefixId.'[id]" value="'.$documentId.'" />';
141 141
 
142
-		}
142
+        }
143 143
 
144
-		return '';
144
+        return '';
145 145
 
146
-	}
146
+    }
147 147
 
148
-	/**
149
-	 * Adds the encrypted Solr core name to the search form
150
-	 *
151
-	 * @access	protected
152
-	 *
153
-	 * @return	string		HTML input fields with encrypted core name and hash
154
-	 */
155
-	protected function addEncryptedCoreName() {
148
+    /**
149
+     * Adds the encrypted Solr core name to the search form
150
+     *
151
+     * @access	protected
152
+     *
153
+     * @return	string		HTML input fields with encrypted core name and hash
154
+     */
155
+    protected function addEncryptedCoreName() {
156 156
 
157
-		// Get core name.
158
-		$name = tx_dlf_helper::getIndexName($this->conf['solrcore'], 'tx_dlf_solrcores');
157
+        // Get core name.
158
+        $name = tx_dlf_helper::getIndexName($this->conf['solrcore'], 'tx_dlf_solrcores');
159 159
 
160
-		// Encrypt core name.
161
-		if (!empty($name)) {
160
+        // Encrypt core name.
161
+        if (!empty($name)) {
162 162
 
163
-			$name = tx_dlf_helper::encrypt($name);
163
+            $name = tx_dlf_helper::encrypt($name);
164 164
 
165
-		}
165
+        }
166 166
 
167
-		// Add encrypted fields to search form.
168
-		if (is_array($name)) {
167
+        // Add encrypted fields to search form.
168
+        if (is_array($name)) {
169 169
 
170
-			return '<input type="hidden" name="'.$this->prefixId.'[encrypted]" value="'.$name['encrypted'].'" /><input type="hidden" name="'.$this->prefixId.'[hashed]" value="'.$name['hash'].'" />';
170
+            return '<input type="hidden" name="'.$this->prefixId.'[encrypted]" value="'.$name['encrypted'].'" /><input type="hidden" name="'.$this->prefixId.'[hashed]" value="'.$name['hash'].'" />';
171 171
 
172
-		} else {
172
+        } else {
173 173
 
174
-			return '';
174
+            return '';
175 175
 
176
-		}
176
+        }
177 177
 
178
-	}
178
+    }
179 179
 
180
-	/**
181
-	 * Returns the extended search form and adds the JS files necessary for extended search.
182
-	 *
183
-	 * @access	protected
184
-	 *
185
-	 * @return	string		The extended search form or an empty string
186
-	 */
187
-	protected function addExtendedSearch() {
180
+    /**
181
+     * Returns the extended search form and adds the JS files necessary for extended search.
182
+     *
183
+     * @access	protected
184
+     *
185
+     * @return	string		The extended search form or an empty string
186
+     */
187
+    protected function addExtendedSearch() {
188 188
 
189
-		$extendedSearch = '';
189
+        $extendedSearch = '';
190 190
 
191
-		// Quit without doing anything if no fields for extended search are selected.
192
-		if (empty($this->conf['extendedSlotCount']) || empty($this->conf['extendedFields'])) {
191
+        // Quit without doing anything if no fields for extended search are selected.
192
+        if (empty($this->conf['extendedSlotCount']) || empty($this->conf['extendedFields'])) {
193 193
 
194
-			return $extendedSearch;
194
+            return $extendedSearch;
195 195
 
196
-		}
196
+        }
197 197
 
198
-		// Get operator options.
199
-		$operatorOptions = '';
198
+        // Get operator options.
199
+        $operatorOptions = '';
200 200
 
201
-		foreach (array ('AND', 'OR', 'NOT') as $operator) {
201
+        foreach (array ('AND', 'OR', 'NOT') as $operator) {
202 202
 
203
-			$operatorOptions .= '<option class="tx-dlf-search-operator-option tx-dlf-search-operator-'.$operator.'" value="'.$operator.'">'.$this->pi_getLL($operator, '', TRUE).'</option>';
203
+            $operatorOptions .= '<option class="tx-dlf-search-operator-option tx-dlf-search-operator-'.$operator.'" value="'.$operator.'">'.$this->pi_getLL($operator, '', TRUE).'</option>';
204 204
 
205
-		}
205
+        }
206 206
 
207
-		// Get field selector options.
208
-		$fieldSelectorOptions = '';
207
+        // Get field selector options.
208
+        $fieldSelectorOptions = '';
209 209
 
210
-		$searchFields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
210
+        $searchFields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
211 211
 
212
-		foreach ($searchFields as $searchField) {
212
+        foreach ($searchFields as $searchField) {
213 213
 
214
-			$fieldSelectorOptions .= '<option class="tx-dlf-search-field-option tx-dlf-search-field-'.$searchField.'" value="'.$searchField.'">'.tx_dlf_helper::translate($searchField, 'tx_dlf_metadata', $this->conf['pages']).'</option>';
214
+            $fieldSelectorOptions .= '<option class="tx-dlf-search-field-option tx-dlf-search-field-'.$searchField.'" value="'.$searchField.'">'.tx_dlf_helper::translate($searchField, 'tx_dlf_metadata', $this->conf['pages']).'</option>';
215 215
 
216
-		}
216
+        }
217 217
 
218
-		for ($i = 0; $i < $this->conf['extendedSlotCount']; $i++) {
218
+        for ($i = 0; $i < $this->conf['extendedSlotCount']; $i++) {
219 219
 
220
-			$markerArray = array (
221
-				'###EXT_SEARCH_OPERATOR###' => '<select class="tx-dlf-search-operator tx-dlf-search-operator-'.$i.'" name="'.$this->prefixId.'[extOperator]['.$i.']">'.$operatorOptions.'</select>',
222
-				'###EXT_SEARCH_FIELDSELECTOR###' => '<select class="tx-dlf-search-field tx-dlf-search-field-'.$i.'" name="'.$this->prefixId.'[extField]['.$i.']">'.$fieldSelectorOptions.'</select>',
223
-				'###EXT_SEARCH_FIELDQUERY###' => '<input class="tx-dlf-search-query tx-dlf-search-query-'.$i.'" type="text" name="'.$this->prefixId.'[extQuery]['.$i.']" />'
224
-			);
220
+            $markerArray = array (
221
+                '###EXT_SEARCH_OPERATOR###' => '<select class="tx-dlf-search-operator tx-dlf-search-operator-'.$i.'" name="'.$this->prefixId.'[extOperator]['.$i.']">'.$operatorOptions.'</select>',
222
+                '###EXT_SEARCH_FIELDSELECTOR###' => '<select class="tx-dlf-search-field tx-dlf-search-field-'.$i.'" name="'.$this->prefixId.'[extField]['.$i.']">'.$fieldSelectorOptions.'</select>',
223
+                '###EXT_SEARCH_FIELDQUERY###' => '<input class="tx-dlf-search-query tx-dlf-search-query-'.$i.'" type="text" name="'.$this->prefixId.'[extQuery]['.$i.']" />'
224
+            );
225 225
 
226
-			$extendedSearch .= $this->cObj->substituteMarkerArray($this->cObj->getSubpart($this->template, '###EXT_SEARCH_ENTRY###'), $markerArray);
226
+            $extendedSearch .= $this->cObj->substituteMarkerArray($this->cObj->getSubpart($this->template, '###EXT_SEARCH_ENTRY###'), $markerArray);
227 227
 
228
-		}
228
+        }
229 229
 
230
-		return $extendedSearch;
230
+        return $extendedSearch;
231 231
 
232
-	}
232
+    }
233 233
 
234
-	/**
235
-	 * Adds the facets menu to the search form
236
-	 *
237
-	 * @access	protected
238
-	 *
239
-	 * @return	string		HTML output of facets menu
240
-	 */
241
-	protected function addFacetsMenu() {
234
+    /**
235
+     * Adds the facets menu to the search form
236
+     *
237
+     * @access	protected
238
+     *
239
+     * @return	string		HTML output of facets menu
240
+     */
241
+    protected function addFacetsMenu() {
242 242
 
243
-		// Check for typoscript configuration to prevent fatal error.
244
-		if (empty($this->conf['facetsConf.'])) {
243
+        // Check for typoscript configuration to prevent fatal error.
244
+        if (empty($this->conf['facetsConf.'])) {
245 245
 
246
-			if (TYPO3_DLOG) {
246
+            if (TYPO3_DLOG) {
247 247
 
248
-				\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->addFacetsMenu()] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING);
248
+                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->addFacetsMenu()] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING);
249 249
 
250
-			}
250
+            }
251 251
 
252
-			return '';
252
+            return '';
253 253
 
254
-		}
254
+        }
255 255
 
256
-		// Quit without doing anything if no facets are selected.
257
-		if (empty($this->conf['facets'])) {
256
+        // Quit without doing anything if no facets are selected.
257
+        if (empty($this->conf['facets'])) {
258 258
 
259
-			return '';
259
+            return '';
260 260
 
261
-		}
261
+        }
262 262
 
263
-		// Get facets from plugin configuration.
264
-		$facets = array ();
263
+        // Get facets from plugin configuration.
264
+        $facets = array ();
265 265
 
266
-		foreach (\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['facets'], TRUE) as $facet) {
266
+        foreach (\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['facets'], TRUE) as $facet) {
267 267
 
268
-			$facets[$facet.'_faceting'] = tx_dlf_helper::translate($facet, 'tx_dlf_metadata', $this->conf['pages']);
268
+            $facets[$facet.'_faceting'] = tx_dlf_helper::translate($facet, 'tx_dlf_metadata', $this->conf['pages']);
269 269
 
270
-		}
270
+        }
271 271
 
272
-		// Render facets menu.
273
-		$TSconfig = array ();
272
+        // Render facets menu.
273
+        $TSconfig = array ();
274 274
 
275
-		$TSconfig['special'] = 'userfunction';
275
+        $TSconfig['special'] = 'userfunction';
276 276
 
277
-		$TSconfig['special.']['userFunc'] = 'tx_dlf_search->makeFacetsMenuArray';
277
+        $TSconfig['special.']['userFunc'] = 'tx_dlf_search->makeFacetsMenuArray';
278 278
 
279
-		$TSconfig['special.']['facets'] = $facets;
279
+        $TSconfig['special.']['facets'] = $facets;
280 280
 
281
-		$TSconfig['special.']['limit'] = max(intval($this->conf['limitFacets']), 1);
281
+        $TSconfig['special.']['limit'] = max(intval($this->conf['limitFacets']), 1);
282 282
 
283
-		$TSconfig = tx_dlf_helper::array_merge_recursive_overrule($this->conf['facetsConf.'], $TSconfig);
283
+        $TSconfig = tx_dlf_helper::array_merge_recursive_overrule($this->conf['facetsConf.'], $TSconfig);
284 284
 
285
-		return $this->cObj->HMENU($TSconfig);
285
+        return $this->cObj->HMENU($TSconfig);
286 286
 
287
-	}
287
+    }
288 288
 
289
-	/**
290
-	 * Adds the fulltext switch to the search form
291
-	 *
292
-	 * @access	protected
293
-	 *
294
-	 * @param int $isFulltextSearch
295
-	 *
296
-	 * @return	string		HTML output of fulltext switch
297
-	 */
298
-	protected function addFulltextSwitch($isFulltextSearch = 0) {
289
+    /**
290
+     * Adds the fulltext switch to the search form
291
+     *
292
+     * @access	protected
293
+     *
294
+     * @param int $isFulltextSearch
295
+     *
296
+     * @return	string		HTML output of fulltext switch
297
+     */
298
+    protected function addFulltextSwitch($isFulltextSearch = 0) {
299 299
 
300
-		$output = '';
300
+        $output = '';
301 301
 
302
-		// Check for plugin configuration.
303
-		if (!empty($this->conf['fulltext'])) {
302
+        // Check for plugin configuration.
303
+        if (!empty($this->conf['fulltext'])) {
304 304
 
305
-			$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"' : '') .' />';
305
+            $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"' : '') .' />';
306 306
 
307
-			$output .= ' <label for="tx-dlf-search-fulltext-no">' . $this->pi_getLL('label.inMetadata', '') . '</label>';
307
+            $output .= ' <label for="tx-dlf-search-fulltext-no">' . $this->pi_getLL('label.inMetadata', '') . '</label>';
308 308
 
309
-			$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"' : '') .'/>';
309
+            $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"' : '') .'/>';
310 310
 
311
-			$output .= ' <label for="tx-dlf-search-fulltext-yes">' . $this->pi_getLL('label.inFulltext', '') . '</label>';
311
+            $output .= ' <label for="tx-dlf-search-fulltext-yes">' . $this->pi_getLL('label.inFulltext', '') . '</label>';
312 312
 
313
-		}
313
+        }
314 314
 
315
-		return $output;
315
+        return $output;
316 316
 
317
-	}
317
+    }
318 318
 
319
-	/**
320
-	 * Adds the logical page field to the search form
321
-	 *
322
-	 * @access	protected
323
-	 *
324
-	 * @return	string		HTML output of logical page field
325
-	 */
326
-	protected function addLogicalPage() {
319
+    /**
320
+     * Adds the logical page field to the search form
321
+     *
322
+     * @access	protected
323
+     *
324
+     * @return	string		HTML output of logical page field
325
+     */
326
+    protected function addLogicalPage() {
327 327
 		
328
-		$output = '';
328
+        $output = '';
329 329
 
330
-		// Check for plugin configuration.
331
-		if (!empty($this->conf['showLogicalPageField'])) {
330
+        // Check for plugin configuration.
331
+        if (!empty($this->conf['showLogicalPageField'])) {
332 332
 			
333
-			$output .= ' <label for="tx-dlf-search-logical-page">' . $this->pi_getLL('label.logicalPage', '') . ': </label>';
333
+            $output .= ' <label for="tx-dlf-search-logical-page">' . $this->pi_getLL('label.logicalPage', '') . ': </label>';
334 334
 			
335
-			$output .= ' <input class="tx-dlf-search-logical-page" id="tx-dlf-search-logical-page" type="text" name="' . $this->prefixId . '[logicalPage]" />';
335
+            $output .= ' <input class="tx-dlf-search-logical-page" id="tx-dlf-search-logical-page" type="text" name="' . $this->prefixId . '[logicalPage]" />';
336 336
 			
337
-		}
337
+        }
338 338
 
339
-		return $output;
339
+        return $output;
340 340
 		
341
-	}
341
+    }
342 342
 
343
-	/**
344
-	 * Creates an array for a HMENU entry of a facet value.
345
-	 *
346
-	 * @param	string		$field: The facet's index_name
347
-	 * @param	string		$value: The facet's value
348
-	 * @param	integer		$count: Number of hits for this facet
349
-	 * @param	array		$search: The parameters of the current search query
350
-	 * @param	string		&$state: The state of the parent item
351
-	 *
352
-	 * @return	array		The array for the facet's menu entry
353
-	 */
354
-	protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) {
343
+    /**
344
+     * Creates an array for a HMENU entry of a facet value.
345
+     *
346
+     * @param	string		$field: The facet's index_name
347
+     * @param	string		$value: The facet's value
348
+     * @param	integer		$count: Number of hits for this facet
349
+     * @param	array		$search: The parameters of the current search query
350
+     * @param	string		&$state: The state of the parent item
351
+     *
352
+     * @return	array		The array for the facet's menu entry
353
+     */
354
+    protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) {
355 355
 
356
-		$entryArray = array();
356
+        $entryArray = array();
357 357
 
358
-		// Translate value.
359
-		if ($field == 'owner_faceting') {
358
+        // Translate value.
359
+        if ($field == 'owner_faceting') {
360 360
 
361
-			// Translate name of holding library.
362
-			$entryArray['title'] = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
361
+            // Translate name of holding library.
362
+            $entryArray['title'] = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
363 363
 
364
-		} elseif ($field == 'type_faceting') {
364
+        } elseif ($field == 'type_faceting') {
365 365
 
366
-			// Translate document type.
367
-			$entryArray['title'] = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
366
+            // Translate document type.
367
+            $entryArray['title'] = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
368 368
 
369
-		} elseif ($field == 'collection_faceting') {
369
+        } elseif ($field == 'collection_faceting') {
370 370
 
371
-			// Translate name of collection.
372
-			$entryArray['title'] = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_collections', $this->conf['pages']));
371
+            // Translate name of collection.
372
+            $entryArray['title'] = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_collections', $this->conf['pages']));
373 373
 
374
-		} elseif ($field == 'language_faceting') {
374
+        } elseif ($field == 'language_faceting') {
375 375
 
376
-			// Translate ISO 639 language code.
377
-			$entryArray['title'] = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
376
+            // Translate ISO 639 language code.
377
+            $entryArray['title'] = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
378 378
 
379
-		} else {
379
+        } else {
380 380
 
381
-			$entryArray['title'] = htmlspecialchars($value);
381
+            $entryArray['title'] = htmlspecialchars($value);
382 382
 
383
-		}
383
+        }
384 384
 
385
-		$entryArray['count'] = $count;
385
+        $entryArray['count'] = $count;
386 386
 
387
-		$entryArray['doNotLinkIt'] = 0;
387
+        $entryArray['doNotLinkIt'] = 0;
388 388
 
389
-		// Check if facet is already selected.
390
-		$index = array_search($field.':("'.tx_dlf_solr::escapeQuery($value).'")', $search['params']['fq']);
389
+        // Check if facet is already selected.
390
+        $index = array_search($field.':("'.tx_dlf_solr::escapeQuery($value).'")', $search['params']['fq']);
391 391
 
392
-		if ($index !== FALSE) {
392
+        if ($index !== FALSE) {
393 393
 
394
-			// Facet is selected, thus remove it from filter.
395
-			unset($search['params']['fq'][$index]);
394
+            // Facet is selected, thus remove it from filter.
395
+            unset($search['params']['fq'][$index]);
396 396
 
397
-			$search['params']['fq'] = array_values($search['params']['fq']);
397
+            $search['params']['fq'] = array_values($search['params']['fq']);
398 398
 
399
-			$entryArray['ITEM_STATE'] = 'CUR';
399
+            $entryArray['ITEM_STATE'] = 'CUR';
400 400
 
401
-			$state = 'ACTIFSUB';
401
+            $state = 'ACTIFSUB';
402 402
 
403
-			//Reset facets
404
-			if ($this->conf['resetFacets']) {
405
-				//remove ($count) for selected facet in template
406
-				$entryArray['count'] = FALSE;
407
-				//build link to delete selected facet
408
-				$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(array ('query' => $search['query'], 'fq' => $search['params']['fq']));
409
-				$entryArray['title'] = sprintf($this->pi_getLL('resetFacet', ''), $entryArray['title']);
410
-			}
403
+            //Reset facets
404
+            if ($this->conf['resetFacets']) {
405
+                //remove ($count) for selected facet in template
406
+                $entryArray['count'] = FALSE;
407
+                //build link to delete selected facet
408
+                $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(array ('query' => $search['query'], 'fq' => $search['params']['fq']));
409
+                $entryArray['title'] = sprintf($this->pi_getLL('resetFacet', ''), $entryArray['title']);
410
+            }
411 411
 
412
-		} else {
412
+        } else {
413 413
 
414
-			// Facet is not selected, thus add it to filter.
415
-			$search['params']['fq'][] = $field.':("'.tx_dlf_solr::escapeQuery($value).'")';
414
+            // Facet is not selected, thus add it to filter.
415
+            $search['params']['fq'][] = $field.':("'.tx_dlf_solr::escapeQuery($value).'")';
416 416
 
417
-			$entryArray['ITEM_STATE'] = 'NO';
417
+            $entryArray['ITEM_STATE'] = 'NO';
418 418
 
419
-		}
419
+        }
420 420
 
421
-		$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(array ('query' => $search['query'], 'fq' => $search['params']['fq']));
421
+        $entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(array ('query' => $search['query'], 'fq' => $search['params']['fq']));
422 422
 
423
-		return $entryArray;
423
+        return $entryArray;
424 424
 
425
-	}
425
+    }
426 426
 
427
-	/**
428
-	 * The main method of the PlugIn
429
-	 *
430
-	 * @access	public
431
-	 *
432
-	 * @param	string		$content: The PlugIn content
433
-	 * @param	array		$conf: The PlugIn configuration
434
-	 *
435
-	 * @return	string		The content that is displayed on the website
436
-	 */
437
-	public function main($content, $conf) {
427
+    /**
428
+     * The main method of the PlugIn
429
+     *
430
+     * @access	public
431
+     *
432
+     * @param	string		$content: The PlugIn content
433
+     * @param	array		$conf: The PlugIn configuration
434
+     *
435
+     * @return	string		The content that is displayed on the website
436
+     */
437
+    public function main($content, $conf) {
438 438
 
439
-		$this->init($conf);
439
+        $this->init($conf);
440 440
 
441
-		// Disable caching for this plugin.
442
-		$this->setCache(FALSE);
441
+        // Disable caching for this plugin.
442
+        $this->setCache(FALSE);
443 443
 
444
-		// Quit without doing anything if required variables are not set.
445
-		if (empty($this->conf['solrcore'])) {
444
+        // Quit without doing anything if required variables are not set.
445
+        if (empty($this->conf['solrcore'])) {
446 446
 
447
-			if (TYPO3_DLOG) {
447
+            if (TYPO3_DLOG) {
448 448
 
449
-				\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
449
+                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
450 450
 
451
-			}
451
+            }
452 452
 
453
-			return $content;
453
+            return $content;
454 454
 
455
-		}
455
+        }
456 456
 
457
-		if (!isset($this->piVars['query']) && empty($this->piVars['extQuery'])) {
457
+        if (!isset($this->piVars['query']) && empty($this->piVars['extQuery'])) {
458 458
 
459
-			// Extract query and filter from last search.
460
-			$list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
459
+            // Extract query and filter from last search.
460
+            $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
461 461
 
462
-			if (!empty($list->metadata['searchString'])) {
462
+            if (!empty($list->metadata['searchString'])) {
463 463
 
464
-				if ($list->metadata['options']['source'] == 'search') {
464
+                if ($list->metadata['options']['source'] == 'search') {
465 465
 
466
-					$search['query'] = $list->metadata['searchString'];
466
+                    $search['query'] = $list->metadata['searchString'];
467 467
 
468
-				}
468
+                }
469 469
 
470
-				$search['params'] = $list->metadata['options']['params'];
470
+                $search['params'] = $list->metadata['options']['params'];
471 471
 
472
-			}
472
+            }
473 473
 
474
-			// Add javascript for search suggestions if enabled and jQuery autocompletion is available.
475
-			if (!empty($this->conf['suggest'])) {
474
+            // Add javascript for search suggestions if enabled and jQuery autocompletion is available.
475
+            if (!empty($this->conf['suggest'])) {
476 476
 
477
-				$this->addAutocompleteJS();
477
+                $this->addAutocompleteJS();
478 478
 
479
-			}
479
+            }
480 480
 
481
-			// Load template file.
482
-			if (!empty($this->conf['templateFile'])) {
481
+            // Load template file.
482
+            if (!empty($this->conf['templateFile'])) {
483 483
 
484
-				$this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
484
+                $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
485 485
 
486
-			} else {
486
+            } else {
487 487
 
488
-				$this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/search/template.tmpl'), '###TEMPLATE###');
488
+                $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/search/template.tmpl'), '###TEMPLATE###');
489 489
 
490
-			}
490
+            }
491 491
 
492
-			// Configure @action URL for form.
493
-			$linkConf = array (
494
-				'parameter' => $GLOBALS['TSFE']->id,
495
-				'forceAbsoluteUrl' => 1
496
-			);
492
+            // Configure @action URL for form.
493
+            $linkConf = array (
494
+                'parameter' => $GLOBALS['TSFE']->id,
495
+                'forceAbsoluteUrl' => 1
496
+            );
497 497
 
498
-			// Fill markers.
499
-			$markerArray = array (
500
-				'###ACTION_URL###' => $this->cObj->typoLink_URL($linkConf),
501
-				'###LABEL_QUERY###' => (!empty($search['query']) ? $search['query'] : $this->pi_getLL('label.query')),
502
-				'###LABEL_SUBMIT###' => $this->pi_getLL('label.submit'),
503
-				'###FIELD_QUERY###' => $this->prefixId.'[query]',
504
-				'###QUERY###' => (!empty($search['query']) ? $search['query'] : ''),
505
-				'###FULLTEXTSWITCH###' => $this->addFulltextSwitch($list->metadata['fulltextSearch']),
506
-				'###FIELD_DOC###' => ($this->conf['searchIn'] == 'document' || $this->conf['searchIn'] == 'all' ? $this->addCurrentDocument() : ''),
507
-				'###FIELD_COLL###' => ($this->conf['searchIn'] == 'collection' || $this->conf['searchIn'] == 'all' ? $this->addCurrentCollection() : ''),
508
-				'###ADDITIONAL_INPUTS###' => $this->addEncryptedCoreName(),
509
-				'###FACETS_MENU###' => $this->addFacetsMenu(),
510
-				'###LOGICAL_PAGE###' => $this->addLogicalPage()
511
-			);
498
+            // Fill markers.
499
+            $markerArray = array (
500
+                '###ACTION_URL###' => $this->cObj->typoLink_URL($linkConf),
501
+                '###LABEL_QUERY###' => (!empty($search['query']) ? $search['query'] : $this->pi_getLL('label.query')),
502
+                '###LABEL_SUBMIT###' => $this->pi_getLL('label.submit'),
503
+                '###FIELD_QUERY###' => $this->prefixId.'[query]',
504
+                '###QUERY###' => (!empty($search['query']) ? $search['query'] : ''),
505
+                '###FULLTEXTSWITCH###' => $this->addFulltextSwitch($list->metadata['fulltextSearch']),
506
+                '###FIELD_DOC###' => ($this->conf['searchIn'] == 'document' || $this->conf['searchIn'] == 'all' ? $this->addCurrentDocument() : ''),
507
+                '###FIELD_COLL###' => ($this->conf['searchIn'] == 'collection' || $this->conf['searchIn'] == 'all' ? $this->addCurrentCollection() : ''),
508
+                '###ADDITIONAL_INPUTS###' => $this->addEncryptedCoreName(),
509
+                '###FACETS_MENU###' => $this->addFacetsMenu(),
510
+                '###LOGICAL_PAGE###' => $this->addLogicalPage()
511
+            );
512 512
 
513
-			// Get additional fields for extended search.
514
-			$extendedSearch = $this->addExtendedSearch();
513
+            // Get additional fields for extended search.
514
+            $extendedSearch = $this->addExtendedSearch();
515 515
 
516
-			// Display search form.
517
-			$content .= $this->cObj->substituteSubpart($this->cObj->substituteMarkerArray($this->template, $markerArray), '###EXT_SEARCH_ENTRY###', $extendedSearch);
516
+            // Display search form.
517
+            $content .= $this->cObj->substituteSubpart($this->cObj->substituteMarkerArray($this->template, $markerArray), '###EXT_SEARCH_ENTRY###', $extendedSearch);
518 518
 
519
-			return $this->pi_wrapInBaseClass($content);
519
+            return $this->pi_wrapInBaseClass($content);
520 520
 
521
-		} else {
521
+        } else {
522 522
 
523
-			// Instantiate search object.
524
-			$solr = tx_dlf_solr::getInstance($this->conf['solrcore']);
523
+            // Instantiate search object.
524
+            $solr = tx_dlf_solr::getInstance($this->conf['solrcore']);
525 525
 
526
-			if (!$solr->ready) {
526
+            if (!$solr->ready) {
527 527
 
528
-				if (TYPO3_DLOG) {
528
+                if (TYPO3_DLOG) {
529 529
 
530
-					\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->main('.$content.', [data])] Apache Solr not available', $this->extKey, SYSLOG_SEVERITY_ERROR, $conf);
530
+                    \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->main('.$content.', [data])] Apache Solr not available', $this->extKey, SYSLOG_SEVERITY_ERROR, $conf);
531 531
 
532
-				}
532
+                }
533 533
 
534
-				return $content;
534
+                return $content;
535 535
 
536
-			}
536
+            }
537 537
 
538
-			// Build label for result list.
539
-			$label = $this->pi_getLL('search', '', TRUE);
538
+            // Build label for result list.
539
+            $label = $this->pi_getLL('search', '', TRUE);
540 540
 
541
-			if (!empty($this->piVars['query'])) {
541
+            if (!empty($this->piVars['query'])) {
542 542
 
543
-				$label .= htmlspecialchars(sprintf($this->pi_getLL('for', ''), $this->piVars['query']));
543
+                $label .= htmlspecialchars(sprintf($this->pi_getLL('for', ''), $this->piVars['query']));
544 544
 
545
-			}
545
+            }
546 546
 
547
-			// Prepare query parameters.
548
-			$params = array ();
547
+            // Prepare query parameters.
548
+            $params = array ();
549 549
 
550
-			$matches = array ();
550
+            $matches = array ();
551 551
 
552
-			// Set search query.
553
-			if ((!empty($this->conf['fulltext']) && !empty($this->piVars['fulltext'])) || preg_match('/fulltext:\((.*)\)/', $this->piVars['query'], $matches)) {
552
+            // Set search query.
553
+            if ((!empty($this->conf['fulltext']) && !empty($this->piVars['fulltext'])) || preg_match('/fulltext:\((.*)\)/', $this->piVars['query'], $matches)) {
554 554
 
555
-				// If the query already is a fulltext query e.g using the facets
556
-				$this->piVars['query'] = empty($matches[1])?$this->piVars['query']:$matches[1];
555
+                // If the query already is a fulltext query e.g using the facets
556
+                $this->piVars['query'] = empty($matches[1])?$this->piVars['query']:$matches[1];
557 557
 
558
-				// Search in fulltext field if applicable. query must not be empty!
559
-				if (!empty($this->piVars['query'])) {
558
+                // Search in fulltext field if applicable. query must not be empty!
559
+                if (!empty($this->piVars['query'])) {
560 560
 
561
-					$query = 'fulltext:('.tx_dlf_solr::escapeQuery($this->piVars['query']).')';
561
+                    $query = 'fulltext:('.tx_dlf_solr::escapeQuery($this->piVars['query']).')';
562 562
 
563
-				}
563
+                }
564 564
 
565
-				// Add highlighting for fulltext.
566
-				$params['hl'] = 'true';
565
+                // Add highlighting for fulltext.
566
+                $params['hl'] = 'true';
567 567
 
568
-				$params['hl.fl'] = 'fulltext';
568
+                $params['hl.fl'] = 'fulltext';
569 569
 
570
-			} else {
571
-				// Retain given search field if valid.
572
-				$query = tx_dlf_solr::escapeQueryKeepField($this->piVars['query'], $this->conf['pages']);
570
+            } else {
571
+                // Retain given search field if valid.
572
+                $query = tx_dlf_solr::escapeQueryKeepField($this->piVars['query'], $this->conf['pages']);
573 573
 
574
-			}
574
+            }
575 575
 
576
-			// Add extended search query.
577
-			if (!empty($this->piVars['extQuery']) && is_array($this->piVars['extQuery'])) {
576
+            // Add extended search query.
577
+            if (!empty($this->piVars['extQuery']) && is_array($this->piVars['extQuery'])) {
578 578
 
579
-				$allowedOperators = array('AND', 'OR', 'NOT');
579
+                $allowedOperators = array('AND', 'OR', 'NOT');
580 580
 
581
-				$allowedFields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
581
+                $allowedFields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
582 582
 
583
-				for ($i = 0; $i < count($this->piVars['extQuery']); $i++) {
583
+                for ($i = 0; $i < count($this->piVars['extQuery']); $i++) {
584 584
 
585
-					if (!empty($this->piVars['extQuery'][$i])) {
585
+                    if (!empty($this->piVars['extQuery'][$i])) {
586 586
 
587
-						if (in_array($this->piVars['extOperator'][$i], $allowedOperators) && in_array($this->piVars['extField'][$i], $allowedFields)) {
587
+                        if (in_array($this->piVars['extOperator'][$i], $allowedOperators) && in_array($this->piVars['extField'][$i], $allowedFields)) {
588 588
 
589
-							if (!empty($query)) {
589
+                            if (!empty($query)) {
590 590
 
591
-								$query .= ' '.$this->piVars['extOperator'][$i].' ';
591
+                                $query .= ' '.$this->piVars['extOperator'][$i].' ';
592 592
 
593
-							}
593
+                            }
594 594
 
595
-							$query .= tx_dlf_indexing::getIndexFieldName($this->piVars['extField'][$i], $this->conf['pages']).':('.tx_dlf_solr::escapeQuery($this->piVars['extQuery'][$i]).')';
595
+                            $query .= tx_dlf_indexing::getIndexFieldName($this->piVars['extField'][$i], $this->conf['pages']).':('.tx_dlf_solr::escapeQuery($this->piVars['extQuery'][$i]).')';
596 596
 
597
-						}
597
+                        }
598 598
 
599
-					}
599
+                    }
600 600
 
601
-				}
601
+                }
602 602
 
603
-			}
603
+            }
604 604
 
605
-			// Add filter query for faceting.
606
-			if (!empty($this->piVars['fq'])) {
605
+            // Add filter query for faceting.
606
+            if (!empty($this->piVars['fq'])) {
607 607
 
608
-				$params['fq'] = $this->piVars['fq'];
608
+                $params['fq'] = $this->piVars['fq'];
609 609
 
610
-			}
610
+            }
611 611
 
612
-			// Add filter query for in-document searching.
613
-			if ($this->conf['searchIn'] == 'document' || $this->conf['searchIn'] == 'all') {
612
+            // Add filter query for in-document searching.
613
+            if ($this->conf['searchIn'] == 'document' || $this->conf['searchIn'] == 'all') {
614 614
 
615
-				if (!empty($this->piVars['id']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['id'])) {
615
+                if (!empty($this->piVars['id']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['id'])) {
616 616
 
617
-					$params['fq'][] = 'uid:('.$this->piVars['id'].') OR partof:('.$this->piVars['id'].')';
617
+                    $params['fq'][] = 'uid:('.$this->piVars['id'].') OR partof:('.$this->piVars['id'].')';
618 618
 
619
-					$label .= htmlspecialchars(sprintf($this->pi_getLL('in', ''), tx_dlf_document::getTitle($this->piVars['id'])));
619
+                    $label .= htmlspecialchars(sprintf($this->pi_getLL('in', ''), tx_dlf_document::getTitle($this->piVars['id'])));
620 620
 
621
-				}
621
+                }
622 622
 
623
-			}
623
+            }
624 624
 
625
-			// Add filter query for in-collection searching.
626
-			if ($this->conf['searchIn'] == 'collection' || $this->conf['searchIn'] == 'all') {
625
+            // Add filter query for in-collection searching.
626
+            if ($this->conf['searchIn'] == 'collection' || $this->conf['searchIn'] == 'all') {
627 627
 
628
-				if (!empty($this->piVars['collection']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['collection'])) {
628
+                if (!empty($this->piVars['collection']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['collection'])) {
629 629
 
630
-					$index_name = tx_dlf_helper::getIndexName($this->piVars['collection'], 'tx_dlf_collections', $this->conf['pages']);
630
+                    $index_name = tx_dlf_helper::getIndexName($this->piVars['collection'], 'tx_dlf_collections', $this->conf['pages']);
631 631
 
632
-					$params['fq'][] = 'collection_faceting:("'.tx_dlf_solr::escapeQuery($index_name).'")';
632
+                    $params['fq'][] = 'collection_faceting:("'.tx_dlf_solr::escapeQuery($index_name).'")';
633 633
 
634
-					$label .= sprintf($this->pi_getLL('in', '', TRUE), tx_dlf_helper::translate($index_name, 'tx_dlf_collections', $this->conf['pages']));
634
+                    $label .= sprintf($this->pi_getLL('in', '', TRUE), tx_dlf_helper::translate($index_name, 'tx_dlf_collections', $this->conf['pages']));
635 635
 
636
-				}
636
+                }
637 637
 
638
-			}
638
+            }
639 639
 
640
-			// Add filter query for collection restrictions.
641
-			if ($this->conf['collections']) {
640
+            // Add filter query for collection restrictions.
641
+            if ($this->conf['collections']) {
642 642
 
643
-				$collIds = explode(',', $this->conf['collections']);
643
+                $collIds = explode(',', $this->conf['collections']);
644 644
 
645
-				$collIndexNames = array ();
645
+                $collIndexNames = array ();
646 646
 
647
-				foreach ($collIds as $collId) {
647
+                foreach ($collIds as $collId) {
648 648
 
649
-					$collIndexNames[] = tx_dlf_solr::escapeQuery(tx_dlf_helper::getIndexName(intval($collId), 'tx_dlf_collections', $this->conf['pages']));
649
+                    $collIndexNames[] = tx_dlf_solr::escapeQuery(tx_dlf_helper::getIndexName(intval($collId), 'tx_dlf_collections', $this->conf['pages']));
650 650
 
651
-				}
651
+                }
652 652
 
653
-				// Last value is fake and used for distinction in $this->addCurrentCollection()
654
-				$params['fq'][] = 'collection_faceting:("'.implode('" OR "', $collIndexNames).'" OR "FakeValueForDistinction")';
653
+                // Last value is fake and used for distinction in $this->addCurrentCollection()
654
+                $params['fq'][] = 'collection_faceting:("'.implode('" OR "', $collIndexNames).'" OR "FakeValueForDistinction")';
655 655
 
656
-			}
656
+            }
657 657
 
658
-			// Set search parameters.
659
-			$solr->limit = max(intval($this->conf['limit']), 1);
658
+            // Set search parameters.
659
+            $solr->limit = max(intval($this->conf['limit']), 1);
660 660
 
661
-			$solr->cPid = $this->conf['pages'];
661
+            $solr->cPid = $this->conf['pages'];
662 662
 
663
-			$solr->params = $params;
663
+            $solr->params = $params;
664 664
 
665
-			// Perform search.
666
-			$results = $solr->search($query);
665
+            // Perform search.
666
+            $results = $solr->search($query);
667 667
 
668
-			$results->metadata = array (
669
-				'label' => $label,
670
-				'description' => '<p class="tx-dlf-search-numHits">'.htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $solr->numberOfHits, count($results))).'</p>',
671
-				'thumbnail' => '',
672
-				'searchString' => $this->piVars['query'],
673
-				'fulltextSearch' => (!empty($this->piVars['fulltext']) ? '1' : '0'),
674
-				'options' => $results->metadata['options']
675
-			);
668
+            $results->metadata = array (
669
+                'label' => $label,
670
+                'description' => '<p class="tx-dlf-search-numHits">'.htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $solr->numberOfHits, count($results))).'</p>',
671
+                'thumbnail' => '',
672
+                'searchString' => $this->piVars['query'],
673
+                'fulltextSearch' => (!empty($this->piVars['fulltext']) ? '1' : '0'),
674
+                'options' => $results->metadata['options']
675
+            );
676 676
 
677
-			$results->save();
677
+            $results->save();
678 678
 
679
-			// Clean output buffer.
680
-			\TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
679
+            // Clean output buffer.
680
+            \TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
681 681
 
682
-			$additionalParams = array();
682
+            $additionalParams = array();
683 683
 
684
-			if(!empty($this->piVars['logicalPage'])) {
684
+            if(!empty($this->piVars['logicalPage'])) {
685 685
 
686
-				$additionalParams['logicalPage'] = $this->piVars['logicalPage'];
686
+                $additionalParams['logicalPage'] = $this->piVars['logicalPage'];
687 687
 
688
-			}
688
+            }
689 689
 
690
-			// Jump directly to the page view, if there is only one result and it is configured
691
-			if($results->count() == 1 && !empty($this->conf['showSingleResult'])) {
690
+            // Jump directly to the page view, if there is only one result and it is configured
691
+            if($results->count() == 1 && !empty($this->conf['showSingleResult'])) {
692 692
 
693
-				$linkConf['parameter'] = $this->conf['targetPidPageView'];
693
+                $linkConf['parameter'] = $this->conf['targetPidPageView'];
694 694
 
695
-				$additionalParams['id'] = $results->current()['uid'];
696
-				$additionalParams['highlight_word'] = preg_replace('/\s\s+/', ';', $results->metadata['searchString']);
697
-				$additionalParams['page'] = count($results[0]['subparts']) == 1?$results[0]['subparts'][0]['page']:1;
695
+                $additionalParams['id'] = $results->current()['uid'];
696
+                $additionalParams['highlight_word'] = preg_replace('/\s\s+/', ';', $results->metadata['searchString']);
697
+                $additionalParams['page'] = count($results[0]['subparts']) == 1?$results[0]['subparts'][0]['page']:1;
698 698
 
699
-			} else {
699
+            } else {
700 700
 
701
-				// Keep some plugin variables.
702
-				$linkConf['parameter'] = $this->conf['targetPid'];
701
+                // Keep some plugin variables.
702
+                $linkConf['parameter'] = $this->conf['targetPid'];
703 703
 
704
-				if (!empty($this->piVars['order'])) {
704
+                if (!empty($this->piVars['order'])) {
705 705
 
706
-					$additionalParams['order'] = $this->piVars['order'];
707
-					$additionalParams['asc'] = !empty($this->piVars['asc']) ? '1' : '0';
706
+                    $additionalParams['order'] = $this->piVars['order'];
707
+                    $additionalParams['asc'] = !empty($this->piVars['asc']) ? '1' : '0';
708 708
 
709
-				}
709
+                }
710 710
 
711
-			}
711
+            }
712 712
 
713
-			$linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE);
713
+            $linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE);
714 714
 
715
-			// Send headers.
716
-			header('Location: '.\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkConf)));
715
+            // Send headers.
716
+            header('Location: '.\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkConf)));
717 717
 
718
-			// Flush output buffer and end script processing.
719
-			ob_end_flush();
718
+            // Flush output buffer and end script processing.
719
+            ob_end_flush();
720 720
 
721
-			exit;
721
+            exit;
722 722
 
723
-		}
723
+        }
724 724
 
725
-	}
725
+    }
726 726
 
727
-	/**
728
-	 * This builds a menu array for HMENU
729
-	 *
730
-	 * @access	public
731
-	 *
732
-	 * @param	string		$content: The PlugIn content
733
-	 * @param	array		$conf: The PlugIn configuration
734
-	 *
735
-	 * @return	array		HMENU array
736
-	 */
737
-	public function makeFacetsMenuArray($content, $conf) {
727
+    /**
728
+     * This builds a menu array for HMENU
729
+     *
730
+     * @access	public
731
+     *
732
+     * @param	string		$content: The PlugIn content
733
+     * @param	array		$conf: The PlugIn configuration
734
+     *
735
+     * @return	array		HMENU array
736
+     */
737
+    public function makeFacetsMenuArray($content, $conf) {
738 738
 
739
-		$this->init($conf);
739
+        $this->init($conf);
740 740
 
741
-		$menuArray = array ();
741
+        $menuArray = array ();
742 742
 
743
-		// Set default value for facet search.
744
-		$search = array (
745
-			'query' => '*',
746
-			'params' => array ()
747
-		);
743
+        // Set default value for facet search.
744
+        $search = array (
745
+            'query' => '*',
746
+            'params' => array ()
747
+        );
748 748
 
749
-		// Extract query and filter from last search.
750
-		$list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
749
+        // Extract query and filter from last search.
750
+        $list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list');
751 751
 
752
-		if (!empty($list->metadata['options']['source'])) {
752
+        if (!empty($list->metadata['options']['source'])) {
753 753
 
754
-			if ($list->metadata['options']['source'] == 'search') {
754
+            if ($list->metadata['options']['source'] == 'search') {
755 755
 
756
-				$search['query'] = $list->metadata['options']['select'];
756
+                $search['query'] = $list->metadata['options']['select'];
757 757
 
758
-			}
758
+            }
759 759
 
760
-			$search['params'] = $list->metadata['options']['params'];
760
+            $search['params'] = $list->metadata['options']['params'];
761 761
 
762
-		}
762
+        }
763 763
 
764
-		// Get applicable facets.
765
-		$solr = tx_dlf_solr::getInstance($this->conf['solrcore']);
764
+        // Get applicable facets.
765
+        $solr = tx_dlf_solr::getInstance($this->conf['solrcore']);
766 766
 
767
-		if (!$solr->ready) {
767
+        if (!$solr->ready) {
768 768
 
769
-			if (TYPO3_DLOG) {
769
+            if (TYPO3_DLOG) {
770 770
 
771
-				\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->makeFacetsMenuArray('.$content.', [data])] Apache Solr not available', $this->extKey, SYSLOG_SEVERITY_ERROR, $conf);
771
+                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_search->makeFacetsMenuArray('.$content.', [data])] Apache Solr not available', $this->extKey, SYSLOG_SEVERITY_ERROR, $conf);
772 772
 
773
-			}
773
+            }
774 774
 
775
-			return array ();
775
+            return array ();
776 776
 
777
-		}
777
+        }
778 778
 
779
-		// Set needed parameters for facet search.
780
-		if (empty($search['params']['fq'])) {
779
+        // Set needed parameters for facet search.
780
+        if (empty($search['params']['fq'])) {
781 781
 
782
-			$search['params']['fq'] = array ();
782
+            $search['params']['fq'] = array ();
783 783
 
784
-		}
784
+        }
785 785
 
786
-		$search['params']['facet'] = 'true';
786
+        $search['params']['facet'] = 'true';
787 787
 
788
-		$search['params']['facet.field'] = array_keys($this->conf['facets']);
788
+        $search['params']['facet.field'] = array_keys($this->conf['facets']);
789 789
 
790
-		//override SOLR default value for facet.limit of 100
791
-		$search['params']['facet.limit'] = $this->conf['limitFacets'];
790
+        //override SOLR default value for facet.limit of 100
791
+        $search['params']['facet.limit'] = $this->conf['limitFacets'];
792 792
 
793
-		// Perform search.
794
-		$results = $solr->service->search($search['query'], 0, $this->conf['limit'], $search['params']);
793
+        // Perform search.
794
+        $results = $solr->service->search($search['query'], 0, $this->conf['limit'], $search['params']);
795 795
 
796
-		// Process results.
797
-		foreach ($results->facet_counts->facet_fields as $field => $values) {
796
+        // Process results.
797
+        foreach ($results->facet_counts->facet_fields as $field => $values) {
798 798
 
799
-			$entryArray = array ();
799
+            $entryArray = array ();
800 800
 
801
-			$entryArray['title'] = htmlspecialchars($this->conf['facets'][$field]);
801
+            $entryArray['title'] = htmlspecialchars($this->conf['facets'][$field]);
802 802
 
803
-			$entryArray['count'] = 0;
803
+            $entryArray['count'] = 0;
804 804
 
805
-			$entryArray['_OVERRIDE_HREF'] = '';
805
+            $entryArray['_OVERRIDE_HREF'] = '';
806 806
 
807
-			$entryArray['doNotLinkIt'] = 1;
807
+            $entryArray['doNotLinkIt'] = 1;
808 808
 
809
-			$entryArray['ITEM_STATE'] = 'NO';
809
+            $entryArray['ITEM_STATE'] = 'NO';
810 810
 
811
-			// Count number of facet values.
812
-			$i = 0;
811
+            // Count number of facet values.
812
+            $i = 0;
813 813
 
814
-			foreach ($values as $value => $count) {
814
+            foreach ($values as $value => $count) {
815 815
 
816
-				if ($count > 0) {
816
+                if ($count > 0) {
817 817
 
818
-					$hasValue = TRUE;
818
+                    $hasValue = TRUE;
819 819
 
820
-					$entryArray['count']++;
820
+                    $entryArray['count']++;
821 821
 
822
-					if ($entryArray['ITEM_STATE'] == 'NO') {
822
+                    if ($entryArray['ITEM_STATE'] == 'NO') {
823 823
 
824
-						$entryArray['ITEM_STATE'] = 'IFSUB';
824
+                        $entryArray['ITEM_STATE'] = 'IFSUB';
825 825
 
826
-					}
826
+                    }
827 827
 
828
-					$entryArray['_SUB_MENU'][] = $this->getFacetsMenuEntry($field, $value, $count, $search, $entryArray['ITEM_STATE']);
828
+                    $entryArray['_SUB_MENU'][] = $this->getFacetsMenuEntry($field, $value, $count, $search, $entryArray['ITEM_STATE']);
829 829
 
830
-					if (++$i == $this->conf['limit']) {
830
+                    if (++$i == $this->conf['limit']) {
831 831
 
832
-						break;
832
+                        break;
833 833
 
834
-					}
834
+                    }
835 835
 
836
-				} else {
836
+                } else {
837 837
 
838
-					break;
838
+                    break;
839 839
 
840
-				}
840
+                }
841 841
 
842
-			}
842
+            }
843 843
 
844
-			$menuArray[] = $entryArray;
844
+            $menuArray[] = $entryArray;
845 845
 
846
-		}
846
+        }
847 847
 
848
-		return $menuArray;
848
+        return $menuArray;
849 849
 
850 850
 
851
-	}
851
+    }
852 852
 
853 853
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -302,13 +302,13 @@  discard block
 block discarded – undo
302 302
 		// Check for plugin configuration.
303 303
 		if (!empty($this->conf['fulltext'])) {
304 304
 
305
-			$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"' : '') .' />';
305
+			$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"' : '').' />';
306 306
 
307
-			$output .= ' <label for="tx-dlf-search-fulltext-no">' . $this->pi_getLL('label.inMetadata', '') . '</label>';
307
+			$output .= ' <label for="tx-dlf-search-fulltext-no">'.$this->pi_getLL('label.inMetadata', '').'</label>';
308 308
 
309
-			$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"' : '') .'/>';
309
+			$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"' : '').'/>';
310 310
 
311
-			$output .= ' <label for="tx-dlf-search-fulltext-yes">' . $this->pi_getLL('label.inFulltext', '') . '</label>';
311
+			$output .= ' <label for="tx-dlf-search-fulltext-yes">'.$this->pi_getLL('label.inFulltext', '').'</label>';
312 312
 
313 313
 		}
314 314
 
@@ -330,9 +330,9 @@  discard block
 block discarded – undo
330 330
 		// Check for plugin configuration.
331 331
 		if (!empty($this->conf['showLogicalPageField'])) {
332 332
 			
333
-			$output .= ' <label for="tx-dlf-search-logical-page">' . $this->pi_getLL('label.logicalPage', '') . ': </label>';
333
+			$output .= ' <label for="tx-dlf-search-logical-page">'.$this->pi_getLL('label.logicalPage', '').': </label>';
334 334
 			
335
-			$output .= ' <input class="tx-dlf-search-logical-page" id="tx-dlf-search-logical-page" type="text" name="' . $this->prefixId . '[logicalPage]" />';
335
+			$output .= ' <input class="tx-dlf-search-logical-page" id="tx-dlf-search-logical-page" type="text" name="'.$this->prefixId.'[logicalPage]" />';
336 336
 			
337 337
 		}
338 338
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	 */
354 354
 	protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) {
355 355
 
356
-		$entryArray = array();
356
+		$entryArray = array ();
357 357
 
358 358
 		// Translate value.
359 359
 		if ($field == 'owner_faceting') {
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 			if ((!empty($this->conf['fulltext']) && !empty($this->piVars['fulltext'])) || preg_match('/fulltext:\((.*)\)/', $this->piVars['query'], $matches)) {
554 554
 
555 555
 				// If the query already is a fulltext query e.g using the facets
556
-				$this->piVars['query'] = empty($matches[1])?$this->piVars['query']:$matches[1];
556
+				$this->piVars['query'] = empty($matches[1]) ? $this->piVars['query'] : $matches[1];
557 557
 
558 558
 				// Search in fulltext field if applicable. query must not be empty!
559 559
 				if (!empty($this->piVars['query'])) {
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			// Add extended search query.
577 577
 			if (!empty($this->piVars['extQuery']) && is_array($this->piVars['extQuery'])) {
578 578
 
579
-				$allowedOperators = array('AND', 'OR', 'NOT');
579
+				$allowedOperators = array ('AND', 'OR', 'NOT');
580 580
 
581 581
 				$allowedFields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
582 582
 
@@ -679,22 +679,22 @@  discard block
 block discarded – undo
679 679
 			// Clean output buffer.
680 680
 			\TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
681 681
 
682
-			$additionalParams = array();
682
+			$additionalParams = array ();
683 683
 
684
-			if(!empty($this->piVars['logicalPage'])) {
684
+			if (!empty($this->piVars['logicalPage'])) {
685 685
 
686 686
 				$additionalParams['logicalPage'] = $this->piVars['logicalPage'];
687 687
 
688 688
 			}
689 689
 
690 690
 			// Jump directly to the page view, if there is only one result and it is configured
691
-			if($results->count() == 1 && !empty($this->conf['showSingleResult'])) {
691
+			if ($results->count() == 1 && !empty($this->conf['showSingleResult'])) {
692 692
 
693 693
 				$linkConf['parameter'] = $this->conf['targetPidPageView'];
694 694
 
695 695
 				$additionalParams['id'] = $results->current()['uid'];
696 696
 				$additionalParams['highlight_word'] = preg_replace('/\s\s+/', ';', $results->metadata['searchString']);
697
-				$additionalParams['page'] = count($results[0]['subparts']) == 1?$results[0]['subparts'][0]['page']:1;
697
+				$additionalParams['page'] = count($results[0]['subparts']) == 1 ? $results[0]['subparts'][0]['page'] : 1;
698 698
 
699 699
 			} else {
700 700
 
Please login to merge, or discard this patch.
plugins/audioplayer/class.tx_dlf_audioplayer.php 2 patches
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -19,35 +19,35 @@  discard block
 block discarded – undo
19 19
  */
20 20
 class tx_dlf_audioplayer extends tx_dlf_plugin {
21 21
 
22
-	public $scriptRelPath = 'plugins/audioplayer/class.tx_dlf_audioplayer.php';
22
+    public $scriptRelPath = 'plugins/audioplayer/class.tx_dlf_audioplayer.php';
23 23
 
24
-	/**
25
-	 * Holds the current audio file's URL, MIME type and optional label
26
-	 *
27
-	 * @var	array
28
-	 * @access protected
29
-	 */
30
-	protected $audio = array ();
24
+    /**
25
+     * Holds the current audio file's URL, MIME type and optional label
26
+     *
27
+     * @var	array
28
+     * @access protected
29
+     */
30
+    protected $audio = array ();
31 31
 
32
-	/**
33
-	 * Adds Player javascript
34
-	 *
35
-	 * @access	protected
36
-	 *
37
-	 * @return	string		Player script tags ready for output
38
-	 */
39
-	protected function addPlayerJS() {
32
+    /**
33
+     * Adds Player javascript
34
+     *
35
+     * @access	protected
36
+     *
37
+     * @return	string		Player script tags ready for output
38
+     */
39
+    protected function addPlayerJS() {
40 40
 
41
-		$output = array ();
41
+        $output = array ();
42 42
 
43
-		$output[] = '<link type="text/css" rel="stylesheet" href="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/jPlayer/blue.monday/css/jplayer.blue.monday.min.css">';
43
+        $output[] = '<link type="text/css" rel="stylesheet" href="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/jPlayer/blue.monday/css/jplayer.blue.monday.min.css">';
44 44
 
45
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/jPlayer/jquery.jplayer.min.js"></script>';
45
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/jPlayer/jquery.jplayer.min.js"></script>';
46 46
 
47
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/audioplayer/js/tx_dlf_audioplayer.js"></script>';
47
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/audioplayer/js/tx_dlf_audioplayer.js"></script>';
48 48
 
49
-		// Add player configuration.
50
-		$output[] = '
49
+        // Add player configuration.
50
+        $output[] = '
51 51
 		<style>
52 52
 			#tx-dlf-audio { width: 100px; height: 100px };
53 53
 		</style>
@@ -65,87 +65,87 @@  discard block
 block discarded – undo
65 65
 			});
66 66
 		</script>';
67 67
 
68
-		return implode("\n", $output);
68
+        return implode("\n", $output);
69 69
 
70
-	}
70
+    }
71 71
 
72
-	/**
73
-	 * The main method of the PlugIn
74
-	 *
75
-	 * @access	public
76
-	 *
77
-	 * @param	string		$content: The PlugIn content
78
-	 * @param	array		$conf: The PlugIn configuration
79
-	 *
80
-	 * @return	string		The content that is displayed on the website
81
-	 */
82
-	public function main($content, $conf) {
72
+    /**
73
+     * The main method of the PlugIn
74
+     *
75
+     * @access	public
76
+     *
77
+     * @param	string		$content: The PlugIn content
78
+     * @param	array		$conf: The PlugIn configuration
79
+     *
80
+     * @return	string		The content that is displayed on the website
81
+     */
82
+    public function main($content, $conf) {
83 83
 
84
-		$this->init($conf);
84
+        $this->init($conf);
85 85
 
86
-		// Load current document.
87
-		$this->loadDocument();
86
+        // Load current document.
87
+        $this->loadDocument();
88 88
 
89
-		if ($this->doc === NULL || $this->doc->numPages < 1) {
89
+        if ($this->doc === NULL || $this->doc->numPages < 1) {
90 90
 
91
-			// Quit without doing anything if required variables are not set.
92
-			return $content;
91
+            // Quit without doing anything if required variables are not set.
92
+            return $content;
93 93
 
94
-		} else {
94
+        } else {
95 95
 
96
-			// Set default values if not set.
97
-			// $this->piVars['page'] may be integer or string (physical structure @ID)
98
-			if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) {
96
+            // Set default values if not set.
97
+            // $this->piVars['page'] may be integer or string (physical structure @ID)
98
+            if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) {
99 99
 
100
-				$this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1);
100
+                $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1);
101 101
 
102
-			} else {
102
+            } else {
103 103
 
104
-				$this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure);
104
+                $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure);
105 105
 
106
-			}
106
+            }
107 107
 
108
-			$this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0);
108
+            $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0);
109 109
 
110
-		}
110
+        }
111 111
 
112
-		// Check if there are any audio files available.
113
-		if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpAudio']])) {
112
+        // Check if there are any audio files available.
113
+        if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpAudio']])) {
114 114
 
115
-			// Get audio data.
116
-			$this->audio['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpAudio']]);
115
+            // Get audio data.
116
+            $this->audio['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpAudio']]);
117 117
 
118
-			$this->audio['label'] = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['label'];
118
+            $this->audio['label'] = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['label'];
119 119
 
120
-			$this->audio['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpAudio']]);
120
+            $this->audio['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpAudio']]);
121 121
 
122
-		} else {
122
+        } else {
123 123
 
124
-			// Quit without doing anything if required variables are not set.
125
-			return $content;
124
+            // Quit without doing anything if required variables are not set.
125
+            return $content;
126 126
 
127
-		}
127
+        }
128 128
 
129
-		// Load template file.
130
-		if (!empty($this->conf['templateFile'])) {
129
+        // Load template file.
130
+        if (!empty($this->conf['templateFile'])) {
131 131
 
132
-			$this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
132
+            $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
133 133
 
134
-		} else {
134
+        } else {
135 135
 
136
-			$this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/audioplayer/template.tmpl'), '###TEMPLATE###');
136
+            $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/audioplayer/template.tmpl'), '###TEMPLATE###');
137 137
 
138
-		}
138
+        }
139 139
 
140
-		// Fill in the template markers.
141
-		$markerArray = array (
142
-			'###PLAYER_JS###' => $this->addPlayerJS()
143
-		);
140
+        // Fill in the template markers.
141
+        $markerArray = array (
142
+            '###PLAYER_JS###' => $this->addPlayerJS()
143
+        );
144 144
 
145
-		$content .= $this->cObj->substituteMarkerArray($this->template, $markerArray);
145
+        $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray);
146 146
 
147
-		return $this->pi_wrapInBaseClass($content);
147
+        return $this->pi_wrapInBaseClass($content);
148 148
 
149
-	}
149
+    }
150 150
 
151 151
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@
 block discarded – undo
55 55
 			$(document).ready(function() {
56 56
 				tx_dlf_audioplayer = new dlfAudioPlayer({
57 57
 					audio: {
58
-						mimeType: "' . $this->audio['mimetype'] . '",
59
-						title: "' . $this->audio['label'] . '",
60
-						url:  "' . $this->audio['url'] . '"
58
+						mimeType: "' . $this->audio['mimetype'].'",
59
+						title: "' . $this->audio['label'].'",
60
+						url:  "' . $this->audio['url'].'"
61 61
 					},
62 62
 					parentElId: "tx-dlf-audio",
63 63
 					swfPath: "'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/jPlayer/jquery.jplayer.swf"
Please login to merge, or discard this patch.
plugins/statistics/class.tx_dlf_statistics.php 1 patch
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -19,111 +19,111 @@
 block discarded – undo
19 19
  */
20 20
 class tx_dlf_statistics extends tx_dlf_plugin {
21 21
 
22
-	public $scriptRelPath = 'plugins/statistics/class.tx_dlf_statistics.php';
23
-
24
-	/**
25
-	 * The main method of the PlugIn
26
-	 *
27
-	 * @access	public
28
-	 *
29
-	 * @param	string		$content: The PlugIn content
30
-	 * @param	array		$conf: The PlugIn configuration
31
-	 *
32
-	 * @return	string		The content that is displayed on the website
33
-	 */
34
-	public function main($content, $conf) {
35
-
36
-		$this->init($conf);
37
-
38
-		// Turn cache on.
39
-		$this->setCache(TRUE);
40
-
41
-		// Quit without doing anything if required configuration variables are not set.
42
-		if (empty($this->conf['pages'])) {
43
-
44
-			if (TYPO3_DLOG) {
45
-
46
-				\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_statistics->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
47
-
48
-			}
49
-
50
-			return $content;
51
-
52
-		}
53
-
54
-		// Get description.
55
-		$content .= $this->pi_RTEcssText($this->conf['description']);
56
-
57
-		// Check for selected collections.
58
-		if ($this->conf['collections']) {
59
-
60
-			// Include only selected collections.
61
-			$resultTitles = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
62
-				'tx_dlf_documents.uid AS uid',
63
-				'tx_dlf_documents',
64
-				'tx_dlf_relations',
65
-				'tx_dlf_collections',
66
-				'AND tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_documents.partof=0 AND tx_dlf_collections.uid IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).') AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
67
-				'tx_dlf_documents.uid',
68
-				'',
69
-				''
70
-			);
71
-
72
-			$resultVolumes = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
73
-				'tx_dlf_documents.uid AS uid',
74
-				'tx_dlf_documents',
75
-				'tx_dlf_relations',
76
-				'tx_dlf_collections',
77
-				'AND tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND NOT tx_dlf_documents.uid IN (SELECT DISTINCT tx_dlf_documents.partof FROM tx_dlf_documents WHERE NOT tx_dlf_documents.partof=0'.tx_dlf_helper::whereClause('tx_dlf_documents').') AND tx_dlf_collections.uid IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).') AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
78
-				'tx_dlf_documents.uid',
79
-				'',
80
-				''
81
-			);
82
-
83
-		} else {
84
-
85
-			// Include all collections.
86
-			$resultTitles = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
87
-				'tx_dlf_documents.uid AS uid',
88
-				'tx_dlf_documents',
89
-				'tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_documents.partof=0'.tx_dlf_helper::whereClause('tx_dlf_documents'),
90
-				'',
91
-				'',
92
-				''
93
-			);
94
-
95
-			$resultVolumes = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
96
-				'tx_dlf_documents.uid AS uid',
97
-				'tx_dlf_documents',
98
-				'tx_dlf_documents.pid='.intval($this->conf['pages']).' AND NOT tx_dlf_documents.uid IN (SELECT DISTINCT tx_dlf_documents.partof FROM tx_dlf_documents WHERE NOT tx_dlf_documents.partof=0'.tx_dlf_helper::whereClause('tx_dlf_documents').')'.tx_dlf_helper::whereClause('tx_dlf_documents'),
99
-				'',
100
-				'',
101
-				''
102
-			);
103
-
104
-		}
105
-
106
-		$countTitles = $GLOBALS['TYPO3_DB']->sql_num_rows($resultTitles);
107
-
108
-		$countVolumes = $GLOBALS['TYPO3_DB']->sql_num_rows($resultVolumes);
109
-
110
-		// Set replacements.
111
-		$replace = array (
112
-			'key' => array (
113
-				'###TITLES###',
114
-				'###VOLUMES###'
115
-			),
116
-			'value' => array (
117
-				$countTitles.($countTitles > 1 ? $this->pi_getLL('titles', '', TRUE) : $this->pi_getLL('title', '', TRUE)),
118
-				$countVolumes.($countVolumes > 1 ? $this->pi_getLL('volumes', '', TRUE) : $this->pi_getLL('volume', '', TRUE))
119
-			)
120
-		);
121
-
122
-		// Apply replacements.
123
-		$content = str_replace($replace['key'], $replace['value'], $content);
124
-
125
-		return $this->pi_wrapInBaseClass($content);
126
-
127
-	}
22
+    public $scriptRelPath = 'plugins/statistics/class.tx_dlf_statistics.php';
23
+
24
+    /**
25
+     * The main method of the PlugIn
26
+     *
27
+     * @access	public
28
+     *
29
+     * @param	string		$content: The PlugIn content
30
+     * @param	array		$conf: The PlugIn configuration
31
+     *
32
+     * @return	string		The content that is displayed on the website
33
+     */
34
+    public function main($content, $conf) {
35
+
36
+        $this->init($conf);
37
+
38
+        // Turn cache on.
39
+        $this->setCache(TRUE);
40
+
41
+        // Quit without doing anything if required configuration variables are not set.
42
+        if (empty($this->conf['pages'])) {
43
+
44
+            if (TYPO3_DLOG) {
45
+
46
+                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_statistics->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
47
+
48
+            }
49
+
50
+            return $content;
51
+
52
+        }
53
+
54
+        // Get description.
55
+        $content .= $this->pi_RTEcssText($this->conf['description']);
56
+
57
+        // Check for selected collections.
58
+        if ($this->conf['collections']) {
59
+
60
+            // Include only selected collections.
61
+            $resultTitles = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
62
+                'tx_dlf_documents.uid AS uid',
63
+                'tx_dlf_documents',
64
+                'tx_dlf_relations',
65
+                'tx_dlf_collections',
66
+                'AND tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_documents.partof=0 AND tx_dlf_collections.uid IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).') AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
67
+                'tx_dlf_documents.uid',
68
+                '',
69
+                ''
70
+            );
71
+
72
+            $resultVolumes = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
73
+                'tx_dlf_documents.uid AS uid',
74
+                'tx_dlf_documents',
75
+                'tx_dlf_relations',
76
+                'tx_dlf_collections',
77
+                'AND tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.pid='.intval($this->conf['pages']).' AND NOT tx_dlf_documents.uid IN (SELECT DISTINCT tx_dlf_documents.partof FROM tx_dlf_documents WHERE NOT tx_dlf_documents.partof=0'.tx_dlf_helper::whereClause('tx_dlf_documents').') AND tx_dlf_collections.uid IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).') AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
78
+                'tx_dlf_documents.uid',
79
+                '',
80
+                ''
81
+            );
82
+
83
+        } else {
84
+
85
+            // Include all collections.
86
+            $resultTitles = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
87
+                'tx_dlf_documents.uid AS uid',
88
+                'tx_dlf_documents',
89
+                'tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_documents.partof=0'.tx_dlf_helper::whereClause('tx_dlf_documents'),
90
+                '',
91
+                '',
92
+                ''
93
+            );
94
+
95
+            $resultVolumes = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
96
+                'tx_dlf_documents.uid AS uid',
97
+                'tx_dlf_documents',
98
+                'tx_dlf_documents.pid='.intval($this->conf['pages']).' AND NOT tx_dlf_documents.uid IN (SELECT DISTINCT tx_dlf_documents.partof FROM tx_dlf_documents WHERE NOT tx_dlf_documents.partof=0'.tx_dlf_helper::whereClause('tx_dlf_documents').')'.tx_dlf_helper::whereClause('tx_dlf_documents'),
99
+                '',
100
+                '',
101
+                ''
102
+            );
103
+
104
+        }
105
+
106
+        $countTitles = $GLOBALS['TYPO3_DB']->sql_num_rows($resultTitles);
107
+
108
+        $countVolumes = $GLOBALS['TYPO3_DB']->sql_num_rows($resultVolumes);
109
+
110
+        // Set replacements.
111
+        $replace = array (
112
+            'key' => array (
113
+                '###TITLES###',
114
+                '###VOLUMES###'
115
+            ),
116
+            'value' => array (
117
+                $countTitles.($countTitles > 1 ? $this->pi_getLL('titles', '', TRUE) : $this->pi_getLL('title', '', TRUE)),
118
+                $countVolumes.($countVolumes > 1 ? $this->pi_getLL('volumes', '', TRUE) : $this->pi_getLL('volume', '', TRUE))
119
+            )
120
+        );
121
+
122
+        // Apply replacements.
123
+        $content = str_replace($replace['key'], $replace['value'], $content);
124
+
125
+        return $this->pi_wrapInBaseClass($content);
126
+
127
+    }
128 128
 
129 129
 }
Please login to merge, or discard this patch.
plugins/pageview/class.tx_dlf_geturl_eid.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -22,65 +22,65 @@
 block discarded – undo
22 22
  */
23 23
 class tx_dlf_geturl_eid extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
24 24
 
25
-	/**
26
-	 *
27
-	 */
28
-	public $cObj;
25
+    /**
26
+     *
27
+     */
28
+    public $cObj;
29 29
 
30 30
 
31
-	/**
32
-	 * The main method of the eID-Script
33
-	 *
34
-	 * @access	public
35
-	 *
36
-	 * @param	string		$content: The PlugIn content
37
-	 * @param	array		$conf: The PlugIn configuration
38
-	 *
39
-	 * @return	void
40
-	 */
41
-	public function main($content = '', $conf = array ()) {
31
+    /**
32
+     * The main method of the eID-Script
33
+     *
34
+     * @access	public
35
+     *
36
+     * @param	string		$content: The PlugIn content
37
+     * @param	array		$conf: The PlugIn configuration
38
+     *
39
+     * @return	void
40
+     */
41
+    public function main($content = '', $conf = array ()) {
42 42
 
43
-		$this->cObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
43
+        $this->cObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
44 44
 
45
-		$this->extKey = 'dlf';
45
+        $this->extKey = 'dlf';
46 46
 
47
-		$this->scriptRelPath = 'plugins/pageview/class.tx_dlf_geturl_eid.php';
47
+        $this->scriptRelPath = 'plugins/pageview/class.tx_dlf_geturl_eid.php';
48 48
 
49
-		$url = GeneralUtility::_GP('url');
49
+        $url = GeneralUtility::_GP('url');
50 50
     $includeHeader = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(GeneralUtility::_GP('header'), 0, 2, 0);
51 51
 
52
-		// first we fetch header separately
53
-		$fetchedHeader = GeneralUtility::getUrl($url, 2);
52
+        // first we fetch header separately
53
+        $fetchedHeader = GeneralUtility::getUrl($url, 2);
54 54
 
55
-		if ($includeHeader == 0) {
55
+        if ($includeHeader == 0) {
56 56
 
57
-			$fetchedData = GeneralUtility::getUrl($url, $includeHeader);
57
+            $fetchedData = GeneralUtility::getUrl($url, $includeHeader);
58 58
 
59
-		} else {
59
+        } else {
60 60
 
61
-			$fetchedData = $fetchedHeader;
61
+            $fetchedData = $fetchedHeader;
62 62
 
63
-		}
63
+        }
64 64
 
65
-		// add some self calculated header tags
66
-		header('Last-Modified: ' . gmdate( "D, d M Y H:i:s" ) . 'GMT');
67
-		header('Cache-Control: max-age=3600, must-revalidate');
68
-		header('Content-Length: '.strlen($fetchedData));
69
-		$fi = finfo_open(FILEINFO_MIME);
70
-		header('Content-Type: ' . finfo_buffer($fi, $fetchedData));
65
+        // add some self calculated header tags
66
+        header('Last-Modified: ' . gmdate( "D, d M Y H:i:s" ) . 'GMT');
67
+        header('Cache-Control: max-age=3600, must-revalidate');
68
+        header('Content-Length: '.strlen($fetchedData));
69
+        $fi = finfo_open(FILEINFO_MIME);
70
+        header('Content-Type: ' . finfo_buffer($fi, $fetchedData));
71 71
 
72
-		// take some tags from request header and overwrite in case already set
73
-		$fetchedHeader = explode("\n", GeneralUtility::getUrl($url, 2));
72
+        // take some tags from request header and overwrite in case already set
73
+        $fetchedHeader = explode("\n", GeneralUtility::getUrl($url, 2));
74 74
 
75
-		foreach ($fetchedHeader as $headerline) {
76
-			if (stripos($headerline, 'Last-Modified:') !== FALSE) {
77
-				header($headerline);
78
-			}
79
-		}
75
+        foreach ($fetchedHeader as $headerline) {
76
+            if (stripos($headerline, 'Last-Modified:') !== FALSE) {
77
+                header($headerline);
78
+            }
79
+        }
80 80
 
81
-		echo $fetchedData;
81
+        echo $fetchedData;
82 82
 
83
-	}
83
+    }
84 84
 
85 85
 }
86 86
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,11 +63,11 @@
 block discarded – undo
63 63
 		}
64 64
 
65 65
 		// add some self calculated header tags
66
-		header('Last-Modified: ' . gmdate( "D, d M Y H:i:s" ) . 'GMT');
66
+		header('Last-Modified: '.gmdate("D, d M Y H:i:s").'GMT');
67 67
 		header('Cache-Control: max-age=3600, must-revalidate');
68 68
 		header('Content-Length: '.strlen($fetchedData));
69 69
 		$fi = finfo_open(FILEINFO_MIME);
70
-		header('Content-Type: ' . finfo_buffer($fi, $fetchedData));
70
+		header('Content-Type: '.finfo_buffer($fi, $fetchedData));
71 71
 
72 72
 		// take some tags from request header and overwrite in case already set
73 73
 		$fetchedHeader = explode("\n", GeneralUtility::getUrl($url, 2));
Please login to merge, or discard this patch.
plugins/pageview/class.tx_dlf_pageview.php 3 patches
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -19,69 +19,69 @@  discard block
 block discarded – undo
19 19
  */
20 20
 class tx_dlf_pageview extends tx_dlf_plugin {
21 21
 
22
-	public $scriptRelPath = 'plugins/pageview/class.tx_dlf_pageview.php';
22
+    public $scriptRelPath = 'plugins/pageview/class.tx_dlf_pageview.php';
23 23
 
24
-	/**
25
-	 * Holds the controls to add to the map
26
-	 *
27
-	 * @var	array
28
-	 * @access protected
29
-	 */
30
-	protected $controls = array ();
24
+    /**
25
+     * Holds the controls to add to the map
26
+     *
27
+     * @var	array
28
+     * @access protected
29
+     */
30
+    protected $controls = array ();
31 31
 
32
-	/**
33
-	 * Holds the current images' URLs and MIME types
34
-	 *
35
-	 * @var	array
36
-	 * @access protected
37
-	 */
38
-	protected $images = array ();
32
+    /**
33
+     * Holds the current images' URLs and MIME types
34
+     *
35
+     * @var	array
36
+     * @access protected
37
+     */
38
+    protected $images = array ();
39 39
 
40
-	/**
41
-	 * Holds the current fulltexts' URLs
42
-	 *
43
-	 * @var	array
44
-	 * @access protected
45
-	 */
46
-	protected $fulltexts = array ();
40
+    /**
41
+     * Holds the current fulltexts' URLs
42
+     *
43
+     * @var	array
44
+     * @access protected
45
+     */
46
+    protected $fulltexts = array ();
47 47
 
48
-	/**
49
-	 * Adds Viewer javascript
50
-	 *
51
-	 * @access	protected
52
-	 *
53
-	 * @return	string		Viewer script tags ready for output
54
-	 */
55
-	protected function addViewerJS() {
48
+    /**
49
+     * Adds Viewer javascript
50
+     *
51
+     * @access	protected
52
+     *
53
+     * @return	string		Viewer script tags ready for output
54
+     */
55
+    protected function addViewerJS() {
56 56
 
57
-		$output = array ();
57
+        $output = array ();
58 58
 
59
-		// Add OpenLayers library.
60
-		$output[] = '<link type="text/css" rel="stylesheet" href="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/OpenLayers/ol3.css">';
59
+        // Add OpenLayers library.
60
+        $output[] = '<link type="text/css" rel="stylesheet" href="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/OpenLayers/ol3.css">';
61 61
 
62
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/OpenLayers/glif.min.js"></script>';
62
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/OpenLayers/glif.min.js"></script>';
63 63
 
64
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/OpenLayers/ol3-dlf.js"></script>';
64
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'lib/OpenLayers/ol3-dlf.js"></script>';
65 65
 
66
-		// Add viewer library.
67
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_utils.js"></script>';
66
+        // Add viewer library.
67
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_utils.js"></script>';
68 68
 
69
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_ol3.js"></script>';
69
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_ol3.js"></script>';
70 70
 
71
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_ol3_styles.js"></script>';
71
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_ol3_styles.js"></script>';
72 72
 
73
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_ol3_source.js"></script>';
73
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_ol3_source.js"></script>';
74 74
 
75
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_altoparser.js"></script>';
75
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_altoparser.js"></script>';
76 76
 
77
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_pageview_imagemanipulation_control.js"></script>';
77
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_pageview_imagemanipulation_control.js"></script>';
78 78
 
79
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_pageview_fulltext_control.js"></script>';
79
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_pageview_fulltext_control.js"></script>';
80 80
 
81
-		$output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_pageview.js"></script>';
81
+        $output[] = '<script type="text/javascript" src="'.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'plugins/pageview/tx_dlf_pageview.js"></script>';
82 82
 
83
-		// Add viewer configuration.
84
-		$output[] = '
83
+        // Add viewer configuration.
84
+        $output[] = '
85 85
 		<script id="tx-dlf-pageview-initViewer" type="text/javascript">
86 86
 			window.onload = function() {
87 87
 				if (dlfUtils.exists(dlfViewer)) {
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 			}
97 97
 		</script>';
98 98
 
99
-		return implode("\n", $output);
99
+        return implode("\n", $output);
100 100
 
101
-	}
101
+    }
102 102
 
103
-	/**
103
+    /**
104 104
      * Adds pageview interaction (crop, magnifier and rotation)
105 105
      *
106 106
      * @access	protected
@@ -225,183 +225,183 @@  discard block
 block discarded – undo
225 225
 
226 226
     /**
227 227
      * Get image's URL and MIME type
228
-	 *
229
-	 * @access	protected
230
-	 *
231
-	 * @param	integer		$page: Page number
232
-	 *
233
-	 * @return	array		URL and MIME type of image file
234
-	 */
235
-	protected function getImage($page) {
228
+     *
229
+     * @access	protected
230
+     *
231
+     * @param	integer		$page: Page number
232
+     *
233
+     * @return	array		URL and MIME type of image file
234
+     */
235
+    protected function getImage($page) {
236 236
 
237
-		$image = array ();
237
+        $image = array ();
238 238
 
239
-		// Get @USE value of METS fileGrp.
240
-		$fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrps']);
239
+        // Get @USE value of METS fileGrp.
240
+        $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrps']);
241 241
 
242
-		while ($fileGrp = @array_pop($fileGrps)) {
242
+        while ($fileGrp = @array_pop($fileGrps)) {
243 243
 
244
-			// Get image link.
245
-			if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp])) {
244
+            // Get image link.
245
+            if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp])) {
246 246
 
247
-				$image['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]);
247
+                $image['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]);
248 248
 
249
-				if ($this->conf['useInternalProxy']) {
250
-					// Configure @action URL for form.
251
-					$linkConf = array (
252
-						'parameter' => $GLOBALS['TSFE']->id,
253
-						'additionalParams' => '&eID=tx_dlf_geturl_eid&url='.urlencode($image['url']),
254
-					);
249
+                if ($this->conf['useInternalProxy']) {
250
+                    // Configure @action URL for form.
251
+                    $linkConf = array (
252
+                        'parameter' => $GLOBALS['TSFE']->id,
253
+                        'additionalParams' => '&eID=tx_dlf_geturl_eid&url='.urlencode($image['url']),
254
+                    );
255 255
 
256
-					$image['url'] = $this->cObj->typoLink_URL($linkConf);
257
-				}
256
+                    $image['url'] = $this->cObj->typoLink_URL($linkConf);
257
+                }
258 258
 
259
-				$image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]);
259
+                $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp]);
260 260
 
261
-				break;
261
+                break;
262 262
 
263
-			} else {
263
+            } else {
264 264
 
265
-				if (TYPO3_DLOG) {
265
+                if (TYPO3_DLOG) {
266 266
 
267
-					\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_pageview->getImage('.$page.')] File not found in fileGrp "'.$fileGrp.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
267
+                    \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_pageview->getImage('.$page.')] File not found in fileGrp "'.$fileGrp.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
268 268
 
269
-				}
269
+                }
270 270
 
271
-			}
271
+            }
272 272
 
273
-		}
273
+        }
274 274
 
275
-		return $image;
275
+        return $image;
276 276
 
277
-	}
277
+    }
278 278
 
279
-	/**
280
-	 * Get fulltext URL and MIME type
281
-	 *
282
-	 * @access	protected
283
-	 *
284
-	 * @param	integer		$page: Page number
285
-	 *
286
-	 * @return	array		URL and MIME type of fulltext file
287
-	 */
288
-	protected function getFulltext($page) {
279
+    /**
280
+     * Get fulltext URL and MIME type
281
+     *
282
+     * @access	protected
283
+     *
284
+     * @param	integer		$page: Page number
285
+     *
286
+     * @return	array		URL and MIME type of fulltext file
287
+     */
288
+    protected function getFulltext($page) {
289 289
 
290
-		$fulltext = array ();
290
+        $fulltext = array ();
291 291
 
292
-		// Get fulltext link.
293
-		if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']])) {
292
+        // Get fulltext link.
293
+        if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']])) {
294 294
 
295
-			$fulltext['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']]);
295
+            $fulltext['url'] = $this->doc->getFileLocation($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']]);
296 296
 
297
-			// Configure @action URL for form.
298
-			$linkConf = array (
299
-				'parameter' => $GLOBALS['TSFE']->id,
300
-				'additionalParams' => '&eID=tx_dlf_geturl_eid&url='.urlencode($fulltext['url']),
301
-			);
297
+            // Configure @action URL for form.
298
+            $linkConf = array (
299
+                'parameter' => $GLOBALS['TSFE']->id,
300
+                'additionalParams' => '&eID=tx_dlf_geturl_eid&url='.urlencode($fulltext['url']),
301
+            );
302 302
 
303
-			$fulltext['url'] = $this->cObj->typoLink_URL($linkConf);
303
+            $fulltext['url'] = $this->cObj->typoLink_URL($linkConf);
304 304
 
305
-			$fulltext['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']]);
305
+            $fulltext['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$this->conf['fileGrpFulltext']]);
306 306
 
307
-		} else {
307
+        } else {
308 308
 
309
-			if (TYPO3_DLOG) {
309
+            if (TYPO3_DLOG) {
310 310
 
311
-				\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_pageview->getFulltext('.$page.')] File not found in fileGrp "'.$this->conf['fileGrpFulltext'].'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
311
+                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_pageview->getFulltext('.$page.')] File not found in fileGrp "'.$this->conf['fileGrpFulltext'].'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
312 312
 
313
-			}
313
+            }
314 314
 
315
-		}
315
+        }
316 316
 
317
-		return $fulltext;
317
+        return $fulltext;
318 318
 
319
-	}
319
+    }
320 320
 
321
-	/**
322
-	 * The main method of the PlugIn
323
-	 *
324
-	 * @access	public
325
-	 *
326
-	 * @param	string		$content: The PlugIn content
327
-	 * @param	array		$conf: The PlugIn configuration
328
-	 *
329
-	 * @return	string		The content that is displayed on the website
330
-	 */
331
-	public function main($content, $conf) {
321
+    /**
322
+     * The main method of the PlugIn
323
+     *
324
+     * @access	public
325
+     *
326
+     * @param	string		$content: The PlugIn content
327
+     * @param	array		$conf: The PlugIn configuration
328
+     *
329
+     * @return	string		The content that is displayed on the website
330
+     */
331
+    public function main($content, $conf) {
332 332
 
333
-		$this->init($conf);
333
+        $this->init($conf);
334 334
 
335
-		// Load current document.
336
-		$this->loadDocument();
335
+        // Load current document.
336
+        $this->loadDocument();
337 337
 
338
-		if ($this->doc === NULL || $this->doc->numPages < 1) {
338
+        if ($this->doc === NULL || $this->doc->numPages < 1) {
339 339
 
340
-			// Quit without doing anything if required variables are not set.
341
-			return $content;
340
+            // Quit without doing anything if required variables are not set.
341
+            return $content;
342 342
 
343
-		} else {
343
+        } else {
344 344
 
345
-			if (!empty($this->piVars['logicalPage'])) {
345
+            if (!empty($this->piVars['logicalPage'])) {
346 346
 
347
-				$this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']);
348
-				// The logical page parameter should not appear again
349
-				unset($this->piVars['logicalPage']);
347
+                $this->piVars['page'] = $this->doc->getPhysicalPage($this->piVars['logicalPage']);
348
+                // The logical page parameter should not appear again
349
+                unset($this->piVars['logicalPage']);
350 350
 
351
-			}
351
+            }
352 352
 
353
-			// Set default values if not set.
354
-			// $this->piVars['page'] may be integer or string (physical structure @ID)
355
-			if ( (int)$this->piVars['page'] > 0 || empty($this->piVars['page'])) {
353
+            // Set default values if not set.
354
+            // $this->piVars['page'] may be integer or string (physical structure @ID)
355
+            if ( (int)$this->piVars['page'] > 0 || empty($this->piVars['page'])) {
356 356
 
357
-				$this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int)$this->piVars['page'], 1, $this->doc->numPages, 1);
357
+                $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int)$this->piVars['page'], 1, $this->doc->numPages, 1);
358 358
 
359
-			} else {
359
+            } else {
360 360
 
361
-				$this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure);
361
+                $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalStructure);
362 362
 
363
-			}
363
+            }
364 364
 
365
-			$this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0);
365
+            $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0);
366 366
 
367
-		}
367
+        }
368 368
 
369
-		// Load template file.
370
-		if (!empty($this->conf['templateFile'])) {
369
+        // Load template file.
370
+        if (!empty($this->conf['templateFile'])) {
371 371
 
372
-			$this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
372
+            $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
373 373
 
374
-		} else {
374
+        } else {
375 375
 
376
-			$this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/pageview/template.tmpl'), '###TEMPLATE###');
376
+            $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/pageview/template.tmpl'), '###TEMPLATE###');
377 377
 
378
-		}
378
+        }
379 379
 
380
-		// Get image data.
381
-		$this->images[0] = $this->getImage($this->piVars['page']);
382
-		$this->fulltexts[0] = $this->getFulltext($this->piVars['page']);
380
+        // Get image data.
381
+        $this->images[0] = $this->getImage($this->piVars['page']);
382
+        $this->fulltexts[0] = $this->getFulltext($this->piVars['page']);
383 383
 
384
-		if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) {
384
+        if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) {
385 385
 
386
-			$this->images[1] = $this->getImage($this->piVars['page'] + 1);
387
-			$this->fulltexts[1] = $this->getFulltext($this->piVars['page'] + 1);
386
+            $this->images[1] = $this->getImage($this->piVars['page'] + 1);
387
+            $this->fulltexts[1] = $this->getFulltext($this->piVars['page'] + 1);
388 388
 
389
-		}
389
+        }
390 390
 
391
-		// Get the controls for the map.
392
-		$this->controls = explode(',', $this->conf['features']);
391
+        // Get the controls for the map.
392
+        $this->controls = explode(',', $this->conf['features']);
393 393
 
394
-		// Fill in the template markers.
395
-		$markerArray = array (
396
-			'###VIEWER_JS###' => $this->addViewerJS()
397
-		);
394
+        // Fill in the template markers.
395
+        $markerArray = array (
396
+            '###VIEWER_JS###' => $this->addViewerJS()
397
+        );
398 398
 
399
-		$markerArray = array_merge($markerArray, $this->addInteraction(), $this->addBasketForm());
399
+        $markerArray = array_merge($markerArray, $this->addInteraction(), $this->addBasketForm());
400 400
 
401 401
         $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray);
402 402
 
403
-		return $this->pi_wrapInBaseClass($content);
403
+        return $this->pi_wrapInBaseClass($content);
404 404
 
405
-	}
405
+    }
406 406
 
407 407
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
 			window.onload = function() {
87 87
 				if (dlfUtils.exists(dlfViewer)) {
88 88
 					tx_dlf_viewer = new dlfViewer({
89
-						controls: ["' . implode('", "', $this->controls) . '"],
90
-						div: "' . $this->conf['elementId'] . '",
91
-						images: ' . json_encode($this->images) . ',
92
-						fulltexts: '. json_encode($this->fulltexts) . ',
93
-						useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0) .'
89
+						controls: ["' . implode('", "', $this->controls).'"],
90
+						div: "' . $this->conf['elementId'].'",
91
+						images: ' . json_encode($this->images).',
92
+						fulltexts: '. json_encode($this->fulltexts).',
93
+						useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0).'
94 94
 					})
95 95
 				}
96 96
 			}
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     protected function addInteraction() {
111 111
 
112
-        $markerArray = array();
112
+        $markerArray = array ();
113 113
 
114 114
         if ($this->piVars['id']) {
115 115
 
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
      */
158 158
     protected function addBasketForm() {
159 159
 
160
-        $markerArray = array();
160
+        $markerArray = array ();
161 161
 
162 162
         // Add basket button
163 163
         if ($this->conf['basketButton'] && $this->conf['targetBasket'] && $this->piVars['id']) {
164 164
 
165 165
             $label = $this->pi_getLL('addBasket', '', TRUE);
166 166
 
167
-            $params = array(
167
+            $params = array (
168 168
                 'id' => $this->piVars['id'],
169 169
                 'addToBasket' => true
170 170
             );
@@ -344,9 +344,9 @@  discard block
 block discarded – undo
344 344
 
345 345
 			// Set default values if not set.
346 346
 			// $this->piVars['page'] may be integer or string (physical structure @ID)
347
-			if ( (int)$this->piVars['page'] > 0 || empty($this->piVars['page'])) {
347
+			if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) {
348 348
 
349
-				$this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int)$this->piVars['page'], 1, $this->doc->numPages, 1);
349
+				$this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1);
350 350
 
351 351
 			} else {
352 352
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
 
167 167
             $params = array(
168 168
                 'id' => $this->piVars['id'],
169
-                'addToBasket' => true
169
+                'addToBasket' => TRUE
170 170
             );
171 171
 
172 172
             if (empty($this->piVars['page'])) {
Please login to merge, or discard this patch.
plugins/feeds/class.tx_dlf_feeds.php 1 patch
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -19,210 +19,210 @@
 block discarded – undo
19 19
  */
20 20
 class tx_dlf_feeds extends tx_dlf_plugin {
21 21
 
22
-	public $scriptRelPath = 'plugins/feeds/class.tx_dlf_feeds.php';
22
+    public $scriptRelPath = 'plugins/feeds/class.tx_dlf_feeds.php';
23 23
 
24
-	/**
25
-	 * The main method of the PlugIn
26
-	 *
27
-	 * @access	public
28
-	 *
29
-	 * @param	string		$content: The PlugIn content
30
-	 * @param	array		$conf: The PlugIn configuration
31
-	 *
32
-	 * @return	void
33
-	 */
34
-	public function main($content, $conf) {
24
+    /**
25
+     * The main method of the PlugIn
26
+     *
27
+     * @access	public
28
+     *
29
+     * @param	string		$content: The PlugIn content
30
+     * @param	array		$conf: The PlugIn configuration
31
+     *
32
+     * @return	void
33
+     */
34
+    public function main($content, $conf) {
35 35
 
36
-		$this->init($conf);
36
+        $this->init($conf);
37 37
 
38
-		// Don't cache the output.
39
-		$this->setCache(FALSE);
38
+        // Don't cache the output.
39
+        $this->setCache(FALSE);
40 40
 
41
-		// Create XML document.
42
-		$rss = new DOMDocument('1.0', 'utf-8');
41
+        // Create XML document.
42
+        $rss = new DOMDocument('1.0', 'utf-8');
43 43
 
44
-		// Add mandatory root element.
45
-		$root = $rss->createElement('rss');
44
+        // Add mandatory root element.
45
+        $root = $rss->createElement('rss');
46 46
 
47
-		$root->setAttribute('version', '2.0');
47
+        $root->setAttribute('version', '2.0');
48 48
 
49
-		// Add channel element.
50
-		$channel = $rss->createElement('channel');
49
+        // Add channel element.
50
+        $channel = $rss->createElement('channel');
51 51
 
52
-		$channel->appendChild($rss->createElement('title', htmlspecialchars($this->conf['title'], ENT_NOQUOTES, 'UTF-8')));
52
+        $channel->appendChild($rss->createElement('title', htmlspecialchars($this->conf['title'], ENT_NOQUOTES, 'UTF-8')));
53 53
 
54
-		$channel->appendChild($rss->createElement('link', htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->pi_linkTP_keepPIvars_url()), ENT_NOQUOTES, 'UTF-8')));
54
+        $channel->appendChild($rss->createElement('link', htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->pi_linkTP_keepPIvars_url()), ENT_NOQUOTES, 'UTF-8')));
55 55
 
56
-		if (!empty($this->conf['description'])) {
56
+        if (!empty($this->conf['description'])) {
57 57
 
58
-			$channel->appendChild($rss->createElement('description', htmlspecialchars($this->conf['description'], ENT_QUOTES, 'UTF-8')));
58
+            $channel->appendChild($rss->createElement('description', htmlspecialchars($this->conf['description'], ENT_QUOTES, 'UTF-8')));
59 59
 
60
-		}
60
+        }
61 61
 
62
-		$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
63
-			'tx_dlf_libraries.label AS label',
64
-			'tx_dlf_libraries',
65
-			'tx_dlf_libraries.pid='.intval($this->conf['pages']).' AND tx_dlf_libraries.uid='.intval($this->conf['library']).tx_dlf_helper::whereClause('tx_dlf_libraries'),
66
-			'',
67
-			'',
68
-			'1'
69
-		);
62
+        $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
63
+            'tx_dlf_libraries.label AS label',
64
+            'tx_dlf_libraries',
65
+            'tx_dlf_libraries.pid='.intval($this->conf['pages']).' AND tx_dlf_libraries.uid='.intval($this->conf['library']).tx_dlf_helper::whereClause('tx_dlf_libraries'),
66
+            '',
67
+            '',
68
+            '1'
69
+        );
70 70
 
71
-		if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
71
+        if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
72 72
 
73
-			$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
73
+            $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
74 74
 
75
-			$channel->appendChild($rss->createElement('copyright', htmlspecialchars($resArray['label'], ENT_NOQUOTES, 'UTF-8')));
75
+            $channel->appendChild($rss->createElement('copyright', htmlspecialchars($resArray['label'], ENT_NOQUOTES, 'UTF-8')));
76 76
 
77
-		}
77
+        }
78 78
 
79
-		$channel->appendChild($rss->createElement('pubDate', date('r', $GLOBALS['EXEC_TIME'])));
79
+        $channel->appendChild($rss->createElement('pubDate', date('r', $GLOBALS['EXEC_TIME'])));
80 80
 
81
-		$channel->appendChild($rss->createElement('generator', htmlspecialchars($this->conf['useragent'], ENT_NOQUOTES, 'UTF-8')));
81
+        $channel->appendChild($rss->createElement('generator', htmlspecialchars($this->conf['useragent'], ENT_NOQUOTES, 'UTF-8')));
82 82
 
83
-		// Add item elements.
84
-		if (!$this->conf['excludeOther'] || empty($this->piVars['collection']) || \TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->conf['collections'], $this->piVars['collection'])) {
83
+        // Add item elements.
84
+        if (!$this->conf['excludeOther'] || empty($this->piVars['collection']) || \TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->conf['collections'], $this->piVars['collection'])) {
85 85
 
86
-			$additionalWhere = '';
86
+            $additionalWhere = '';
87 87
 
88
-			// Check for pre-selected collections.
89
-			if (!empty($this->piVars['collection'])) {
88
+            // Check for pre-selected collections.
89
+            if (!empty($this->piVars['collection'])) {
90 90
 
91
-				$additionalWhere = ' AND tx_dlf_collections.uid='.intval($this->piVars['collection']);
91
+                $additionalWhere = ' AND tx_dlf_collections.uid='.intval($this->piVars['collection']);
92 92
 
93
-			} elseif (!empty($this->conf['collections'])) {
93
+            } elseif (!empty($this->conf['collections'])) {
94 94
 
95
-				$additionalWhere = ' AND tx_dlf_collections.uid IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).')';
95
+                $additionalWhere = ' AND tx_dlf_collections.uid IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($this->conf['collections']).')';
96 96
 
97
-			}
97
+            }
98 98
 
99
-			$result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
100
-				'tx_dlf_documents.uid AS uid,tx_dlf_documents.partof AS partof,tx_dlf_documents.title AS title,tx_dlf_documents.volume AS volume,tx_dlf_documents.author AS author,tx_dlf_documents.record_id AS guid,tx_dlf_documents.tstamp AS tstamp,tx_dlf_documents.crdate AS crdate',
101
-				'tx_dlf_documents',
102
-				'tx_dlf_relations',
103
-				'tx_dlf_collections',
104
-				'AND tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').' AND tx_dlf_collections.pid='.intval($this->conf['pages']).$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
105
-				'tx_dlf_documents.uid',
106
-				'tx_dlf_documents.tstamp DESC',
107
-				intval($this->conf['limit'])
108
-			);
99
+            $result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
100
+                'tx_dlf_documents.uid AS uid,tx_dlf_documents.partof AS partof,tx_dlf_documents.title AS title,tx_dlf_documents.volume AS volume,tx_dlf_documents.author AS author,tx_dlf_documents.record_id AS guid,tx_dlf_documents.tstamp AS tstamp,tx_dlf_documents.crdate AS crdate',
101
+                'tx_dlf_documents',
102
+                'tx_dlf_relations',
103
+                'tx_dlf_collections',
104
+                'AND tx_dlf_documents.pid='.intval($this->conf['pages']).' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').' AND tx_dlf_collections.pid='.intval($this->conf['pages']).$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'),
105
+                'tx_dlf_documents.uid',
106
+                'tx_dlf_documents.tstamp DESC',
107
+                intval($this->conf['limit'])
108
+            );
109 109
 
110
-			if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
110
+            if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
111 111
 
112
-				// Add each record as item element.
113
-				while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
112
+                // Add each record as item element.
113
+                while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
114 114
 
115
-					$item = $rss->createElement('item');
115
+                    $item = $rss->createElement('item');
116 116
 
117
-					$title = '';
117
+                    $title = '';
118 118
 
119
-					// Get title of superior document.
120
-					if ((empty($resArray['title']) || !empty($this->conf['prependSuperiorTitle'])) && !empty($resArray['partof'])) {
119
+                    // Get title of superior document.
120
+                    if ((empty($resArray['title']) || !empty($this->conf['prependSuperiorTitle'])) && !empty($resArray['partof'])) {
121 121
 
122
-						$superiorTitle = tx_dlf_document::getTitle($resArray['partof'], TRUE);
122
+                        $superiorTitle = tx_dlf_document::getTitle($resArray['partof'], TRUE);
123 123
 
124
-						if (!empty($superiorTitle)) {
124
+                        if (!empty($superiorTitle)) {
125 125
 
126
-							$title .= '['.$superiorTitle.']';
126
+                            $title .= '['.$superiorTitle.']';
127 127
 
128
-						}
128
+                        }
129 129
 
130
-					}
130
+                    }
131 131
 
132
-					// Get title of document.
133
-					if (!empty($resArray['title'])) {
132
+                    // Get title of document.
133
+                    if (!empty($resArray['title'])) {
134 134
 
135
-						$title .= ' '.$resArray['title'];
135
+                        $title .= ' '.$resArray['title'];
136 136
 
137
-					}
137
+                    }
138 138
 
139
-					// Set default title if empty.
140
-					if (empty($title)) {
139
+                    // Set default title if empty.
140
+                    if (empty($title)) {
141 141
 
142
-						$title = $this->pi_getLL('noTitle');
142
+                        $title = $this->pi_getLL('noTitle');
143 143
 
144
-					}
144
+                    }
145 145
 
146
-					// Append volume information.
147
-					if (!empty($resArray['volume'])) {
146
+                    // Append volume information.
147
+                    if (!empty($resArray['volume'])) {
148 148
 
149
-						$title .= ', '.$this->pi_getLL('volume').' '.$resArray['volume'];
149
+                        $title .= ', '.$this->pi_getLL('volume').' '.$resArray['volume'];
150 150
 
151
-					}
151
+                    }
152 152
 
153
-					// Is this document new or updated?
154
-					if ($resArray['crdate'] == $resArray['tstamp']) {
153
+                    // Is this document new or updated?
154
+                    if ($resArray['crdate'] == $resArray['tstamp']) {
155 155
 
156
-						$title = $this->pi_getLL('new').' '.trim($title);
156
+                        $title = $this->pi_getLL('new').' '.trim($title);
157 157
 
158
-					} else {
158
+                    } else {
159 159
 
160
-						$title = $this->pi_getLL('update').' '.trim($title);
160
+                        $title = $this->pi_getLL('update').' '.trim($title);
161 161
 
162
-					}
162
+                    }
163 163
 
164
-					$item->appendChild($rss->createElement('title', htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8')));
164
+                    $item->appendChild($rss->createElement('title', htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8')));
165 165
 
166
-					// Add link.
167
-					$linkConf = array (
168
-						'parameter' => $this->conf['targetPid'],
169
-						'forceAbsoluteUrl' => 1,
170
-						'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, array ('id' => $resArray['uid']), '', TRUE, FALSE)
171
-					);
166
+                    // Add link.
167
+                    $linkConf = array (
168
+                        'parameter' => $this->conf['targetPid'],
169
+                        'forceAbsoluteUrl' => 1,
170
+                        'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, array ('id' => $resArray['uid']), '', TRUE, FALSE)
171
+                    );
172 172
 
173
-					$item->appendChild($rss->createElement('link', htmlspecialchars($this->cObj->typoLink_URL($linkConf), ENT_NOQUOTES, 'UTF-8')));
173
+                    $item->appendChild($rss->createElement('link', htmlspecialchars($this->cObj->typoLink_URL($linkConf), ENT_NOQUOTES, 'UTF-8')));
174 174
 
175
-					// Add author if applicable.
176
-					if (!empty($resArray['author'])) {
175
+                    // Add author if applicable.
176
+                    if (!empty($resArray['author'])) {
177 177
 
178
-						$item->appendChild($rss->createElement('author', htmlspecialchars($resArray['author'], ENT_NOQUOTES, 'UTF-8')));
178
+                        $item->appendChild($rss->createElement('author', htmlspecialchars($resArray['author'], ENT_NOQUOTES, 'UTF-8')));
179 179
 
180
-					}
180
+                    }
181 181
 
182
-					// Add online publication date.
183
-					$item->appendChild($rss->createElement('pubDate', date('r', $resArray['crdate'])));
182
+                    // Add online publication date.
183
+                    $item->appendChild($rss->createElement('pubDate', date('r', $resArray['crdate'])));
184 184
 
185
-					// Add internal record identifier.
186
-					$item->appendChild($rss->createElement('guid', htmlspecialchars($resArray['guid'], ENT_NOQUOTES, 'UTF-8')));
185
+                    // Add internal record identifier.
186
+                    $item->appendChild($rss->createElement('guid', htmlspecialchars($resArray['guid'], ENT_NOQUOTES, 'UTF-8')));
187 187
 
188
-					$channel->appendChild($item);
188
+                    $channel->appendChild($item);
189 189
 
190
-				}
190
+                }
191 191
 
192
-			}
192
+            }
193 193
 
194
-		}
194
+        }
195 195
 
196
-		$root->appendChild($channel);
196
+        $root->appendChild($channel);
197 197
 
198
-		// Build XML output.
199
-		$rss->appendChild($root);
198
+        // Build XML output.
199
+        $rss->appendChild($root);
200 200
 
201
-		$content = $rss->saveXML();
201
+        $content = $rss->saveXML();
202 202
 
203
-		// Clean output buffer.
204
-		\TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
203
+        // Clean output buffer.
204
+        \TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
205 205
 
206
-		// Send headers.
207
-		header('HTTP/1.1 200 OK');
206
+        // Send headers.
207
+        header('HTTP/1.1 200 OK');
208 208
 
209
-		header('Cache-Control: no-cache');
209
+        header('Cache-Control: no-cache');
210 210
 
211
-		header('Content-Length: '.strlen($content));
211
+        header('Content-Length: '.strlen($content));
212 212
 
213
-		header('Content-Type: application/rss+xml; charset=utf-8');
213
+        header('Content-Type: application/rss+xml; charset=utf-8');
214 214
 
215
-		header('Date: '.date('r', $GLOBALS['EXEC_TIME']));
215
+        header('Date: '.date('r', $GLOBALS['EXEC_TIME']));
216 216
 
217
-		header('Expires: '.date('r', $GLOBALS['EXEC_TIME']));
217
+        header('Expires: '.date('r', $GLOBALS['EXEC_TIME']));
218 218
 
219
-		echo $content;
219
+        echo $content;
220 220
 
221
-		// Flush output buffer and end script processing.
222
-		ob_end_flush();
221
+        // Flush output buffer and end script processing.
222
+        ob_end_flush();
223 223
 
224
-		exit;
224
+        exit;
225 225
 
226
-	}
226
+    }
227 227
 
228 228
 }
Please login to merge, or discard this patch.