mirror of
https://github.com/LibreOffice/online.git
synced 2025-08-20 23:24:34 +00:00
Pass Disable{Print,Export,Copy} options to client and handle them
Change-Id: I59a9432bbdd06d8b184f96882c5f4009fcd0be54
This commit is contained in:
@ -52,13 +52,20 @@ L.Map.include({
|
||||
return;
|
||||
}
|
||||
|
||||
id = id || 'export'; // not any special download, simple export
|
||||
|
||||
if ((id === 'print' && this['wopi'].DisablePrint) ||
|
||||
(id === 'export' && this['wopi'].DisableExport)) {
|
||||
this.hideBusy();
|
||||
return;
|
||||
}
|
||||
|
||||
if (format === undefined || format === null) {
|
||||
format = '';
|
||||
}
|
||||
if (options === undefined || options === null) {
|
||||
options = '';
|
||||
}
|
||||
id = id || 'export'; // not any special download, simple export
|
||||
|
||||
this.showBusy(_('Downloading...'), false);
|
||||
this._socket.sendMessage('downloadas ' +
|
||||
|
@ -10,6 +10,9 @@ L.Map.WOPI = L.Handler.extend({
|
||||
HidePrintOption: false,
|
||||
HideSaveOption: false,
|
||||
HideExportOption: false,
|
||||
DisablePrint: false,
|
||||
DisableExport: false,
|
||||
DisableCopy: false,
|
||||
|
||||
_appLoadedConditions: {
|
||||
doclayerinit: false,
|
||||
@ -57,6 +60,9 @@ L.Map.WOPI = L.Handler.extend({
|
||||
this.HidePrintOption = !!wopiInfo['HidePrintOption'];
|
||||
this.HideSaveOption = !!wopiInfo['HideSaveOption'];
|
||||
this.HideExportOption = !!wopiInfo['HideExportOption'];
|
||||
this.DisablePrint = !!wopiInfo['DisablePrint'];
|
||||
this.DisableExport = !!wopiInfo['DisableExport'];
|
||||
this.DisableCopy = !!wopiInfo['DisableCopy'];
|
||||
|
||||
this._map.fire('postMessage', {msgId: 'App_LoadingStatus', args: {Status: 'Frame_Ready'}});
|
||||
},
|
||||
|
@ -269,6 +269,9 @@ bool DocumentBroker::load(std::shared_ptr<ClientSession>& session, const std::st
|
||||
wopiInfo->set("HidePrintOption", wopifileinfo->_hidePrintOption);
|
||||
wopiInfo->set("HideSaveOption", wopifileinfo->_hideSaveOption);
|
||||
wopiInfo->set("HideExportOption", wopifileinfo->_hideExportOption);
|
||||
wopiInfo->set("DisablePrint", wopifileinfo->_disablePrint);
|
||||
wopiInfo->set("DisableExport", wopifileinfo->_disableExport);
|
||||
wopiInfo->set("DisableCopy", wopifileinfo->_disableCopy);
|
||||
|
||||
std::ostringstream ossWopiInfo;
|
||||
wopiInfo->stringify(ossWopiInfo);
|
||||
|
Reference in New Issue
Block a user