diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-04-27 20:46:09 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-05-20 14:58:38 +0300 |
commit | ef3ec7483d52edfa23c61c6389905b620b317cf0 (patch) | |
tree | 934f2ad9e03a1f1240a04041ad976c63426f9559 /lib | |
parent | abf68fa075432ec33bba0b05c4851b9ea15771e5 (diff) |
Expose config without extra http call
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Capabilities.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 43eb427b..fc0d9d5f 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -81,6 +81,8 @@ class Capabilities implements ICapability { /** @var IL10N */ private $l10n; + /** @var AppConfig */ + private $config; /** * Capabilities constructor. @@ -88,8 +90,9 @@ class Capabilities implements ICapability { * @param IAppData $appData * @throws \OCP\Files\NotPermittedException */ - public function __construct(IAppData $appData, IL10N $l10n) { + public function __construct(IAppData $appData, IL10N $l10n, AppConfig $config) { $this->l10n = $l10n; + $this->config = $config; try { $this->appData = $appData->getFolder('richdocuments'); } catch (NotFoundException $e) { @@ -107,6 +110,14 @@ class Capabilities implements ICapability { 'direct_editing' => isset($collaboraCapabilities['hasMobileSupport']) ? : false, 'templates' => isset($collaboraCapabilities['hasTemplateSaveAs']) || isset($collaboraCapabilities['hasTemplateSource']) ? : false, 'productName' => isset($collaboraCapabilities['productName']) ? $collaboraCapabilities['productName'] : $this->l10n->t('Collabora Online'), + 'config' => [ + 'wopi_url' => $this->config->getAppValue('wopi_url'), + 'public_wopi_url' => $this->config->getAppValue('public_wopi_url'), + 'disable_certificate_verification' => $this->config->getAppValue('disable_certificate_verification'), + 'edit_groups' => $this->config->getAppValue('edit_groups'), + 'use_groups' => $this->config->getAppValue('use_groups'), + 'doc_format' => $this->config->getAppValue('doc_format'), + ] ], ]; } |