Passed
Push — master ( 7e7284...62fa85 )
by Roeland
17:42 queued 12s
created
apps/files/lib/Controller/ViewController.php 1 patch
Indentation   +301 added lines, -301 removed lines patch added patch discarded remove patch
@@ -62,305 +62,305 @@
 block discarded – undo
62 62
  * @package OCA\Files\Controller
63 63
  */
64 64
 class ViewController extends Controller {
65
-	/** @var string */
66
-	protected $appName;
67
-	/** @var IRequest */
68
-	protected $request;
69
-	/** @var IURLGenerator */
70
-	protected $urlGenerator;
71
-	/** @var IL10N */
72
-	protected $l10n;
73
-	/** @var IConfig */
74
-	protected $config;
75
-	/** @var IEventDispatcher */
76
-	protected $eventDispatcher;
77
-	/** @var IUserSession */
78
-	protected $userSession;
79
-	/** @var IAppManager */
80
-	protected $appManager;
81
-	/** @var IRootFolder */
82
-	protected $rootFolder;
83
-	/** @var Helper */
84
-	protected $activityHelper;
85
-	/** @var IInitialState */
86
-	private $initialState;
87
-	/** @var ITemplateManager */
88
-	private $templateManager;
89
-
90
-	public function __construct(string $appName,
91
-		IRequest $request,
92
-		IURLGenerator $urlGenerator,
93
-		IL10N $l10n,
94
-		IConfig $config,
95
-		IEventDispatcher $eventDispatcher,
96
-		IUserSession $userSession,
97
-		IAppManager $appManager,
98
-		IRootFolder $rootFolder,
99
-		Helper $activityHelper,
100
-		IInitialState $initialState,
101
-		ITemplateManager $templateManager
102
-	) {
103
-		parent::__construct($appName, $request);
104
-		$this->appName = $appName;
105
-		$this->request = $request;
106
-		$this->urlGenerator = $urlGenerator;
107
-		$this->l10n = $l10n;
108
-		$this->config = $config;
109
-		$this->eventDispatcher = $eventDispatcher;
110
-		$this->userSession = $userSession;
111
-		$this->appManager = $appManager;
112
-		$this->rootFolder = $rootFolder;
113
-		$this->activityHelper = $activityHelper;
114
-		$this->initialState = $initialState;
115
-		$this->templateManager = $templateManager;
116
-	}
117
-
118
-	/**
119
-	 * @param string $appName
120
-	 * @param string $scriptName
121
-	 * @return string
122
-	 */
123
-	protected function renderScript($appName, $scriptName) {
124
-		$content = '';
125
-		$appPath = \OC_App::getAppPath($appName);
126
-		$scriptPath = $appPath . '/' . $scriptName;
127
-		if (file_exists($scriptPath)) {
128
-			// TODO: sanitize path / script name ?
129
-			ob_start();
130
-			include $scriptPath;
131
-			$content = ob_get_contents();
132
-			@ob_end_clean();
133
-		}
134
-
135
-		return $content;
136
-	}
137
-
138
-	/**
139
-	 * FIXME: Replace with non static code
140
-	 *
141
-	 * @return array
142
-	 * @throws \OCP\Files\NotFoundException
143
-	 */
144
-	protected function getStorageInfo() {
145
-		\OC_Util::setupFS();
146
-		$dirInfo = \OC\Files\Filesystem::getFileInfo('/', false);
147
-
148
-		return \OC_Helper::getStorageInfo('/', $dirInfo);
149
-	}
150
-
151
-	/**
152
-	 * @NoCSRFRequired
153
-	 * @NoAdminRequired
154
-	 *
155
-	 * @param string $fileid
156
-	 * @return TemplateResponse|RedirectResponse
157
-	 * @throws NotFoundException
158
-	 */
159
-	public function showFile(string $fileid = null): Response {
160
-		// This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server.
161
-		try {
162
-			return $this->redirectToFile($fileid);
163
-		} catch (NotFoundException $e) {
164
-			return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
165
-		}
166
-	}
167
-
168
-	/**
169
-	 * @NoCSRFRequired
170
-	 * @NoAdminRequired
171
-	 *
172
-	 * @param string $dir
173
-	 * @param string $view
174
-	 * @param string $fileid
175
-	 * @param bool $fileNotFound
176
-	 * @return TemplateResponse|RedirectResponse
177
-	 * @throws NotFoundException
178
-	 */
179
-	public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
180
-		if ($fileid !== null) {
181
-			try {
182
-				return $this->redirectToFile($fileid);
183
-			} catch (NotFoundException $e) {
184
-				return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
185
-			}
186
-		}
187
-
188
-		$nav = new \OCP\Template('files', 'appnavigation', '');
189
-
190
-		// Load the files we need
191
-		\OCP\Util::addStyle('files', 'merged');
192
-		\OCP\Util::addScript('files', 'merged-index');
193
-		\OCP\Util::addScript('files', 'dist/templates');
194
-
195
-		// mostly for the home storage's free space
196
-		// FIXME: Make non static
197
-		$storageInfo = $this->getStorageInfo();
198
-
199
-		$user = $this->userSession->getUser()->getUID();
200
-
201
-		// Get all the user favorites to create a submenu
202
-		try {
203
-			$favElements = $this->activityHelper->getFavoriteFilePaths($this->userSession->getUser()->getUID());
204
-		} catch (\RuntimeException $e) {
205
-			$favElements['folders'] = [];
206
-		}
207
-
208
-		$collapseClasses = '';
209
-		if (count($favElements['folders']) > 0) {
210
-			$collapseClasses = 'collapsible';
211
-		}
212
-
213
-		$favoritesSublistArray = [];
214
-
215
-		$navBarPositionPosition = 6;
216
-		$currentCount = 0;
217
-		foreach ($favElements['folders'] as $dir) {
218
-			$link = $this->urlGenerator->linkToRoute('files.view.index', ['dir' => $dir, 'view' => 'files']);
219
-			$sortingValue = ++$currentCount;
220
-			$element = [
221
-				'id' => str_replace('/', '-', $dir),
222
-				'view' => 'files',
223
-				'href' => $link,
224
-				'dir' => $dir,
225
-				'order' => $navBarPositionPosition,
226
-				'folderPosition' => $sortingValue,
227
-				'name' => basename($dir),
228
-				'icon' => 'files',
229
-				'quickaccesselement' => 'true'
230
-			];
231
-
232
-			array_push($favoritesSublistArray, $element);
233
-			$navBarPositionPosition++;
234
-		}
235
-
236
-		$navItems = \OCA\Files\App::getNavigationManager()->getAll();
237
-
238
-		// add the favorites entry in menu
239
-		$navItems['favorites']['sublist'] = $favoritesSublistArray;
240
-		$navItems['favorites']['classes'] = $collapseClasses;
241
-
242
-		// parse every menu and add the expandedState user value
243
-		foreach ($navItems as $key => $item) {
244
-			if (isset($item['expandedState'])) {
245
-				$navItems[$key]['defaultExpandedState'] = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', $item['expandedState'], '0') === '1';
246
-			}
247
-		}
248
-
249
-		$nav->assign('navigationItems', $navItems);
250
-
251
-		$nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
252
-		if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
253
-			$totalSpace = $this->l10n->t('Unlimited');
254
-		} else {
255
-			$totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
256
-		}
257
-		$nav->assign('total_space', $totalSpace);
258
-		$nav->assign('quota', $storageInfo['quota']);
259
-		$nav->assign('usage_relative', $storageInfo['relative']);
260
-
261
-		$nav->assign('webdav_url', \OCP\Util::linkToRemote('dav/files/' . $user));
262
-
263
-		$contentItems = [];
264
-
265
-		// render the container content for every navigation item
266
-		foreach ($navItems as $item) {
267
-			$content = '';
268
-			if (isset($item['script'])) {
269
-				$content = $this->renderScript($item['appname'], $item['script']);
270
-			}
271
-			// parse submenus
272
-			if (isset($item['sublist'])) {
273
-				foreach ($item['sublist'] as $subitem) {
274
-					$subcontent = '';
275
-					if (isset($subitem['script'])) {
276
-						$subcontent = $this->renderScript($subitem['appname'], $subitem['script']);
277
-					}
278
-					$contentItems[$subitem['id']] = [
279
-						'id' => $subitem['id'],
280
-						'content' => $subcontent
281
-					];
282
-				}
283
-			}
284
-			$contentItems[$item['id']] = [
285
-				'id' => $item['id'],
286
-				'content' => $content
287
-			];
288
-		}
289
-
290
-		$event = new LoadAdditionalScriptsEvent();
291
-		$this->eventDispatcher->dispatchTyped($event);
292
-		$this->eventDispatcher->dispatchTyped(new LoadSidebar());
293
-		// Load Viewer scripts
294
-		if (class_exists(LoadViewer::class)) {
295
-			$this->eventDispatcher->dispatchTyped(new LoadViewer());
296
-		}
297
-		$this->initialState->provideInitialState('templates_path', $this->templateManager->hasTemplateDirectory() ? $this->templateManager->getTemplatePath() : null);
298
-		$this->initialState->provideInitialState('templates', $this->templateManager->listCreators());
299
-
300
-		$params = [];
301
-		$params['usedSpacePercent'] = (int) $storageInfo['relative'];
302
-		$params['owner'] = $storageInfo['owner'] ?? '';
303
-		$params['ownerDisplayName'] = $storageInfo['ownerDisplayName'] ?? '';
304
-		$params['isPublic'] = false;
305
-		$params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
306
-		$params['defaultFileSorting'] = $this->config->getUserValue($user, 'files', 'file_sorting', 'name');
307
-		$params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc');
308
-		$params['showgridview'] = $this->config->getUserValue($user, 'files', 'show_grid', false);
309
-		$params['isIE'] = \OCP\Util::isIE();
310
-		$showHidden = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false);
311
-		$params['showHiddenFiles'] = $showHidden ? 1 : 0;
312
-		$cropImagePreviews = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'crop_image_previews', true);
313
-		$params['cropImagePreviews'] = $cropImagePreviews ? 1 : 0;
314
-		$params['fileNotFound'] = $fileNotFound ? 1 : 0;
315
-		$params['appNavigation'] = $nav;
316
-		$params['appContents'] = $contentItems;
317
-		$params['hiddenFields'] = $event->getHiddenFields();
318
-
319
-		$response = new TemplateResponse(
320
-			$this->appName,
321
-			'index',
322
-			$params
323
-		);
324
-		$policy = new ContentSecurityPolicy();
325
-		$policy->addAllowedFrameDomain('\'self\'');
326
-		$response->setContentSecurityPolicy($policy);
327
-
328
-		return $response;
329
-	}
330
-
331
-	/**
332
-	 * Redirects to the file list and highlight the given file id
333
-	 *
334
-	 * @param string $fileId file id to show
335
-	 * @return RedirectResponse redirect response or not found response
336
-	 * @throws \OCP\Files\NotFoundException
337
-	 */
338
-	private function redirectToFile($fileId) {
339
-		$uid = $this->userSession->getUser()->getUID();
340
-		$baseFolder = $this->rootFolder->getUserFolder($uid);
341
-		$files = $baseFolder->getById($fileId);
342
-		$params = [];
343
-
344
-		if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
345
-			$baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/');
346
-			$files = $baseFolder->getById($fileId);
347
-			$params['view'] = 'trashbin';
348
-		}
349
-
350
-		if (!empty($files)) {
351
-			$file = current($files);
352
-			if ($file instanceof Folder) {
353
-				// set the full path to enter the folder
354
-				$params['dir'] = $baseFolder->getRelativePath($file->getPath());
355
-			} else {
356
-				// set parent path as dir
357
-				$params['dir'] = $baseFolder->getRelativePath($file->getParent()->getPath());
358
-				// and scroll to the entry
359
-				$params['scrollto'] = $file->getName();
360
-			}
361
-
362
-			return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', $params));
363
-		}
364
-		throw new \OCP\Files\NotFoundException();
365
-	}
65
+    /** @var string */
66
+    protected $appName;
67
+    /** @var IRequest */
68
+    protected $request;
69
+    /** @var IURLGenerator */
70
+    protected $urlGenerator;
71
+    /** @var IL10N */
72
+    protected $l10n;
73
+    /** @var IConfig */
74
+    protected $config;
75
+    /** @var IEventDispatcher */
76
+    protected $eventDispatcher;
77
+    /** @var IUserSession */
78
+    protected $userSession;
79
+    /** @var IAppManager */
80
+    protected $appManager;
81
+    /** @var IRootFolder */
82
+    protected $rootFolder;
83
+    /** @var Helper */
84
+    protected $activityHelper;
85
+    /** @var IInitialState */
86
+    private $initialState;
87
+    /** @var ITemplateManager */
88
+    private $templateManager;
89
+
90
+    public function __construct(string $appName,
91
+        IRequest $request,
92
+        IURLGenerator $urlGenerator,
93
+        IL10N $l10n,
94
+        IConfig $config,
95
+        IEventDispatcher $eventDispatcher,
96
+        IUserSession $userSession,
97
+        IAppManager $appManager,
98
+        IRootFolder $rootFolder,
99
+        Helper $activityHelper,
100
+        IInitialState $initialState,
101
+        ITemplateManager $templateManager
102
+    ) {
103
+        parent::__construct($appName, $request);
104
+        $this->appName = $appName;
105
+        $this->request = $request;
106
+        $this->urlGenerator = $urlGenerator;
107
+        $this->l10n = $l10n;
108
+        $this->config = $config;
109
+        $this->eventDispatcher = $eventDispatcher;
110
+        $this->userSession = $userSession;
111
+        $this->appManager = $appManager;
112
+        $this->rootFolder = $rootFolder;
113
+        $this->activityHelper = $activityHelper;
114
+        $this->initialState = $initialState;
115
+        $this->templateManager = $templateManager;
116
+    }
117
+
118
+    /**
119
+     * @param string $appName
120
+     * @param string $scriptName
121
+     * @return string
122
+     */
123
+    protected function renderScript($appName, $scriptName) {
124
+        $content = '';
125
+        $appPath = \OC_App::getAppPath($appName);
126
+        $scriptPath = $appPath . '/' . $scriptName;
127
+        if (file_exists($scriptPath)) {
128
+            // TODO: sanitize path / script name ?
129
+            ob_start();
130
+            include $scriptPath;
131
+            $content = ob_get_contents();
132
+            @ob_end_clean();
133
+        }
134
+
135
+        return $content;
136
+    }
137
+
138
+    /**
139
+     * FIXME: Replace with non static code
140
+     *
141
+     * @return array
142
+     * @throws \OCP\Files\NotFoundException
143
+     */
144
+    protected function getStorageInfo() {
145
+        \OC_Util::setupFS();
146
+        $dirInfo = \OC\Files\Filesystem::getFileInfo('/', false);
147
+
148
+        return \OC_Helper::getStorageInfo('/', $dirInfo);
149
+    }
150
+
151
+    /**
152
+     * @NoCSRFRequired
153
+     * @NoAdminRequired
154
+     *
155
+     * @param string $fileid
156
+     * @return TemplateResponse|RedirectResponse
157
+     * @throws NotFoundException
158
+     */
159
+    public function showFile(string $fileid = null): Response {
160
+        // This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server.
161
+        try {
162
+            return $this->redirectToFile($fileid);
163
+        } catch (NotFoundException $e) {
164
+            return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
165
+        }
166
+    }
167
+
168
+    /**
169
+     * @NoCSRFRequired
170
+     * @NoAdminRequired
171
+     *
172
+     * @param string $dir
173
+     * @param string $view
174
+     * @param string $fileid
175
+     * @param bool $fileNotFound
176
+     * @return TemplateResponse|RedirectResponse
177
+     * @throws NotFoundException
178
+     */
179
+    public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
180
+        if ($fileid !== null) {
181
+            try {
182
+                return $this->redirectToFile($fileid);
183
+            } catch (NotFoundException $e) {
184
+                return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
185
+            }
186
+        }
187
+
188
+        $nav = new \OCP\Template('files', 'appnavigation', '');
189
+
190
+        // Load the files we need
191
+        \OCP\Util::addStyle('files', 'merged');
192
+        \OCP\Util::addScript('files', 'merged-index');
193
+        \OCP\Util::addScript('files', 'dist/templates');
194
+
195
+        // mostly for the home storage's free space
196
+        // FIXME: Make non static
197
+        $storageInfo = $this->getStorageInfo();
198
+
199
+        $user = $this->userSession->getUser()->getUID();
200
+
201
+        // Get all the user favorites to create a submenu
202
+        try {
203
+            $favElements = $this->activityHelper->getFavoriteFilePaths($this->userSession->getUser()->getUID());
204
+        } catch (\RuntimeException $e) {
205
+            $favElements['folders'] = [];
206
+        }
207
+
208
+        $collapseClasses = '';
209
+        if (count($favElements['folders']) > 0) {
210
+            $collapseClasses = 'collapsible';
211
+        }
212
+
213
+        $favoritesSublistArray = [];
214
+
215
+        $navBarPositionPosition = 6;
216
+        $currentCount = 0;
217
+        foreach ($favElements['folders'] as $dir) {
218
+            $link = $this->urlGenerator->linkToRoute('files.view.index', ['dir' => $dir, 'view' => 'files']);
219
+            $sortingValue = ++$currentCount;
220
+            $element = [
221
+                'id' => str_replace('/', '-', $dir),
222
+                'view' => 'files',
223
+                'href' => $link,
224
+                'dir' => $dir,
225
+                'order' => $navBarPositionPosition,
226
+                'folderPosition' => $sortingValue,
227
+                'name' => basename($dir),
228
+                'icon' => 'files',
229
+                'quickaccesselement' => 'true'
230
+            ];
231
+
232
+            array_push($favoritesSublistArray, $element);
233
+            $navBarPositionPosition++;
234
+        }
235
+
236
+        $navItems = \OCA\Files\App::getNavigationManager()->getAll();
237
+
238
+        // add the favorites entry in menu
239
+        $navItems['favorites']['sublist'] = $favoritesSublistArray;
240
+        $navItems['favorites']['classes'] = $collapseClasses;
241
+
242
+        // parse every menu and add the expandedState user value
243
+        foreach ($navItems as $key => $item) {
244
+            if (isset($item['expandedState'])) {
245
+                $navItems[$key]['defaultExpandedState'] = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', $item['expandedState'], '0') === '1';
246
+            }
247
+        }
248
+
249
+        $nav->assign('navigationItems', $navItems);
250
+
251
+        $nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
252
+        if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
253
+            $totalSpace = $this->l10n->t('Unlimited');
254
+        } else {
255
+            $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
256
+        }
257
+        $nav->assign('total_space', $totalSpace);
258
+        $nav->assign('quota', $storageInfo['quota']);
259
+        $nav->assign('usage_relative', $storageInfo['relative']);
260
+
261
+        $nav->assign('webdav_url', \OCP\Util::linkToRemote('dav/files/' . $user));
262
+
263
+        $contentItems = [];
264
+
265
+        // render the container content for every navigation item
266
+        foreach ($navItems as $item) {
267
+            $content = '';
268
+            if (isset($item['script'])) {
269
+                $content = $this->renderScript($item['appname'], $item['script']);
270
+            }
271
+            // parse submenus
272
+            if (isset($item['sublist'])) {
273
+                foreach ($item['sublist'] as $subitem) {
274
+                    $subcontent = '';
275
+                    if (isset($subitem['script'])) {
276
+                        $subcontent = $this->renderScript($subitem['appname'], $subitem['script']);
277
+                    }
278
+                    $contentItems[$subitem['id']] = [
279
+                        'id' => $subitem['id'],
280
+                        'content' => $subcontent
281
+                    ];
282
+                }
283
+            }
284
+            $contentItems[$item['id']] = [
285
+                'id' => $item['id'],
286
+                'content' => $content
287
+            ];
288
+        }
289
+
290
+        $event = new LoadAdditionalScriptsEvent();
291
+        $this->eventDispatcher->dispatchTyped($event);
292
+        $this->eventDispatcher->dispatchTyped(new LoadSidebar());
293
+        // Load Viewer scripts
294
+        if (class_exists(LoadViewer::class)) {
295
+            $this->eventDispatcher->dispatchTyped(new LoadViewer());
296
+        }
297
+        $this->initialState->provideInitialState('templates_path', $this->templateManager->hasTemplateDirectory() ? $this->templateManager->getTemplatePath() : null);
298
+        $this->initialState->provideInitialState('templates', $this->templateManager->listCreators());
299
+
300
+        $params = [];
301
+        $params['usedSpacePercent'] = (int) $storageInfo['relative'];
302
+        $params['owner'] = $storageInfo['owner'] ?? '';
303
+        $params['ownerDisplayName'] = $storageInfo['ownerDisplayName'] ?? '';
304
+        $params['isPublic'] = false;
305
+        $params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
306
+        $params['defaultFileSorting'] = $this->config->getUserValue($user, 'files', 'file_sorting', 'name');
307
+        $params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc');
308
+        $params['showgridview'] = $this->config->getUserValue($user, 'files', 'show_grid', false);
309
+        $params['isIE'] = \OCP\Util::isIE();
310
+        $showHidden = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false);
311
+        $params['showHiddenFiles'] = $showHidden ? 1 : 0;
312
+        $cropImagePreviews = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'crop_image_previews', true);
313
+        $params['cropImagePreviews'] = $cropImagePreviews ? 1 : 0;
314
+        $params['fileNotFound'] = $fileNotFound ? 1 : 0;
315
+        $params['appNavigation'] = $nav;
316
+        $params['appContents'] = $contentItems;
317
+        $params['hiddenFields'] = $event->getHiddenFields();
318
+
319
+        $response = new TemplateResponse(
320
+            $this->appName,
321
+            'index',
322
+            $params
323
+        );
324
+        $policy = new ContentSecurityPolicy();
325
+        $policy->addAllowedFrameDomain('\'self\'');
326
+        $response->setContentSecurityPolicy($policy);
327
+
328
+        return $response;
329
+    }
330
+
331
+    /**
332
+     * Redirects to the file list and highlight the given file id
333
+     *
334
+     * @param string $fileId file id to show
335
+     * @return RedirectResponse redirect response or not found response
336
+     * @throws \OCP\Files\NotFoundException
337
+     */
338
+    private function redirectToFile($fileId) {
339
+        $uid = $this->userSession->getUser()->getUID();
340
+        $baseFolder = $this->rootFolder->getUserFolder($uid);
341
+        $files = $baseFolder->getById($fileId);
342
+        $params = [];
343
+
344
+        if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
345
+            $baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/');
346
+            $files = $baseFolder->getById($fileId);
347
+            $params['view'] = 'trashbin';
348
+        }
349
+
350
+        if (!empty($files)) {
351
+            $file = current($files);
352
+            if ($file instanceof Folder) {
353
+                // set the full path to enter the folder
354
+                $params['dir'] = $baseFolder->getRelativePath($file->getPath());
355
+            } else {
356
+                // set parent path as dir
357
+                $params['dir'] = $baseFolder->getRelativePath($file->getParent()->getPath());
358
+                // and scroll to the entry
359
+                $params['scrollto'] = $file->getName();
360
+            }
361
+
362
+            return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', $params));
363
+        }
364
+        throw new \OCP\Files\NotFoundException();
365
+    }
366 366
 }
Please login to merge, or discard this patch.
apps/files/lib/Controller/TemplateController.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -33,44 +33,44 @@
 block discarded – undo
33 33
 use OCP\IRequest;
34 34
 
35 35
 class TemplateController extends OCSController {
36
-	protected $templateManager;
36
+    protected $templateManager;
37 37
 
38
-	public function __construct($appName, IRequest $request, ITemplateManager $templateManager) {
39
-		parent::__construct($appName, $request);
40
-		$this->templateManager = $templateManager;
41
-	}
38
+    public function __construct($appName, IRequest $request, ITemplateManager $templateManager) {
39
+        parent::__construct($appName, $request);
40
+        $this->templateManager = $templateManager;
41
+    }
42 42
 
43
-	/**
44
-	 * @NoAdminRequired
45
-	 */
46
-	public function list(): DataResponse {
47
-		return new DataResponse($this->templateManager->listTemplates());
48
-	}
43
+    /**
44
+     * @NoAdminRequired
45
+     */
46
+    public function list(): DataResponse {
47
+        return new DataResponse($this->templateManager->listTemplates());
48
+    }
49 49
 
50
-	/**
51
-	 * @NoAdminRequired
52
-	 * @throws OCSForbiddenException
53
-	 */
54
-	public function create(string $filePath, string $templatePath = '', string $templateType = 'user'): DataResponse {
55
-		try {
56
-			return new DataResponse($this->templateManager->createFromTemplate($filePath, $templatePath, $templateType));
57
-		} catch (GenericFileException $e) {
58
-			throw new OCSForbiddenException($e->getMessage());
59
-		}
60
-	}
50
+    /**
51
+     * @NoAdminRequired
52
+     * @throws OCSForbiddenException
53
+     */
54
+    public function create(string $filePath, string $templatePath = '', string $templateType = 'user'): DataResponse {
55
+        try {
56
+            return new DataResponse($this->templateManager->createFromTemplate($filePath, $templatePath, $templateType));
57
+        } catch (GenericFileException $e) {
58
+            throw new OCSForbiddenException($e->getMessage());
59
+        }
60
+    }
61 61
 
62
-	/**
63
-	 * @NoAdminRequired
64
-	 */
65
-	public function path(string $templatePath = '', bool $copySystemTemplates = false) {
66
-		try {
67
-			$templatePath = $this->templateManager->initializeTemplateDirectory($templatePath, null, $copySystemTemplates);
68
-			return new DataResponse([
69
-				'template_path' => $templatePath,
70
-				'templates' => $this->templateManager->listCreators()
71
-			]);
72
-		} catch (\Exception $e) {
73
-			throw new OCSForbiddenException($e->getMessage());
74
-		}
75
-	}
62
+    /**
63
+     * @NoAdminRequired
64
+     */
65
+    public function path(string $templatePath = '', bool $copySystemTemplates = false) {
66
+        try {
67
+            $templatePath = $this->templateManager->initializeTemplateDirectory($templatePath, null, $copySystemTemplates);
68
+            return new DataResponse([
69
+                'template_path' => $templatePath,
70
+                'templates' => $this->templateManager->listCreators()
71
+            ]);
72
+        } catch (\Exception $e) {
73
+            throw new OCSForbiddenException($e->getMessage());
74
+        }
75
+    }
76 76
 }
Please login to merge, or discard this patch.
apps/files/composer/composer/autoload_static.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -6,73 +6,73 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInitFiles
8 8
 {
9
-    public static $prefixLengthsPsr4 = array (
9
+    public static $prefixLengthsPsr4 = array(
10 10
         'O' => 
11
-        array (
11
+        array(
12 12
             'OCA\\Files\\' => 10,
13 13
         ),
14 14
     );
15 15
 
16
-    public static $prefixDirsPsr4 = array (
16
+    public static $prefixDirsPsr4 = array(
17 17
         'OCA\\Files\\' => 
18
-        array (
19
-            0 => __DIR__ . '/..' . '/../lib',
18
+        array(
19
+            0 => __DIR__.'/..'.'/../lib',
20 20
         ),
21 21
     );
22 22
 
23
-    public static $classMap = array (
24
-        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
25
-        'OCA\\Files\\Activity\\FavoriteProvider' => __DIR__ . '/..' . '/../lib/Activity/FavoriteProvider.php',
26
-        'OCA\\Files\\Activity\\Filter\\Favorites' => __DIR__ . '/..' . '/../lib/Activity/Filter/Favorites.php',
27
-        'OCA\\Files\\Activity\\Filter\\FileChanges' => __DIR__ . '/..' . '/../lib/Activity/Filter/FileChanges.php',
28
-        'OCA\\Files\\Activity\\Helper' => __DIR__ . '/..' . '/../lib/Activity/Helper.php',
29
-        'OCA\\Files\\Activity\\Provider' => __DIR__ . '/..' . '/../lib/Activity/Provider.php',
30
-        'OCA\\Files\\Activity\\Settings\\FavoriteAction' => __DIR__ . '/..' . '/../lib/Activity/Settings/FavoriteAction.php',
31
-        'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileActivitySettings.php',
32
-        'OCA\\Files\\Activity\\Settings\\FileChanged' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileChanged.php',
33
-        'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileFavoriteChanged.php',
34
-        'OCA\\Files\\App' => __DIR__ . '/..' . '/../lib/App.php',
35
-        'OCA\\Files\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
36
-        'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupDirectEditingTokens.php',
37
-        'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupFileLocks.php',
38
-        'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => __DIR__ . '/..' . '/../lib/BackgroundJob/DeleteOrphanedItems.php',
39
-        'OCA\\Files\\BackgroundJob\\ScanFiles' => __DIR__ . '/..' . '/../lib/BackgroundJob/ScanFiles.php',
40
-        'OCA\\Files\\BackgroundJob\\TransferOwnership' => __DIR__ . '/..' . '/../lib/BackgroundJob/TransferOwnership.php',
41
-        'OCA\\Files\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
42
-        'OCA\\Files\\Collaboration\\Resources\\Listener' => __DIR__ . '/..' . '/../lib/Collaboration/Resources/Listener.php',
43
-        'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => __DIR__ . '/..' . '/../lib/Collaboration/Resources/ResourceProvider.php',
44
-        'OCA\\Files\\Command\\DeleteOrphanedFiles' => __DIR__ . '/..' . '/../lib/Command/DeleteOrphanedFiles.php',
45
-        'OCA\\Files\\Command\\RepairTree' => __DIR__ . '/..' . '/../lib/Command/RepairTree.php',
46
-        'OCA\\Files\\Command\\Scan' => __DIR__ . '/..' . '/../lib/Command/Scan.php',
47
-        'OCA\\Files\\Command\\ScanAppData' => __DIR__ . '/..' . '/../lib/Command/ScanAppData.php',
48
-        'OCA\\Files\\Command\\TransferOwnership' => __DIR__ . '/..' . '/../lib/Command/TransferOwnership.php',
49
-        'OCA\\Files\\Controller\\AjaxController' => __DIR__ . '/..' . '/../lib/Controller/AjaxController.php',
50
-        'OCA\\Files\\Controller\\ApiController' => __DIR__ . '/..' . '/../lib/Controller/ApiController.php',
51
-        'OCA\\Files\\Controller\\DirectEditingController' => __DIR__ . '/..' . '/../lib/Controller/DirectEditingController.php',
52
-        'OCA\\Files\\Controller\\DirectEditingViewController' => __DIR__ . '/..' . '/../lib/Controller/DirectEditingViewController.php',
53
-        'OCA\\Files\\Controller\\TemplateController' => __DIR__ . '/..' . '/../lib/Controller/TemplateController.php',
54
-        'OCA\\Files\\Controller\\TransferOwnershipController' => __DIR__ . '/..' . '/../lib/Controller/TransferOwnershipController.php',
55
-        'OCA\\Files\\Controller\\ViewController' => __DIR__ . '/..' . '/../lib/Controller/ViewController.php',
56
-        'OCA\\Files\\Db\\TransferOwnership' => __DIR__ . '/..' . '/../lib/Db/TransferOwnership.php',
57
-        'OCA\\Files\\Db\\TransferOwnershipMapper' => __DIR__ . '/..' . '/../lib/Db/TransferOwnershipMapper.php',
58
-        'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => __DIR__ . '/..' . '/../lib/Event/LoadAdditionalScriptsEvent.php',
59
-        'OCA\\Files\\Event\\LoadSidebar' => __DIR__ . '/..' . '/../lib/Event/LoadSidebar.php',
60
-        'OCA\\Files\\Exception\\TransferOwnershipException' => __DIR__ . '/..' . '/../lib/Exception/TransferOwnershipException.php',
61
-        'OCA\\Files\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php',
62
-        'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => __DIR__ . '/..' . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
63
-        'OCA\\Files\\Listener\\LoadSidebarListener' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarListener.php',
64
-        'OCA\\Files\\Migration\\Version11301Date20191205150729' => __DIR__ . '/..' . '/../lib/Migration/Version11301Date20191205150729.php',
65
-        'OCA\\Files\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
66
-        'OCA\\Files\\Search\\FilesSearchProvider' => __DIR__ . '/..' . '/../lib/Search/FilesSearchProvider.php',
67
-        'OCA\\Files\\Service\\DirectEditingService' => __DIR__ . '/..' . '/../lib/Service/DirectEditingService.php',
68
-        'OCA\\Files\\Service\\OwnershipTransferService' => __DIR__ . '/..' . '/../lib/Service/OwnershipTransferService.php',
69
-        'OCA\\Files\\Service\\TagService' => __DIR__ . '/..' . '/../lib/Service/TagService.php',
70
-        'OCA\\Files\\Settings\\PersonalSettings' => __DIR__ . '/..' . '/../lib/Settings/PersonalSettings.php',
23
+    public static $classMap = array(
24
+        'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php',
25
+        'OCA\\Files\\Activity\\FavoriteProvider' => __DIR__.'/..'.'/../lib/Activity/FavoriteProvider.php',
26
+        'OCA\\Files\\Activity\\Filter\\Favorites' => __DIR__.'/..'.'/../lib/Activity/Filter/Favorites.php',
27
+        'OCA\\Files\\Activity\\Filter\\FileChanges' => __DIR__.'/..'.'/../lib/Activity/Filter/FileChanges.php',
28
+        'OCA\\Files\\Activity\\Helper' => __DIR__.'/..'.'/../lib/Activity/Helper.php',
29
+        'OCA\\Files\\Activity\\Provider' => __DIR__.'/..'.'/../lib/Activity/Provider.php',
30
+        'OCA\\Files\\Activity\\Settings\\FavoriteAction' => __DIR__.'/..'.'/../lib/Activity/Settings/FavoriteAction.php',
31
+        'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => __DIR__.'/..'.'/../lib/Activity/Settings/FileActivitySettings.php',
32
+        'OCA\\Files\\Activity\\Settings\\FileChanged' => __DIR__.'/..'.'/../lib/Activity/Settings/FileChanged.php',
33
+        'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => __DIR__.'/..'.'/../lib/Activity/Settings/FileFavoriteChanged.php',
34
+        'OCA\\Files\\App' => __DIR__.'/..'.'/../lib/App.php',
35
+        'OCA\\Files\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
36
+        'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupDirectEditingTokens.php',
37
+        'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupFileLocks.php',
38
+        'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => __DIR__.'/..'.'/../lib/BackgroundJob/DeleteOrphanedItems.php',
39
+        'OCA\\Files\\BackgroundJob\\ScanFiles' => __DIR__.'/..'.'/../lib/BackgroundJob/ScanFiles.php',
40
+        'OCA\\Files\\BackgroundJob\\TransferOwnership' => __DIR__.'/..'.'/../lib/BackgroundJob/TransferOwnership.php',
41
+        'OCA\\Files\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php',
42
+        'OCA\\Files\\Collaboration\\Resources\\Listener' => __DIR__.'/..'.'/../lib/Collaboration/Resources/Listener.php',
43
+        'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => __DIR__.'/..'.'/../lib/Collaboration/Resources/ResourceProvider.php',
44
+        'OCA\\Files\\Command\\DeleteOrphanedFiles' => __DIR__.'/..'.'/../lib/Command/DeleteOrphanedFiles.php',
45
+        'OCA\\Files\\Command\\RepairTree' => __DIR__.'/..'.'/../lib/Command/RepairTree.php',
46
+        'OCA\\Files\\Command\\Scan' => __DIR__.'/..'.'/../lib/Command/Scan.php',
47
+        'OCA\\Files\\Command\\ScanAppData' => __DIR__.'/..'.'/../lib/Command/ScanAppData.php',
48
+        'OCA\\Files\\Command\\TransferOwnership' => __DIR__.'/..'.'/../lib/Command/TransferOwnership.php',
49
+        'OCA\\Files\\Controller\\AjaxController' => __DIR__.'/..'.'/../lib/Controller/AjaxController.php',
50
+        'OCA\\Files\\Controller\\ApiController' => __DIR__.'/..'.'/../lib/Controller/ApiController.php',
51
+        'OCA\\Files\\Controller\\DirectEditingController' => __DIR__.'/..'.'/../lib/Controller/DirectEditingController.php',
52
+        'OCA\\Files\\Controller\\DirectEditingViewController' => __DIR__.'/..'.'/../lib/Controller/DirectEditingViewController.php',
53
+        'OCA\\Files\\Controller\\TemplateController' => __DIR__.'/..'.'/../lib/Controller/TemplateController.php',
54
+        'OCA\\Files\\Controller\\TransferOwnershipController' => __DIR__.'/..'.'/../lib/Controller/TransferOwnershipController.php',
55
+        'OCA\\Files\\Controller\\ViewController' => __DIR__.'/..'.'/../lib/Controller/ViewController.php',
56
+        'OCA\\Files\\Db\\TransferOwnership' => __DIR__.'/..'.'/../lib/Db/TransferOwnership.php',
57
+        'OCA\\Files\\Db\\TransferOwnershipMapper' => __DIR__.'/..'.'/../lib/Db/TransferOwnershipMapper.php',
58
+        'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => __DIR__.'/..'.'/../lib/Event/LoadAdditionalScriptsEvent.php',
59
+        'OCA\\Files\\Event\\LoadSidebar' => __DIR__.'/..'.'/../lib/Event/LoadSidebar.php',
60
+        'OCA\\Files\\Exception\\TransferOwnershipException' => __DIR__.'/..'.'/../lib/Exception/TransferOwnershipException.php',
61
+        'OCA\\Files\\Helper' => __DIR__.'/..'.'/../lib/Helper.php',
62
+        'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => __DIR__.'/..'.'/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
63
+        'OCA\\Files\\Listener\\LoadSidebarListener' => __DIR__.'/..'.'/../lib/Listener/LoadSidebarListener.php',
64
+        'OCA\\Files\\Migration\\Version11301Date20191205150729' => __DIR__.'/..'.'/../lib/Migration/Version11301Date20191205150729.php',
65
+        'OCA\\Files\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php',
66
+        'OCA\\Files\\Search\\FilesSearchProvider' => __DIR__.'/..'.'/../lib/Search/FilesSearchProvider.php',
67
+        'OCA\\Files\\Service\\DirectEditingService' => __DIR__.'/..'.'/../lib/Service/DirectEditingService.php',
68
+        'OCA\\Files\\Service\\OwnershipTransferService' => __DIR__.'/..'.'/../lib/Service/OwnershipTransferService.php',
69
+        'OCA\\Files\\Service\\TagService' => __DIR__.'/..'.'/../lib/Service/TagService.php',
70
+        'OCA\\Files\\Settings\\PersonalSettings' => __DIR__.'/..'.'/../lib/Settings/PersonalSettings.php',
71 71
     );
72 72
 
73 73
     public static function getInitializer(ClassLoader $loader)
74 74
     {
75
-        return \Closure::bind(function () use ($loader) {
75
+        return \Closure::bind(function() use ($loader) {
76 76
             $loader->prefixLengthsPsr4 = ComposerStaticInitFiles::$prefixLengthsPsr4;
77 77
             $loader->prefixDirsPsr4 = ComposerStaticInitFiles::$prefixDirsPsr4;
78 78
             $loader->classMap = ComposerStaticInitFiles::$classMap;
Please login to merge, or discard this patch.
apps/files/composer/composer/autoload_classmap.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -6,51 +6,51 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
-    'OCA\\Files\\Activity\\FavoriteProvider' => $baseDir . '/../lib/Activity/FavoriteProvider.php',
11
-    'OCA\\Files\\Activity\\Filter\\Favorites' => $baseDir . '/../lib/Activity/Filter/Favorites.php',
12
-    'OCA\\Files\\Activity\\Filter\\FileChanges' => $baseDir . '/../lib/Activity/Filter/FileChanges.php',
13
-    'OCA\\Files\\Activity\\Helper' => $baseDir . '/../lib/Activity/Helper.php',
14
-    'OCA\\Files\\Activity\\Provider' => $baseDir . '/../lib/Activity/Provider.php',
15
-    'OCA\\Files\\Activity\\Settings\\FavoriteAction' => $baseDir . '/../lib/Activity/Settings/FavoriteAction.php',
16
-    'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => $baseDir . '/../lib/Activity/Settings/FileActivitySettings.php',
17
-    'OCA\\Files\\Activity\\Settings\\FileChanged' => $baseDir . '/../lib/Activity/Settings/FileChanged.php',
18
-    'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => $baseDir . '/../lib/Activity/Settings/FileFavoriteChanged.php',
19
-    'OCA\\Files\\App' => $baseDir . '/../lib/App.php',
20
-    'OCA\\Files\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
21
-    'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => $baseDir . '/../lib/BackgroundJob/CleanupDirectEditingTokens.php',
22
-    'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir . '/../lib/BackgroundJob/CleanupFileLocks.php',
23
-    'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir . '/../lib/BackgroundJob/DeleteOrphanedItems.php',
24
-    'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir . '/../lib/BackgroundJob/ScanFiles.php',
25
-    'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir . '/../lib/BackgroundJob/TransferOwnership.php',
26
-    'OCA\\Files\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
27
-    'OCA\\Files\\Collaboration\\Resources\\Listener' => $baseDir . '/../lib/Collaboration/Resources/Listener.php',
28
-    'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => $baseDir . '/../lib/Collaboration/Resources/ResourceProvider.php',
29
-    'OCA\\Files\\Command\\DeleteOrphanedFiles' => $baseDir . '/../lib/Command/DeleteOrphanedFiles.php',
30
-    'OCA\\Files\\Command\\RepairTree' => $baseDir . '/../lib/Command/RepairTree.php',
31
-    'OCA\\Files\\Command\\Scan' => $baseDir . '/../lib/Command/Scan.php',
32
-    'OCA\\Files\\Command\\ScanAppData' => $baseDir . '/../lib/Command/ScanAppData.php',
33
-    'OCA\\Files\\Command\\TransferOwnership' => $baseDir . '/../lib/Command/TransferOwnership.php',
34
-    'OCA\\Files\\Controller\\AjaxController' => $baseDir . '/../lib/Controller/AjaxController.php',
35
-    'OCA\\Files\\Controller\\ApiController' => $baseDir . '/../lib/Controller/ApiController.php',
36
-    'OCA\\Files\\Controller\\DirectEditingController' => $baseDir . '/../lib/Controller/DirectEditingController.php',
37
-    'OCA\\Files\\Controller\\DirectEditingViewController' => $baseDir . '/../lib/Controller/DirectEditingViewController.php',
38
-    'OCA\\Files\\Controller\\TemplateController' => $baseDir . '/../lib/Controller/TemplateController.php',
39
-    'OCA\\Files\\Controller\\TransferOwnershipController' => $baseDir . '/../lib/Controller/TransferOwnershipController.php',
40
-    'OCA\\Files\\Controller\\ViewController' => $baseDir . '/../lib/Controller/ViewController.php',
41
-    'OCA\\Files\\Db\\TransferOwnership' => $baseDir . '/../lib/Db/TransferOwnership.php',
42
-    'OCA\\Files\\Db\\TransferOwnershipMapper' => $baseDir . '/../lib/Db/TransferOwnershipMapper.php',
43
-    'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => $baseDir . '/../lib/Event/LoadAdditionalScriptsEvent.php',
44
-    'OCA\\Files\\Event\\LoadSidebar' => $baseDir . '/../lib/Event/LoadSidebar.php',
45
-    'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir . '/../lib/Exception/TransferOwnershipException.php',
46
-    'OCA\\Files\\Helper' => $baseDir . '/../lib/Helper.php',
47
-    'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => $baseDir . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
48
-    'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir . '/../lib/Listener/LoadSidebarListener.php',
49
-    'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir . '/../lib/Migration/Version11301Date20191205150729.php',
50
-    'OCA\\Files\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
51
-    'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir . '/../lib/Search/FilesSearchProvider.php',
52
-    'OCA\\Files\\Service\\DirectEditingService' => $baseDir . '/../lib/Service/DirectEditingService.php',
53
-    'OCA\\Files\\Service\\OwnershipTransferService' => $baseDir . '/../lib/Service/OwnershipTransferService.php',
54
-    'OCA\\Files\\Service\\TagService' => $baseDir . '/../lib/Service/TagService.php',
55
-    'OCA\\Files\\Settings\\PersonalSettings' => $baseDir . '/../lib/Settings/PersonalSettings.php',
9
+    'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php',
10
+    'OCA\\Files\\Activity\\FavoriteProvider' => $baseDir.'/../lib/Activity/FavoriteProvider.php',
11
+    'OCA\\Files\\Activity\\Filter\\Favorites' => $baseDir.'/../lib/Activity/Filter/Favorites.php',
12
+    'OCA\\Files\\Activity\\Filter\\FileChanges' => $baseDir.'/../lib/Activity/Filter/FileChanges.php',
13
+    'OCA\\Files\\Activity\\Helper' => $baseDir.'/../lib/Activity/Helper.php',
14
+    'OCA\\Files\\Activity\\Provider' => $baseDir.'/../lib/Activity/Provider.php',
15
+    'OCA\\Files\\Activity\\Settings\\FavoriteAction' => $baseDir.'/../lib/Activity/Settings/FavoriteAction.php',
16
+    'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => $baseDir.'/../lib/Activity/Settings/FileActivitySettings.php',
17
+    'OCA\\Files\\Activity\\Settings\\FileChanged' => $baseDir.'/../lib/Activity/Settings/FileChanged.php',
18
+    'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => $baseDir.'/../lib/Activity/Settings/FileFavoriteChanged.php',
19
+    'OCA\\Files\\App' => $baseDir.'/../lib/App.php',
20
+    'OCA\\Files\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php',
21
+    'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => $baseDir.'/../lib/BackgroundJob/CleanupDirectEditingTokens.php',
22
+    'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir.'/../lib/BackgroundJob/CleanupFileLocks.php',
23
+    'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir.'/../lib/BackgroundJob/DeleteOrphanedItems.php',
24
+    'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir.'/../lib/BackgroundJob/ScanFiles.php',
25
+    'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir.'/../lib/BackgroundJob/TransferOwnership.php',
26
+    'OCA\\Files\\Capabilities' => $baseDir.'/../lib/Capabilities.php',
27
+    'OCA\\Files\\Collaboration\\Resources\\Listener' => $baseDir.'/../lib/Collaboration/Resources/Listener.php',
28
+    'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => $baseDir.'/../lib/Collaboration/Resources/ResourceProvider.php',
29
+    'OCA\\Files\\Command\\DeleteOrphanedFiles' => $baseDir.'/../lib/Command/DeleteOrphanedFiles.php',
30
+    'OCA\\Files\\Command\\RepairTree' => $baseDir.'/../lib/Command/RepairTree.php',
31
+    'OCA\\Files\\Command\\Scan' => $baseDir.'/../lib/Command/Scan.php',
32
+    'OCA\\Files\\Command\\ScanAppData' => $baseDir.'/../lib/Command/ScanAppData.php',
33
+    'OCA\\Files\\Command\\TransferOwnership' => $baseDir.'/../lib/Command/TransferOwnership.php',
34
+    'OCA\\Files\\Controller\\AjaxController' => $baseDir.'/../lib/Controller/AjaxController.php',
35
+    'OCA\\Files\\Controller\\ApiController' => $baseDir.'/../lib/Controller/ApiController.php',
36
+    'OCA\\Files\\Controller\\DirectEditingController' => $baseDir.'/../lib/Controller/DirectEditingController.php',
37
+    'OCA\\Files\\Controller\\DirectEditingViewController' => $baseDir.'/../lib/Controller/DirectEditingViewController.php',
38
+    'OCA\\Files\\Controller\\TemplateController' => $baseDir.'/../lib/Controller/TemplateController.php',
39
+    'OCA\\Files\\Controller\\TransferOwnershipController' => $baseDir.'/../lib/Controller/TransferOwnershipController.php',
40
+    'OCA\\Files\\Controller\\ViewController' => $baseDir.'/../lib/Controller/ViewController.php',
41
+    'OCA\\Files\\Db\\TransferOwnership' => $baseDir.'/../lib/Db/TransferOwnership.php',
42
+    'OCA\\Files\\Db\\TransferOwnershipMapper' => $baseDir.'/../lib/Db/TransferOwnershipMapper.php',
43
+    'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => $baseDir.'/../lib/Event/LoadAdditionalScriptsEvent.php',
44
+    'OCA\\Files\\Event\\LoadSidebar' => $baseDir.'/../lib/Event/LoadSidebar.php',
45
+    'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir.'/../lib/Exception/TransferOwnershipException.php',
46
+    'OCA\\Files\\Helper' => $baseDir.'/../lib/Helper.php',
47
+    'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => $baseDir.'/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
48
+    'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir.'/../lib/Listener/LoadSidebarListener.php',
49
+    'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir.'/../lib/Migration/Version11301Date20191205150729.php',
50
+    'OCA\\Files\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php',
51
+    'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir.'/../lib/Search/FilesSearchProvider.php',
52
+    'OCA\\Files\\Service\\DirectEditingService' => $baseDir.'/../lib/Service/DirectEditingService.php',
53
+    'OCA\\Files\\Service\\OwnershipTransferService' => $baseDir.'/../lib/Service/OwnershipTransferService.php',
54
+    'OCA\\Files\\Service\\TagService' => $baseDir.'/../lib/Service/TagService.php',
55
+    'OCA\\Files\\Settings\\PersonalSettings' => $baseDir.'/../lib/Settings/PersonalSettings.php',
56 56
 );
Please login to merge, or discard this patch.
apps/files/appinfo/routes.php 1 patch
Indentation   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -39,142 +39,142 @@
 block discarded – undo
39 39
 /** @var Application $application */
40 40
 $application = \OC::$server->query(Application::class);
41 41
 $application->registerRoutes(
42
-	$this,
43
-	[
44
-		'routes' => [
45
-			[
46
-				'name' => 'View#showFile',
47
-				'url' => '/f/{fileid}',
48
-				'verb' => 'GET',
49
-				'root' => '',
50
-			],
42
+    $this,
43
+    [
44
+        'routes' => [
45
+            [
46
+                'name' => 'View#showFile',
47
+                'url' => '/f/{fileid}',
48
+                'verb' => 'GET',
49
+                'root' => '',
50
+            ],
51 51
 
52
-			[
53
-				'name' => 'API#getThumbnail',
54
-				'url' => '/api/v1/thumbnail/{x}/{y}/{file}',
55
-				'verb' => 'GET',
56
-				'requirements' => ['file' => '.+']
57
-			],
58
-			[
59
-				'name' => 'API#updateFileTags',
60
-				'url' => '/api/v1/files/{path}',
61
-				'verb' => 'POST',
62
-				'requirements' => ['path' => '.+'],
63
-			],
64
-			[
65
-				'name' => 'API#getRecentFiles',
66
-				'url' => '/api/v1/recent/',
67
-				'verb' => 'GET'
68
-			],
69
-			[
70
-				'name' => 'API#updateFileSorting',
71
-				'url' => '/api/v1/sorting',
72
-				'verb' => 'POST'
73
-			],
74
-			[
75
-				'name' => 'API#showHiddenFiles',
76
-				'url' => '/api/v1/showhidden',
77
-				'verb' => 'POST'
78
-			],
79
-			[
80
-				'name' => 'API#cropImagePreviews',
81
-				'url' => '/api/v1/cropimagepreviews',
82
-				'verb' => 'POST'
83
-			],
84
-			[
85
-				'name' => 'API#showGridView',
86
-				'url' => '/api/v1/showgridview',
87
-				'verb' => 'POST'
88
-			],
89
-			[
90
-				'name' => 'API#getGridView',
91
-				'url' => '/api/v1/showgridview',
92
-				'verb' => 'GET'
93
-			],
94
-			[
95
-				'name' => 'view#index',
96
-				'url' => '/',
97
-				'verb' => 'GET',
98
-			],
99
-			[
100
-				'name' => 'ajax#getStorageStats',
101
-				'url' => '/ajax/getstoragestats.php',
102
-				'verb' => 'GET',
103
-			],
104
-			[
105
-				'name' => 'API#toggleShowFolder',
106
-				'url' => '/api/v1/toggleShowFolder/{key}',
107
-				'verb' => 'POST'
108
-			],
109
-			[
110
-				'name' => 'API#getNodeType',
111
-				'url' => '/api/v1/quickaccess/get/NodeType',
112
-				'verb' => 'GET',
113
-			],
114
-			[
115
-				'name' => 'DirectEditingView#edit',
116
-				'url' => '/directEditing/{token}',
117
-				'verb' => 'GET'
118
-			],
119
-		],
120
-		'ocs' => [
121
-			[
122
-				'name' => 'DirectEditing#info',
123
-				'url' => '/api/v1/directEditing',
124
-				'verb' => 'GET'
125
-			],
126
-			[
127
-				'name' => 'DirectEditing#templates',
128
-				'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
129
-				'verb' => 'GET'
130
-			],
131
-			[
132
-				'name' => 'DirectEditing#open',
133
-				'url' => '/api/v1/directEditing/open',
134
-				'verb' => 'POST'
135
-			],
136
-			[
137
-				'name' => 'DirectEditing#create',
138
-				'url' => '/api/v1/directEditing/create',
139
-				'verb' => 'POST'
140
-			],
141
-			[
142
-				'name' => 'Template#list',
143
-				'url' => '/api/v1/templates',
144
-				'verb' => 'GET'
145
-			],
146
-			[
147
-				'name' => 'Template#create',
148
-				'url' => '/api/v1/templates/create',
149
-				'verb' => 'POST'
150
-			],
151
-			[
152
-				'name' => 'Template#path',
153
-				'url' => '/api/v1/templates/path',
154
-				'verb' => 'POST'
155
-			],
156
-			[
157
-				'name' => 'TransferOwnership#transfer',
158
-				'url' => '/api/v1/transferownership',
159
-				'verb' => 'POST',
160
-			],
161
-			[
162
-				'name' => 'TransferOwnership#accept',
163
-				'url' => '/api/v1/transferownership/{id}',
164
-				'verb' => 'POST',
165
-			],
166
-			[
167
-				'name' => 'TransferOwnership#reject',
168
-				'url' => '/api/v1/transferownership/{id}',
169
-				'verb' => 'DELETE',
170
-			],
171
-		],
172
-	]
52
+            [
53
+                'name' => 'API#getThumbnail',
54
+                'url' => '/api/v1/thumbnail/{x}/{y}/{file}',
55
+                'verb' => 'GET',
56
+                'requirements' => ['file' => '.+']
57
+            ],
58
+            [
59
+                'name' => 'API#updateFileTags',
60
+                'url' => '/api/v1/files/{path}',
61
+                'verb' => 'POST',
62
+                'requirements' => ['path' => '.+'],
63
+            ],
64
+            [
65
+                'name' => 'API#getRecentFiles',
66
+                'url' => '/api/v1/recent/',
67
+                'verb' => 'GET'
68
+            ],
69
+            [
70
+                'name' => 'API#updateFileSorting',
71
+                'url' => '/api/v1/sorting',
72
+                'verb' => 'POST'
73
+            ],
74
+            [
75
+                'name' => 'API#showHiddenFiles',
76
+                'url' => '/api/v1/showhidden',
77
+                'verb' => 'POST'
78
+            ],
79
+            [
80
+                'name' => 'API#cropImagePreviews',
81
+                'url' => '/api/v1/cropimagepreviews',
82
+                'verb' => 'POST'
83
+            ],
84
+            [
85
+                'name' => 'API#showGridView',
86
+                'url' => '/api/v1/showgridview',
87
+                'verb' => 'POST'
88
+            ],
89
+            [
90
+                'name' => 'API#getGridView',
91
+                'url' => '/api/v1/showgridview',
92
+                'verb' => 'GET'
93
+            ],
94
+            [
95
+                'name' => 'view#index',
96
+                'url' => '/',
97
+                'verb' => 'GET',
98
+            ],
99
+            [
100
+                'name' => 'ajax#getStorageStats',
101
+                'url' => '/ajax/getstoragestats.php',
102
+                'verb' => 'GET',
103
+            ],
104
+            [
105
+                'name' => 'API#toggleShowFolder',
106
+                'url' => '/api/v1/toggleShowFolder/{key}',
107
+                'verb' => 'POST'
108
+            ],
109
+            [
110
+                'name' => 'API#getNodeType',
111
+                'url' => '/api/v1/quickaccess/get/NodeType',
112
+                'verb' => 'GET',
113
+            ],
114
+            [
115
+                'name' => 'DirectEditingView#edit',
116
+                'url' => '/directEditing/{token}',
117
+                'verb' => 'GET'
118
+            ],
119
+        ],
120
+        'ocs' => [
121
+            [
122
+                'name' => 'DirectEditing#info',
123
+                'url' => '/api/v1/directEditing',
124
+                'verb' => 'GET'
125
+            ],
126
+            [
127
+                'name' => 'DirectEditing#templates',
128
+                'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
129
+                'verb' => 'GET'
130
+            ],
131
+            [
132
+                'name' => 'DirectEditing#open',
133
+                'url' => '/api/v1/directEditing/open',
134
+                'verb' => 'POST'
135
+            ],
136
+            [
137
+                'name' => 'DirectEditing#create',
138
+                'url' => '/api/v1/directEditing/create',
139
+                'verb' => 'POST'
140
+            ],
141
+            [
142
+                'name' => 'Template#list',
143
+                'url' => '/api/v1/templates',
144
+                'verb' => 'GET'
145
+            ],
146
+            [
147
+                'name' => 'Template#create',
148
+                'url' => '/api/v1/templates/create',
149
+                'verb' => 'POST'
150
+            ],
151
+            [
152
+                'name' => 'Template#path',
153
+                'url' => '/api/v1/templates/path',
154
+                'verb' => 'POST'
155
+            ],
156
+            [
157
+                'name' => 'TransferOwnership#transfer',
158
+                'url' => '/api/v1/transferownership',
159
+                'verb' => 'POST',
160
+            ],
161
+            [
162
+                'name' => 'TransferOwnership#accept',
163
+                'url' => '/api/v1/transferownership/{id}',
164
+                'verb' => 'POST',
165
+            ],
166
+            [
167
+                'name' => 'TransferOwnership#reject',
168
+                'url' => '/api/v1/transferownership/{id}',
169
+                'verb' => 'DELETE',
170
+            ],
171
+        ],
172
+    ]
173 173
 );
174 174
 
175 175
 /** @var $this \OC\Route\Router */
176 176
 
177 177
 $this->create('files_ajax_download', 'apps/files/ajax/download.php')
178
-	->actionInclude('files/ajax/download.php');
178
+    ->actionInclude('files/ajax/download.php');
179 179
 $this->create('files_ajax_list', 'apps/files/ajax/list.php')
180
-	->actionInclude('files/ajax/list.php');
180
+    ->actionInclude('files/ajax/list.php');
Please login to merge, or discard this patch.