Merge pull request #270 from ONLYOFFICE/feature/hide-history-for-anonymous

Feature/hide history for anonymous
This commit is contained in:
Sergey Linnik
2022-03-22 11:54:12 +03:00
committed by GitHub
8 changed files with 121 additions and 124 deletions

View File

@ -516,24 +516,24 @@
$history = $out[0];
$historyData = $out[1];
?>
<?php if ($history != null && $historyData != null): ?>
// the user is trying to show the document version history
config.events['onRequestHistory'] = function () {
docEditor.refreshHistory(<?php echo json_encode($history) ?>); // show the document version history
};
// the user is trying to click the specific document version in the document version history
config.events['onRequestHistoryData'] = function (event) {
var ver = event.data;
var histData = <?php echo json_encode($historyData) ?>;
docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history
};
// the user is trying to go back to the document from viewing the document version history
config.events['onRequestHistoryClose'] = function () {
document.location.reload();
};
<?php endif; ?>
<?php if ($usersForMentions != null): ?>
<?php if ($history != null && $historyData != null): ?>
// the user is trying to show the document version history
config.events['onRequestHistory'] = function () {
docEditor.refreshHistory(<?php echo json_encode($history) ?>); // show the document version history
};
// the user is trying to click the specific document version in the document version history
config.events['onRequestHistoryData'] = function (event) {
var ver = event.data;
var histData = <?php echo json_encode($historyData) ?>;
docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history
};
// the user is trying to go back to the document from viewing the document version history
config.events['onRequestHistoryClose'] = function () {
document.location.reload();
};
<?php endif; ?>
// add mentions for not anonymous users
config.events['onRequestUsers'] = function () {
docEditor.setUsers({ // set a list of users to mention in the comments