Passed
Push — master ( 4b28da...b805d0 )
by John
10:48 queued 12s
created
apps/files/lib/Controller/ViewController.php 2 patches
Indentation   +285 added lines, -285 removed lines patch added patch discarded remove patch
@@ -61,289 +61,289 @@
 block discarded – undo
61 61
  * @package OCA\Files\Controller
62 62
  */
63 63
 class ViewController extends Controller {
64
-	/** @var string */
65
-	protected $appName;
66
-	/** @var IRequest */
67
-	protected $request;
68
-	/** @var IURLGenerator */
69
-	protected $urlGenerator;
70
-	/** @var IL10N */
71
-	protected $l10n;
72
-	/** @var IConfig */
73
-	protected $config;
74
-	/** @var IEventDispatcher */
75
-	protected $eventDispatcher;
76
-	/** @var IUserSession */
77
-	protected $userSession;
78
-	/** @var IAppManager */
79
-	protected $appManager;
80
-	/** @var IRootFolder */
81
-	protected $rootFolder;
82
-	/** @var Helper */
83
-	protected $activityHelper;
84
-
85
-	public function __construct(string $appName,
86
-		IRequest $request,
87
-		IURLGenerator $urlGenerator,
88
-		IL10N $l10n,
89
-		IConfig $config,
90
-		IEventDispatcher $eventDispatcher,
91
-		IUserSession $userSession,
92
-		IAppManager $appManager,
93
-		IRootFolder $rootFolder,
94
-		Helper $activityHelper
95
-	) {
96
-		parent::__construct($appName, $request);
97
-		$this->appName         = $appName;
98
-		$this->request         = $request;
99
-		$this->urlGenerator    = $urlGenerator;
100
-		$this->l10n            = $l10n;
101
-		$this->config          = $config;
102
-		$this->eventDispatcher = $eventDispatcher;
103
-		$this->userSession     = $userSession;
104
-		$this->appManager      = $appManager;
105
-		$this->rootFolder      = $rootFolder;
106
-		$this->activityHelper  = $activityHelper;
107
-	}
108
-
109
-	/**
110
-	 * @param string $appName
111
-	 * @param string $scriptName
112
-	 * @return string
113
-	 */
114
-	protected function renderScript($appName, $scriptName) {
115
-		$content    = '';
116
-		$appPath    = \OC_App::getAppPath($appName);
117
-		$scriptPath = $appPath . '/' . $scriptName;
118
-		if (file_exists($scriptPath)) {
119
-			// TODO: sanitize path / script name ?
120
-			ob_start();
121
-			include $scriptPath;
122
-			$content = ob_get_contents();
123
-			@ob_end_clean();
124
-		}
125
-
126
-		return $content;
127
-	}
128
-
129
-	/**
130
-	 * FIXME: Replace with non static code
131
-	 *
132
-	 * @return array
133
-	 * @throws \OCP\Files\NotFoundException
134
-	 */
135
-	protected function getStorageInfo() {
136
-		$dirInfo = \OC\Files\Filesystem::getFileInfo('/', false);
137
-
138
-		return \OC_Helper::getStorageInfo('/', $dirInfo);
139
-	}
140
-
141
-	/**
142
-	 * @NoCSRFRequired
143
-	 * @NoAdminRequired
144
-	 *
145
-	 * @param string $fileid
146
-	 * @return TemplateResponse|RedirectResponse
147
-	 * @throws NotFoundException
148
-	 */
149
-	public function showFile(string $fileid = null): Response {
150
-		// This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server.
151
-		try {
152
-			return $this->redirectToFile($fileid);
153
-		} catch (NotFoundException $e) {
154
-			return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
155
-		}
156
-	}
157
-
158
-	/**
159
-	 * @NoCSRFRequired
160
-	 * @NoAdminRequired
161
-	 *
162
-	 * @param string $dir
163
-	 * @param string $view
164
-	 * @param string $fileid
165
-	 * @param bool $fileNotFound
166
-	 * @return TemplateResponse|RedirectResponse
167
-	 * @throws NotFoundException
168
-	 */
169
-	public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
170
-		if ($fileid !== null) {
171
-			try {
172
-				return $this->redirectToFile($fileid);
173
-			} catch (NotFoundException $e) {
174
-				return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
175
-			}
176
-		}
177
-
178
-		$nav = new \OCP\Template('files', 'appnavigation', '');
179
-
180
-		// Load the files we need
181
-		\OCP\Util::addStyle('files', 'merged');
182
-		\OCP\Util::addScript('files', 'merged-index');
183
-
184
-		// mostly for the home storage's free space
185
-		// FIXME: Make non static
186
-		$storageInfo = $this->getStorageInfo();
187
-
188
-		$user = $this->userSession->getUser()->getUID();
189
-
190
-		// Get all the user favorites to create a submenu
191
-		try {
192
-			$favElements = $this->activityHelper->getFavoriteFilePaths($this->userSession->getUser()->getUID());
193
-		} catch (\RuntimeException $e) {
194
-			$favElements['folders'] = [];
195
-		}
196
-
197
-		$collapseClasses = '';
198
-		if (count($favElements['folders']) > 0) {
199
-			$collapseClasses = 'collapsible';
200
-		}
201
-
202
-		$favoritesSublistArray = Array();
203
-
204
-		$navBarPositionPosition = 6;
205
-		$currentCount           = 0;
206
-		foreach ($favElements['folders'] as $dir) {
207
-
208
-			$link         = $this->urlGenerator->linkToRoute('files.view.index', ['dir' => $dir, 'view' => 'files']);
209
-			$sortingValue = ++$currentCount;
210
-			$element      = [
211
-				'id'                 => str_replace('/', '-', $dir),
212
-				'view'               => 'files',
213
-				'href'               => $link,
214
-				'dir'                => $dir,
215
-				'order'              => $navBarPositionPosition,
216
-				'folderPosition'     => $sortingValue,
217
-				'name'               => basename($dir),
218
-				'icon'               => 'files',
219
-				'quickaccesselement' => 'true'
220
-			];
221
-
222
-			array_push($favoritesSublistArray, $element);
223
-			$navBarPositionPosition++;
224
-		}
225
-
226
-		$navItems = \OCA\Files\App::getNavigationManager()->getAll();
227
-
228
-		// add the favorites entry in menu
229
-		$navItems['favorites']['sublist'] = $favoritesSublistArray;
230
-		$navItems['favorites']['classes'] = $collapseClasses;
231
-
232
-		// parse every menu and add the expandedState user value
233
-		foreach ($navItems as $key => $item) {
234
-			if (isset($item['expandedState'])) {
235
-				$navItems[$key]['defaultExpandedState'] = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', $item['expandedState'], '0') === '1';
236
-			}
237
-		}
238
-
239
-		$nav->assign('navigationItems', $navItems);
240
-
241
-		$nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
242
-		if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
243
-			$totalSpace = $this->l10n->t('Unlimited');
244
-		} else {
245
-			$totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
246
-		}
247
-		$nav->assign('total_space', $totalSpace);
248
-		$nav->assign('quota', $storageInfo['quota']);
249
-		$nav->assign('usage_relative', $storageInfo['relative']);
250
-
251
-		$nav->assign('webdav_url', \OCP\Util::linkToRemote('dav/files/' . $user));
252
-
253
-		$contentItems = [];
254
-
255
-		// render the container content for every navigation item
256
-		foreach ($navItems as $item) {
257
-			$content = '';
258
-			if (isset($item['script'])) {
259
-				$content = $this->renderScript($item['appname'], $item['script']);
260
-			}
261
-			// parse submenus
262
-			if (isset($item['sublist'])) {
263
-				foreach ($item['sublist'] as $subitem) {
264
-					$subcontent = '';
265
-					if (isset($subitem['script'])) {
266
-						$subcontent = $this->renderScript($subitem['appname'], $subitem['script']);
267
-					}
268
-					$contentItems[$subitem['id']] = [
269
-						'id'      => $subitem['id'],
270
-						'content' => $subcontent
271
-					];
272
-				}
273
-			}
274
-			$contentItems[$item['id']] = [
275
-				'id'      => $item['id'],
276
-				'content' => $content
277
-			];
278
-		}
279
-
280
-		$event = new LoadAdditionalScriptsEvent();
281
-		$this->eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, $event);
282
-
283
-		$this->eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());
284
-
285
-		$params                                = [];
286
-		$params['usedSpacePercent']            = (int) $storageInfo['relative'];
287
-		$params['owner']                       = $storageInfo['owner'] ?? '';
288
-		$params['ownerDisplayName']            = $storageInfo['ownerDisplayName'] ?? '';
289
-		$params['isPublic']                    = false;
290
-		$params['allowShareWithLink']          = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
291
-		$params['defaultFileSorting']          = $this->config->getUserValue($user, 'files', 'file_sorting', 'name');
292
-		$params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc');
293
-		$params['showgridview']				   = $this->config->getUserValue($user, 'files', 'show_grid', false);
294
-		$params['isIE']						   = \OCP\Util::isIE();
295
-		$showHidden                            = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false);
296
-		$params['showHiddenFiles']             = $showHidden ? 1 : 0;
297
-		$params['fileNotFound']                = $fileNotFound ? 1 : 0;
298
-		$params['appNavigation']               = $nav;
299
-		$params['appContents']                 = $contentItems;
300
-		$params['hiddenFields']                = $event->getHiddenFields();
301
-
302
-		$response = new TemplateResponse(
303
-			$this->appName,
304
-			'index',
305
-			$params
306
-		);
307
-		$policy = new ContentSecurityPolicy();
308
-		$policy->addAllowedFrameDomain('\'self\'');
309
-		$response->setContentSecurityPolicy($policy);
310
-
311
-		return $response;
312
-	}
313
-
314
-	/**
315
-	 * Redirects to the file list and highlight the given file id
316
-	 *
317
-	 * @param string $fileId file id to show
318
-	 * @return RedirectResponse redirect response or not found response
319
-	 * @throws \OCP\Files\NotFoundException
320
-	 */
321
-	private function redirectToFile($fileId) {
322
-		$uid        = $this->userSession->getUser()->getUID();
323
-		$baseFolder = $this->rootFolder->getUserFolder($uid);
324
-		$files      = $baseFolder->getById($fileId);
325
-		$params     = [];
326
-
327
-		if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
328
-			$baseFolder     = $this->rootFolder->get($uid . '/files_trashbin/files/');
329
-			$files          = $baseFolder->getById($fileId);
330
-			$params['view'] = 'trashbin';
331
-		}
332
-
333
-		if (!empty($files)) {
334
-			$file = current($files);
335
-			if ($file instanceof Folder) {
336
-				// set the full path to enter the folder
337
-				$params['dir'] = $baseFolder->getRelativePath($file->getPath());
338
-			} else {
339
-				// set parent path as dir
340
-				$params['dir'] = $baseFolder->getRelativePath($file->getParent()->getPath());
341
-				// and scroll to the entry
342
-				$params['scrollto'] = $file->getName();
343
-			}
344
-
345
-			return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', $params));
346
-		}
347
-		throw new \OCP\Files\NotFoundException();
348
-	}
64
+    /** @var string */
65
+    protected $appName;
66
+    /** @var IRequest */
67
+    protected $request;
68
+    /** @var IURLGenerator */
69
+    protected $urlGenerator;
70
+    /** @var IL10N */
71
+    protected $l10n;
72
+    /** @var IConfig */
73
+    protected $config;
74
+    /** @var IEventDispatcher */
75
+    protected $eventDispatcher;
76
+    /** @var IUserSession */
77
+    protected $userSession;
78
+    /** @var IAppManager */
79
+    protected $appManager;
80
+    /** @var IRootFolder */
81
+    protected $rootFolder;
82
+    /** @var Helper */
83
+    protected $activityHelper;
84
+
85
+    public function __construct(string $appName,
86
+        IRequest $request,
87
+        IURLGenerator $urlGenerator,
88
+        IL10N $l10n,
89
+        IConfig $config,
90
+        IEventDispatcher $eventDispatcher,
91
+        IUserSession $userSession,
92
+        IAppManager $appManager,
93
+        IRootFolder $rootFolder,
94
+        Helper $activityHelper
95
+    ) {
96
+        parent::__construct($appName, $request);
97
+        $this->appName         = $appName;
98
+        $this->request         = $request;
99
+        $this->urlGenerator    = $urlGenerator;
100
+        $this->l10n            = $l10n;
101
+        $this->config          = $config;
102
+        $this->eventDispatcher = $eventDispatcher;
103
+        $this->userSession     = $userSession;
104
+        $this->appManager      = $appManager;
105
+        $this->rootFolder      = $rootFolder;
106
+        $this->activityHelper  = $activityHelper;
107
+    }
108
+
109
+    /**
110
+     * @param string $appName
111
+     * @param string $scriptName
112
+     * @return string
113
+     */
114
+    protected function renderScript($appName, $scriptName) {
115
+        $content    = '';
116
+        $appPath    = \OC_App::getAppPath($appName);
117
+        $scriptPath = $appPath . '/' . $scriptName;
118
+        if (file_exists($scriptPath)) {
119
+            // TODO: sanitize path / script name ?
120
+            ob_start();
121
+            include $scriptPath;
122
+            $content = ob_get_contents();
123
+            @ob_end_clean();
124
+        }
125
+
126
+        return $content;
127
+    }
128
+
129
+    /**
130
+     * FIXME: Replace with non static code
131
+     *
132
+     * @return array
133
+     * @throws \OCP\Files\NotFoundException
134
+     */
135
+    protected function getStorageInfo() {
136
+        $dirInfo = \OC\Files\Filesystem::getFileInfo('/', false);
137
+
138
+        return \OC_Helper::getStorageInfo('/', $dirInfo);
139
+    }
140
+
141
+    /**
142
+     * @NoCSRFRequired
143
+     * @NoAdminRequired
144
+     *
145
+     * @param string $fileid
146
+     * @return TemplateResponse|RedirectResponse
147
+     * @throws NotFoundException
148
+     */
149
+    public function showFile(string $fileid = null): Response {
150
+        // This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server.
151
+        try {
152
+            return $this->redirectToFile($fileid);
153
+        } catch (NotFoundException $e) {
154
+            return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
155
+        }
156
+    }
157
+
158
+    /**
159
+     * @NoCSRFRequired
160
+     * @NoAdminRequired
161
+     *
162
+     * @param string $dir
163
+     * @param string $view
164
+     * @param string $fileid
165
+     * @param bool $fileNotFound
166
+     * @return TemplateResponse|RedirectResponse
167
+     * @throws NotFoundException
168
+     */
169
+    public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
170
+        if ($fileid !== null) {
171
+            try {
172
+                return $this->redirectToFile($fileid);
173
+            } catch (NotFoundException $e) {
174
+                return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
175
+            }
176
+        }
177
+
178
+        $nav = new \OCP\Template('files', 'appnavigation', '');
179
+
180
+        // Load the files we need
181
+        \OCP\Util::addStyle('files', 'merged');
182
+        \OCP\Util::addScript('files', 'merged-index');
183
+
184
+        // mostly for the home storage's free space
185
+        // FIXME: Make non static
186
+        $storageInfo = $this->getStorageInfo();
187
+
188
+        $user = $this->userSession->getUser()->getUID();
189
+
190
+        // Get all the user favorites to create a submenu
191
+        try {
192
+            $favElements = $this->activityHelper->getFavoriteFilePaths($this->userSession->getUser()->getUID());
193
+        } catch (\RuntimeException $e) {
194
+            $favElements['folders'] = [];
195
+        }
196
+
197
+        $collapseClasses = '';
198
+        if (count($favElements['folders']) > 0) {
199
+            $collapseClasses = 'collapsible';
200
+        }
201
+
202
+        $favoritesSublistArray = Array();
203
+
204
+        $navBarPositionPosition = 6;
205
+        $currentCount           = 0;
206
+        foreach ($favElements['folders'] as $dir) {
207
+
208
+            $link         = $this->urlGenerator->linkToRoute('files.view.index', ['dir' => $dir, 'view' => 'files']);
209
+            $sortingValue = ++$currentCount;
210
+            $element      = [
211
+                'id'                 => str_replace('/', '-', $dir),
212
+                'view'               => 'files',
213
+                'href'               => $link,
214
+                'dir'                => $dir,
215
+                'order'              => $navBarPositionPosition,
216
+                'folderPosition'     => $sortingValue,
217
+                'name'               => basename($dir),
218
+                'icon'               => 'files',
219
+                'quickaccesselement' => 'true'
220
+            ];
221
+
222
+            array_push($favoritesSublistArray, $element);
223
+            $navBarPositionPosition++;
224
+        }
225
+
226
+        $navItems = \OCA\Files\App::getNavigationManager()->getAll();
227
+
228
+        // add the favorites entry in menu
229
+        $navItems['favorites']['sublist'] = $favoritesSublistArray;
230
+        $navItems['favorites']['classes'] = $collapseClasses;
231
+
232
+        // parse every menu and add the expandedState user value
233
+        foreach ($navItems as $key => $item) {
234
+            if (isset($item['expandedState'])) {
235
+                $navItems[$key]['defaultExpandedState'] = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', $item['expandedState'], '0') === '1';
236
+            }
237
+        }
238
+
239
+        $nav->assign('navigationItems', $navItems);
240
+
241
+        $nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
242
+        if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
243
+            $totalSpace = $this->l10n->t('Unlimited');
244
+        } else {
245
+            $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
246
+        }
247
+        $nav->assign('total_space', $totalSpace);
248
+        $nav->assign('quota', $storageInfo['quota']);
249
+        $nav->assign('usage_relative', $storageInfo['relative']);
250
+
251
+        $nav->assign('webdav_url', \OCP\Util::linkToRemote('dav/files/' . $user));
252
+
253
+        $contentItems = [];
254
+
255
+        // render the container content for every navigation item
256
+        foreach ($navItems as $item) {
257
+            $content = '';
258
+            if (isset($item['script'])) {
259
+                $content = $this->renderScript($item['appname'], $item['script']);
260
+            }
261
+            // parse submenus
262
+            if (isset($item['sublist'])) {
263
+                foreach ($item['sublist'] as $subitem) {
264
+                    $subcontent = '';
265
+                    if (isset($subitem['script'])) {
266
+                        $subcontent = $this->renderScript($subitem['appname'], $subitem['script']);
267
+                    }
268
+                    $contentItems[$subitem['id']] = [
269
+                        'id'      => $subitem['id'],
270
+                        'content' => $subcontent
271
+                    ];
272
+                }
273
+            }
274
+            $contentItems[$item['id']] = [
275
+                'id'      => $item['id'],
276
+                'content' => $content
277
+            ];
278
+        }
279
+
280
+        $event = new LoadAdditionalScriptsEvent();
281
+        $this->eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, $event);
282
+
283
+        $this->eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());
284
+
285
+        $params                                = [];
286
+        $params['usedSpacePercent']            = (int) $storageInfo['relative'];
287
+        $params['owner']                       = $storageInfo['owner'] ?? '';
288
+        $params['ownerDisplayName']            = $storageInfo['ownerDisplayName'] ?? '';
289
+        $params['isPublic']                    = false;
290
+        $params['allowShareWithLink']          = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
291
+        $params['defaultFileSorting']          = $this->config->getUserValue($user, 'files', 'file_sorting', 'name');
292
+        $params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc');
293
+        $params['showgridview']				   = $this->config->getUserValue($user, 'files', 'show_grid', false);
294
+        $params['isIE']						   = \OCP\Util::isIE();
295
+        $showHidden                            = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false);
296
+        $params['showHiddenFiles']             = $showHidden ? 1 : 0;
297
+        $params['fileNotFound']                = $fileNotFound ? 1 : 0;
298
+        $params['appNavigation']               = $nav;
299
+        $params['appContents']                 = $contentItems;
300
+        $params['hiddenFields']                = $event->getHiddenFields();
301
+
302
+        $response = new TemplateResponse(
303
+            $this->appName,
304
+            'index',
305
+            $params
306
+        );
307
+        $policy = new ContentSecurityPolicy();
308
+        $policy->addAllowedFrameDomain('\'self\'');
309
+        $response->setContentSecurityPolicy($policy);
310
+
311
+        return $response;
312
+    }
313
+
314
+    /**
315
+     * Redirects to the file list and highlight the given file id
316
+     *
317
+     * @param string $fileId file id to show
318
+     * @return RedirectResponse redirect response or not found response
319
+     * @throws \OCP\Files\NotFoundException
320
+     */
321
+    private function redirectToFile($fileId) {
322
+        $uid        = $this->userSession->getUser()->getUID();
323
+        $baseFolder = $this->rootFolder->getUserFolder($uid);
324
+        $files      = $baseFolder->getById($fileId);
325
+        $params     = [];
326
+
327
+        if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
328
+            $baseFolder     = $this->rootFolder->get($uid . '/files_trashbin/files/');
329
+            $files          = $baseFolder->getById($fileId);
330
+            $params['view'] = 'trashbin';
331
+        }
332
+
333
+        if (!empty($files)) {
334
+            $file = current($files);
335
+            if ($file instanceof Folder) {
336
+                // set the full path to enter the folder
337
+                $params['dir'] = $baseFolder->getRelativePath($file->getPath());
338
+            } else {
339
+                // set parent path as dir
340
+                $params['dir'] = $baseFolder->getRelativePath($file->getParent()->getPath());
341
+                // and scroll to the entry
342
+                $params['scrollto'] = $file->getName();
343
+            }
344
+
345
+            return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', $params));
346
+        }
347
+        throw new \OCP\Files\NotFoundException();
348
+    }
349 349
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	protected function renderScript($appName, $scriptName) {
115 115
 		$content    = '';
116 116
 		$appPath    = \OC_App::getAppPath($appName);
117
-		$scriptPath = $appPath . '/' . $scriptName;
117
+		$scriptPath = $appPath.'/'.$scriptName;
118 118
 		if (file_exists($scriptPath)) {
119 119
 			// TODO: sanitize path / script name ?
120 120
 			ob_start();
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		$nav->assign('quota', $storageInfo['quota']);
249 249
 		$nav->assign('usage_relative', $storageInfo['relative']);
250 250
 
251
-		$nav->assign('webdav_url', \OCP\Util::linkToRemote('dav/files/' . $user));
251
+		$nav->assign('webdav_url', \OCP\Util::linkToRemote('dav/files/'.$user));
252 252
 
253 253
 		$contentItems = [];
254 254
 
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
 		$params['allowShareWithLink']          = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
291 291
 		$params['defaultFileSorting']          = $this->config->getUserValue($user, 'files', 'file_sorting', 'name');
292 292
 		$params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc');
293
-		$params['showgridview']				   = $this->config->getUserValue($user, 'files', 'show_grid', false);
294
-		$params['isIE']						   = \OCP\Util::isIE();
293
+		$params['showgridview'] = $this->config->getUserValue($user, 'files', 'show_grid', false);
294
+		$params['isIE'] = \OCP\Util::isIE();
295 295
 		$showHidden                            = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false);
296 296
 		$params['showHiddenFiles']             = $showHidden ? 1 : 0;
297 297
 		$params['fileNotFound']                = $fileNotFound ? 1 : 0;
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 		$params     = [];
326 326
 
327 327
 		if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
328
-			$baseFolder     = $this->rootFolder->get($uid . '/files_trashbin/files/');
328
+			$baseFolder     = $this->rootFolder->get($uid.'/files_trashbin/files/');
329 329
 			$files          = $baseFolder->getById($fileId);
330 330
 			$params['view'] = 'trashbin';
331 331
 		}
Please login to merge, or discard this patch.