-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Julius Härtl <[email protected]>
- Loading branch information
1 parent
fe0c503
commit 32f5879
Showing
1 changed file
with
15 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* @copyright Copyright (c) 2018, Roeland Jago Douma <[email protected]> | ||
* | ||
|
@@ -26,7 +28,6 @@ | |
use OCA\Richdocuments\Service\CapabilitiesService; | ||
use OCP\App\IAppManager; | ||
use OCP\Capabilities\ICapability; | ||
use OCP\IL10N; | ||
use OCP\IURLGenerator; | ||
|
||
class Capabilities implements ICapability { | ||
|
@@ -66,7 +67,7 @@ class Capabilities implements ICapability { | |
'application/vnd.ms-powerpoint.presentation.macroEnabled.12', | ||
'application/vnd.ms-powerpoint.template.macroEnabled.12', | ||
'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', | ||
'text/csv' | ||
'text/csv', | ||
]; | ||
|
||
public const MIMETYPES_OPTIONAL = [ | ||
|
@@ -95,24 +96,16 @@ class Capabilities implements ICapability { | |
'application/pdf', | ||
]; | ||
|
||
private IL10N $l10n; | ||
private AppConfig $config; | ||
private CapabilitiesService $capabilitiesService; | ||
private PermissionManager $permissionManager; | ||
private IURLGenerator $urlGenerator; | ||
private IAppManager $appManager; | ||
private ?string $userId = null; | ||
|
||
private $capabilities = null; | ||
private ?array $capabilities = null; | ||
|
||
public function __construct(IL10N $l10n, AppConfig $config, CapabilitiesService $capabilitiesService, PermissionManager $permissionManager, IAppManager $appManager, ?string $userId, IURLGenerator $urlGenerator) { | ||
$this->l10n = $l10n; | ||
$this->config = $config; | ||
$this->capabilitiesService = $capabilitiesService; | ||
$this->permissionManager = $permissionManager; | ||
$this->appManager = $appManager; | ||
$this->userId = $userId; | ||
$this->urlGenerator = $urlGenerator; | ||
public function __construct( | ||
private AppConfig $config, | ||
private CapabilitiesService $capabilitiesService, | ||
private PermissionManager $permissionManager, | ||
private IAppManager $appManager, | ||
private ?string $userId, | ||
private IURLGenerator $urlGenerator | ||
) { | ||
} | ||
|
||
public function getCapabilities() { | ||
|
@@ -140,13 +133,13 @@ public function getCapabilities() { | |
|
||
$this->capabilities = [ | ||
'richdocuments' => [ | ||
'version' => \OC::$server->getAppManager()->getAppVersion('richdocuments'), | ||
'version' => $this->appManager->getAppVersion('richdocuments'), | ||
'mimetypes' => array_values($filteredMimetypes), | ||
'mimetypesNoDefaultOpen' => array_values($optionalMimetypes), | ||
'mimetypesSecureView' => $this->config->useSecureViewAdditionalMimes() ? self::SECURE_VIEW_ADDITIONAL_MIMES : [], | ||
'collabora' => $collaboraCapabilities, | ||
'direct_editing' => isset($collaboraCapabilities['hasMobileSupport']) ?: false, | ||
'templates' => isset($collaboraCapabilities['hasTemplateSaveAs']) || isset($collaboraCapabilities['hasTemplateSource']) ?: false, | ||
'direct_editing' => $collaboraCapabilities['hasMobileSupport'] ?? false, | ||
'templates' => ($collaboraCapabilities['hasTemplateSaveAs'] ?? false) || ($collaboraCapabilities['hasTemplateSource'] ?? false), | ||
'productName' => $this->capabilitiesService->getProductName(), | ||
'editonline_endpoint' => $this->urlGenerator->linkToRouteAbsolute('richdocuments.document.editOnline'), | ||
'config' => [ | ||
|