diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-02-15 16:16:54 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-02-20 12:16:34 +0100 |
commit | 614981ae9abbfed04b9d1b3663f7e9d0aa85404c (patch) | |
tree | a10819a57f5f7a04a2fbf8430b5c5f37cf01120b /apps/files/lib | |
parent | 6bb0985e59d7ba3c4cf9928d8bb766ac9975cd12 (diff) | |
download | nextcloud-server-614981ae9abbfed04b9d1b3663f7e9d0aa85404c.tar.gz nextcloud-server-614981ae9abbfed04b9d1b3663f7e9d0aa85404c.zip |
feat(directediting): Allow opening by file id
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Controller/DirectEditingController.php | 5 | ||||
-rw-r--r-- | apps/files/lib/DirectEditingCapabilities.php | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/files/lib/Controller/DirectEditingController.php b/apps/files/lib/Controller/DirectEditingController.php index c67150be8d4..9b48d6958aa 100644 --- a/apps/files/lib/Controller/DirectEditingController.php +++ b/apps/files/lib/Controller/DirectEditingController.php @@ -35,7 +35,6 @@ use OCP\IRequest; use OCP\IURLGenerator; class DirectEditingController extends OCSController { - /** @var IEventDispatcher */ private $eventDispatcher; @@ -94,14 +93,14 @@ class DirectEditingController extends OCSController { /** * @NoAdminRequired */ - public function open(string $path, string $editorId = null): DataResponse { + public function open(string $path, string $editorId = null, ?int $fileId = null): DataResponse { if (!$this->directEditingManager->isEnabled()) { return new DataResponse(['message' => 'Direct editing is not enabled'], Http::STATUS_INTERNAL_SERVER_ERROR); } $this->eventDispatcher->dispatchTyped(new RegisterDirectEditorEvent($this->directEditingManager)); try { - $token = $this->directEditingManager->open($path, $editorId); + $token = $this->directEditingManager->open($path, $editorId, $fileId); return new DataResponse([ 'url' => $this->urlGenerator->linkToRouteAbsolute('files.DirectEditingView.edit', ['token' => $token]) ]); diff --git a/apps/files/lib/DirectEditingCapabilities.php b/apps/files/lib/DirectEditingCapabilities.php index 782f7019ac7..10c8e95105a 100644 --- a/apps/files/lib/DirectEditingCapabilities.php +++ b/apps/files/lib/DirectEditingCapabilities.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** * @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net> @@ -29,7 +30,6 @@ use OCP\Capabilities\IInitialStateExcludedCapability; use OCP\IURLGenerator; class DirectEditingCapabilities implements ICapability, IInitialStateExcludedCapability { - protected DirectEditingService $directEditingService; protected IURLGenerator $urlGenerator; @@ -43,7 +43,8 @@ class DirectEditingCapabilities implements ICapability, IInitialStateExcludedCap 'files' => [ 'directEditing' => [ 'url' => $this->urlGenerator->linkToOCSRouteAbsolute('files.DirectEditing.info'), - 'etag' => $this->directEditingService->getDirectEditingETag() + 'etag' => $this->directEditingService->getDirectEditingETag(), + 'supportsFileId' => true, ] ], ]; |