Skip to content

Commit

Permalink
fix: Add config option to disable edit locally
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and lpranam committed Mar 8, 2024
1 parent 63042e6 commit ba917a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Service/InitialStateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function provideDocument(Wopi $wopi, array $params): void {
$this->initialState->provideInitialState('theming-customLogo', ($logoSet ?
\OC::$server->getURLGenerator()->getAbsoluteURL(\OC::$server->getThemingDefaults()->getLogo())
: false));
$this->initialState->provideInitialState('open_local_editor', $this->config->getAppValue(Application::APPNAME, 'open_local_editor', 'yes') === 'yes');
}

public function prepareParams(array $params): array {
Expand Down
10 changes: 10 additions & 0 deletions src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ export default {
documentReady() {
this.loading = LOADING_STATE.DOCUMENT_READY
clearTimeout(this.loadingTimeout)
if (loadState('richdocuments', 'open_local_editor', true)) {
this.sendPostMessage('Insert_Button', {
id: 'Open_Local_Editor',
imgurl: window.location.protocol + '//' + getNextcloudUrl() + imagePath('richdocuments', 'launch.svg'),
mobile: false,
label: t('richdocuments', 'Open in local editor'),
hint: t('richdocuments', 'Open in local editor'),
insertBefore: 'print',
})
}
},
async share() {
FilesAppIntegration.share()
Expand Down

0 comments on commit ba917a4

Please sign in to comment.