Add Config for Open With Capability #4977
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I installed Nextcloud Office on my Nextcloud instance. Anyway, most of the time I simply want to download the file and view or edit it locally. Even more, this applies to receivers of share links.
Therefore, this pull request adds one system config property to control the behavior of the Nextcloud Office app to open all kind of files by default. When setting the property "richdocuments_optional_mimetypes" to "all" or an array of mimetypes files are simply downloaded.
In addition, I made the context menu function "Edit with Nextcloud Office" a little more flexible to apply to all of the mimetypes that Nextcloud Office is capable to open but does not open by default. Thanks to that change, I'm still able to use Nextcloud Office on demand.
This is somewhat of a prototype. Nonetheless, I hope it helps someone to integrate a similar feature.
Checklist