Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ONLYOFFICE/onlyoffice-nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Linnik <sergey.linnik@onlyoffice.com>2019-06-24 15:21:23 +0300
committerGitHub <noreply@github.com>2019-06-24 15:21:23 +0300
commit9a81db9fe2525683bdd1c9998e8884a2344057b6 (patch)
treeaf09db6a53003a1d7ca79499ec835bdf355739ef
parent28a6310a3e4f7c0114e8887329315cb65fe3f599 (diff)
parentf37f62bfadba29317ca7cc73ccf92acd79ab1b22 (diff)
Merge pull request #97 from ONLYOFFICE/developv2.3.0
Release/2.3.0
-rw-r--r--CHANGELOG.md10
-rw-r--r--README.md79
-rw-r--r--appinfo/info.xml4
-rw-r--r--appinfo/routes.php3
-rw-r--r--controller/callbackcontroller.php38
-rw-r--r--controller/editorcontroller.php48
-rw-r--r--controller/settingscontroller.php94
-rw-r--r--css/settings.css20
-rw-r--r--js/desktop.js3
-rw-r--r--js/main.js45
-rw-r--r--js/settings.js75
-rw-r--r--l10n/de.js11
-rw-r--r--l10n/de.json11
-rw-r--r--l10n/de_DE.js11
-rw-r--r--l10n/de_DE.json11
-rw-r--r--l10n/es.js11
-rw-r--r--l10n/es.json11
-rw-r--r--l10n/fr.js11
-rw-r--r--l10n/fr.json11
-rw-r--r--l10n/ru.js11
-rw-r--r--l10n/ru.json11
-rw-r--r--lib/appconfig.php157
-rw-r--r--lib/documentservice.php27
-rw-r--r--settings.php43
-rw-r--r--templates/settings.php96
25 files changed, 641 insertions, 211 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a63a8b..430582f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
# Change Log
+## 2.3.0
+## Added
+- editor customization
+
+## Changed
+- the settings page is splitted into two sections
+- support master key encryption
+- fix getting domain for desktop
+- title in the convertation request
+
## 2.1.10
## Changed
- compatible with Nextcloud 16
diff --git a/README.md b/README.md
index bf7bc63..aee82bd 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,14 @@
-# ![](screenshots/icon.png) Nextcloud ONLYOFFICE integration app
+# ![](screenshots/icon.png) Nextcloud-ONLYOFFICE integration app
+
+* [Overview](#overview)
+* [Installing ONLYOFFICE Document Server](#installing-onlyoffice-document-server)
+* [ONLYOFFICE Document Server editions](#onlyoffice-document-server-editions)
+* [Installing Nextcloud-ONLYOFFICE integration app](#installing-nextcloud-onlyoffice-integration-app)
+* [Configuring Nextcloud-ONLYOFFICE integration app](#configuring-nextcloud-onlyoffice-integration-app)
+* [How it works](#how-it-works)
+* [Known issues](#known-issues)
+
+# Overview
This app enables users to edit office documents from [Nextcloud](https://nextcloud.com) using ONLYOFFICE Document Server.
Currently the following document formats can be edited with this app: csv, docx, pptx, txt, xlsx.
@@ -23,8 +33,69 @@ Or you can use Document Server behind a proxy, please refer to [this article](ht
The easiest way to start an instance of ONLYOFFICE Document Server is to use [Docker](https://github.com/ONLYOFFICE/Docker-DocumentServer).
-
-## Installing Nextcloud ONLYOFFICE integration app
+## ONLYOFFICE Document Server editions
+
+ONLYOFFICE offers different versions of its online document editors that can be deployed on your own servers.
+
+ONLYOFFICE Document Server:
+* Community Edition (`onlyoffice-documentserver` package)
+
+* Integration Edition (`onlyoffice-documentserver-ie` package)
+
+The table below will help you to make the right choice.
+
+| Pricing and licensing | Community Edition | Integration Edition |
+| ------------- | ------------- | ------------- |
+| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubNextcloud) | [Start Free Trial](https://www.onlyoffice.com/connectors-request.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubNextcloud) |
+| Cost | FREE | [Go to the pricing page](https://www.onlyoffice.com/integration-edition-prices.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubNextcloud) |
+| Simultaneous connections | up to 20 maximum | As in chosen pricing plan |
+| Number of users | up to 20 recommended | As in chosen pricing plan |
+| License | GNU AGPL v.3 | Proprietary |
+| **Support** | **Community Edition** | **Integration Edition** |
+| Documentation | [Help Center](https://helpcenter.onlyoffice.com/server/docker/opensource/index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx) |
+| Standard support | [GitHub](https://github.com/ONLYOFFICE/DocumentServer/issues) or paid | One year support included |
+| Premium support | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubNextcloud) | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubNextcloud) |
+| **Services** | **Community Edition** | **Integration Edition** |
+| Conversion Service | + | + |
+| Document Builder Service | - | + |
+| **Interface** | **Community Edition** | **Integration Edition** |
+| Tabbed interface | - | + |
+| White Label | - | - |
+| Integrated test example (node.js)* | - | + |
+| **Plugins & Macros** | **Community Edition** | **Integration Edition** |
+| Plugins | + | + |
+| Macros | + | + |
+| **Collaborative capabilities** | **Community Edition** | **Integration Edition** |
+| Two co-editing modes | + | + |
+| Comments | + | + |
+| Built-in chat | + | + |
+| Review and tracking changes | + | + |
+| Display modes of tracking changes | - | + |
+| Version history | + | + |
+| **Document Editor features** | **Community Edition** | **Integration Edition** |
+| Font and paragraph formatting | + | + |
+| Object insertion | + | + |
+| Content control | - | + |
+| Layout tools | + | + |
+| Table of contents | + | + |
+| Navigation panel | - | + |
+| Mail Merge | + | + |
+| **Spreadsheet Editor features** | **Community Edition** | **Integration Edition** |
+| Font and paragraph formatting | + | + |
+| Object insertion | + | + |
+| Functions, formulas, equations | + | + |
+| Table templates | + | + |
+| Pivot tables | - | +** |
+| **Presentation Editor features** | **Community Edition** | **Integration Edition** |
+| Font and paragraph formatting | + | + |
+| Object insertion | + | + |
+| Animations | + | + |
+| Presenter mode | - | + |
+| Notes | + | + |
+| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubNextcloud) | [Start Free Trial](https://www.onlyoffice.com/connectors-request.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubNextcloud) |
+
+
+## Installing Nextcloud-ONLYOFFICE integration app
The Nextcloud administrator can install the integration app from the in-built application market.
For that go to the user name and select **Apps**.
@@ -58,7 +129,7 @@ There are several ways to do that:
3. In Nextcloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application.
-## Configuring Nextcloud ONLYOFFICE integration app
+## Configuring Nextcloud-ONLYOFFICE integration app
In Nextcloud open the `~/index.php/settings/admin/onlyoffice` page with administrative settings for **ONLYOFFICE** section.
Enter the following address to connect ONLYOFFICE Document Server:
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 1f7dd2b..9ae2f94 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -1,13 +1,12 @@
<?xml version="1.0"?>
<info>
<id>onlyoffice</id>
- <ocsid>174798</ocsid>
<name>ONLYOFFICE</name>
<summary>ONLYOFFICE connector</summary>
<description>ONLYOFFICE connector enables you to edit Office documents within ONLYOFFICE from the familiar web interface. This will create a new Open in ONLYOFFICE action within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to your file storage.</description>
<licence>agpl</licence>
<author mail="dev@onlyoffice.com" homepage="https://www.onlyoffice.com/">Ascensio System SIA</author>
- <version>2.1.10</version>
+ <version>2.3.0</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
@@ -22,6 +21,7 @@
<category>office</category>
<category>tools</category>
<website>https://www.onlyoffice.com</website>
+ <discussion>https://dev.onlyoffice.org/</discussion>
<bugs>https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues</bugs>
<repository type="git">https://github.com/ONLYOFFICE/onlyoffice-nextcloud.git</repository>
<screenshot small-thumbnail="https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/main_small.png">https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/main.png</screenshot>
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 4accc96..c5d16c1 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -37,7 +37,8 @@ return [
["name" => "editor#config", "url" => "/ajax/config/{fileId}", "verb" => "GET"],
["name" => "editor#create", "url" => "/ajax/new", "verb" => "POST"],
["name" => "editor#convert", "url" => "/ajax/convert", "verb" => "POST"],
- ["name" => "settings#save_settings", "url" => "/ajax/settings", "verb" => "PUT"],
+ ["name" => "settings#save_address", "url" => "/ajax/settings/address", "verb" => "PUT"],
+ ["name" => "settings#save_common", "url" => "/ajax/settings/common", "verb" => "PUT"],
["name" => "settings#get_settings", "url" => "/ajax/settings", "verb" => "GET"],
]
]; \ No newline at end of file
diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php
index dccb139..7f1a6ac 100644
--- a/controller/callbackcontroller.php
+++ b/controller/callbackcontroller.php
@@ -363,7 +363,7 @@ class CallbackController extends Controller {
$trackerStatus = $this->_trackerStatus[$status];
- $error = 1;
+ $result = 1;
switch ($trackerStatus) {
case "MustSave":
case "Corrupted":
@@ -373,26 +373,34 @@ class CallbackController extends Controller {
}
try {
+ $ownerId = $hashData->ownerId;
+ $token = isset($hashData->token) ? $hashData->token : NULL;
+ if (empty($ownerId) && empty($token)) {
+ $this->logger->error("Track without owner: " . $fileId . " status " . $trackerStatus, array("app" => $this->appName));
+ return new JSONResponse(["message" => $this->trans->t("File owner is empty")], Http::STATUS_BAD_REQUEST);
+ }
+
$userId = $users[0];
$user = $this->userManager->get($userId);
if (!empty($user)) {
- \OC_Util::tearDownFS();
- \OC_Util::setupFS($userId);
-
$this->userSession->setUser($user);
} else {
- $ownerId = $hashData->ownerId;
+ $this->logger->debug("Track by anonymous " . $userId, array("app" => $this->appName));
+ }
- \OC_Util::tearDownFS();
- if (!empty($ownerId)) {
- \OC_Util::setupFS($ownerId);
- }
+ if ($this->config->checkEncryptionModule() === "master") {
+ \OC_User::setIncognitoMode(true);
}
- $token = isset($hashData->token) ? $hashData->token : NULL;
- list ($file, $error) = empty($token) ? $this->getFile($userId, $fileId) : $this->getFileByToken($fileId, $token);
+ \OC_Util::tearDownFS();
+ if (!empty($ownerId)) {
+ \OC_Util::setupFS($ownerId);
+ }
+
+ list ($file, $error) = !empty($ownerId) ? $this->getFile($ownerId, $fileId) : $this->getFileByToken($fileId, $token);
if (isset($error)) {
+ $this->logger->error("track error" . $fileId ." " . $error, array("app" => $this->appName));
return $error;
}
@@ -430,8 +438,10 @@ class CallbackController extends Controller {
}
$newData = $documentService->Request($url);
+
+ $this->logger->debug("Track put content " . $file->getPath(), array("app" => $this->appName));
$file->putContent($newData);
- $error = 0;
+ $result = 0;
} catch (\Exception $e) {
$this->logger->error("Track " . $trackerStatus . " error: " . $e->getMessage(), array("app" => $this->appName));
}
@@ -439,13 +449,13 @@ class CallbackController extends Controller {
case "Editing":
case "Closed":
- $error = 0;
+ $result = 0;
break;
}
$this->logger->debug("Track: " . $fileId . " status " . $status . " result " . $error, array("app" => $this->appName));
- return new JSONResponse(["error" => $error], Http::STATUS_OK);
+ return new JSONResponse(["error" => $result], Http::STATUS_OK);
}
diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php
index 9f28223..4c0c9ac 100644
--- a/controller/editorcontroller.php
+++ b/controller/editorcontroller.php
@@ -485,6 +485,7 @@ class EditorController extends Controller {
"document" => [
"fileType" => $ext,
"key" => DocumentService::GenerateRevisionId($key),
+ "permissions" => [],
"title" => $fileName,
"url" => $fileUrl,
],
@@ -494,8 +495,9 @@ class EditorController extends Controller {
]
];
- if (\OC::$server->getRequest()->isUserAgent([$this::USER_AGENT_MOBILE])) {
- $params["type"] = "mobile";
+ $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter);
+ if (isset($permissions_modifyFilter)) {
+ $params["document"]["permissions"]["modifyFilter"] = $permissions_modifyFilter;
}
$canEdit = isset($format["edit"]) && $format["edit"];
@@ -520,6 +522,10 @@ class EditorController extends Controller {
$params["editorConfig"]["mode"] = "view";
}
+ if (\OC::$server->getRequest()->isUserAgent([$this::USER_AGENT_MOBILE])) {
+ $params["type"] = "mobile";
+ }
+
if (!empty($userId)) {
$params["editorConfig"]["user"] = [
"id" => $userId,
@@ -530,7 +536,7 @@ class EditorController extends Controller {
$folderLink = NULL;
if (!empty($token)) {
- if (method_exists($share, getHideDownload) && $share->getHideDownload()) {
+ if (method_exists($share, "getHideDownload") && $share->getHideDownload()) {
$params["document"]["permissions"] = [
"download" => false,
"print" => false
@@ -576,14 +582,6 @@ class EditorController extends Controller {
$params = $this->setCustomization($params);
- $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter);
- if (isset($permissions_modifyFilter)) {
- if (!array_key_exists("permissions", $params["document"])) {
- $params["document"]["permissions"] = [];
- }
- $params["document"]["permissions"]["modifyFilter"] = $permissions_modifyFilter;
- }
-
if (!empty($this->config->GetDocumentServerSecret())) {
$token = \Firebase\JWT\JWT::encode($params, $this->config->GetDocumentServerSecret());
$params["token"] = $token;
@@ -776,6 +774,34 @@ class EditorController extends Controller {
* @return array
*/
private function setCustomization($params) {
+ //default is true
+ if ($this->config->GetCustomizationChat() === false) {
+ $params["editorConfig"]["customization"]["chat"] = false;
+ }
+
+ //default is false
+ if ($this->config->GetCustomizationCompactHeader() === true) {
+ $params["editorConfig"]["customization"]["compactHeader"] = true;
+ }
+
+ //default is false
+ if ($this->config->GetCustomizationFeedback() === true) {
+ $params["editorConfig"]["customization"]["feedback"] = true;
+ }
+
+ //default is true
+ if ($this->config->GetCustomizationHelp() === false) {
+ $params["editorConfig"]["customization"]["help"] = false;
+ }
+
+ //default is false
+ if ($this->config->GetCustomizationToolbarNoTabs() === true) {
+ $params["editorConfig"]["customization"]["toolbarNoTabs"] = true;
+ }
+
+
+ /* from system config */
+
$customer = $this->config->getSystemValue($this->config->_customization_customer);
if (isset($customer)) {
$params["editorConfig"]["customization"]["customer"] = $customer;
diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php
index 1acd11a..a45b38e 100644
--- a/controller/settingscontroller.php
+++ b/controller/settingscontroller.php
@@ -29,7 +29,6 @@
namespace OCA\Onlyoffice\Controller;
-use OCP\App;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IL10N;
@@ -121,34 +120,32 @@ class SettingsController extends Controller {
"currentServer" => $this->urlGenerator->getAbsoluteURL("/"),
"formats" => $this->config->FormatsSetting(),
"sameTab" => $this->config->GetSameTab(),
- "encryption" => $this->checkEncryptionModule(),
- "limitGroups" => $this->config->GetLimitGroups()
+ "encryption" => ($this->config->checkEncryptionModule() === true),
+ "limitGroups" => $this->config->GetLimitGroups(),
+ "chat" => $this->config->GetCustomizationChat(),
+ "compactHeader" => $this->config->GetCustomizationCompactHeader(),
+ "feedback" => $this->config->GetCustomizationFeedback(),
+ "help" => $this->config->GetCustomizationHelp(),
+ "toolbarNoTabs" => $this->config->GetCustomizationToolbarNoTabs(),
+ "successful" => $this->config->SettingsAreSuccessful()
];
return new TemplateResponse($this->appName, "settings", $data, "blank");
}
/**
- * Save app settings
+ * Save address settings
*
* @param string $documentserver - document service address
* @param string $documentserverInternal - document service address available from Nextcloud
* @param string $storageUrl - Nextcloud address available from document server
* @param string $secret - secret key for signature
- * @param array $defFormats - formats array with default action
- * @param array $editFormats - editable formats array
- * @param bool $sameTab - open in same tab
- * @param array $limitGroups - list of groups
*
* @return array
*/
- public function SaveSettings($documentserver,
+ public function SaveAddress($documentserver,
$documentserverInternal,
$storageUrl,
- $secret,
- $defFormats,
- $editFormats,
- $sameTab,
- $limitGroups
+ $secret
) {
$this->config->SetDocumentServerUrl($documentserver);
$this->config->SetDocumentServerInternalUrl($documentserverInternal);
@@ -162,12 +159,7 @@ class SettingsController extends Controller {
$this->config->SetSettingsError($error);
}
- $this->config->SetDefaultFormats($defFormats);
- $this->config->SetEditableFormats($editFormats);
- $this->config->SetSameTab($sameTab);
- $this->config->SetLimitGroups($limitGroups);
-
- if ($this->checkEncryptionModule()) {
+ if ($this->config->checkEncryptionModule() === true) {
$this->logger->info("SaveSettings when encryption is enabled", array("app" => $this->appName));
}
@@ -181,6 +173,46 @@ class SettingsController extends Controller {
}
/**
+ * Save common settings
+ *
+ * @param array $defFormats - formats array with default action
+ * @param array $editFormats - editable formats array
+ * @param bool $sameTab - open in the same tab
+ * @param array $limitGroups - list of groups
+ * @param bool $chat - display chat
+ * @param bool $compactHeader - display compact header
+ * @param bool $feedback - display feedback
+ * @param bool $help - display help
+ * @param bool $toolbarNoTabs - display toolbar tab
+ *
+ * @return array
+ */
+ public function SaveCommon($defFormats,
+ $editFormats,
+ $sameTab,
+ $limitGroups,
+ $chat,
+ $compactHeader,
+ $feedback,
+ $help,
+ $toolbarNoTabs
+ ) {
+
+ $this->config->SetDefaultFormats($defFormats);
+ $this->config->SetEditableFormats($editFormats);
+ $this->config->SetSameTab($sameTab);
+ $this->config->SetLimitGroups($limitGroups);
+ $this->config->SetCustomizationChat($chat);
+ $this->config->SetCustomizationCompactHeader($compactHeader);
+ $this->config->SetCustomizationFeedback($feedback);
+ $this->config->SetCustomizationHelp($help);
+ $this->config->SetCustomizationToolbarNoTabs($toolbarNoTabs);
+
+ return [
+ ];
+ }
+
+ /**
* Get app settings
*
* @return array
@@ -276,26 +308,4 @@ class SettingsController extends Controller {
return "";
}
-
- /**
- * Checking encryption enabled
- *
- * @return bool
- */
- private function checkEncryptionModule() {
- if (!App::isEnabled("encryption")) {
- return false;
- }
- if (!\OC::$server->getEncryptionManager()->isEnabled()) {
- return false;
- }
-
- $crypt = new \OCA\Encryption\Crypto\Crypt(\OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getL10N("encryption"));
- $util = new \OCA\Encryption\Util(new \OC\Files\View(), $crypt, \OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getUserManager());
- if ($util->isMasterKeyEnabled()) {
- return false;
- }
-
- return true;
- }
}
diff --git a/css/settings.css b/css/settings.css
index ca22413..d2f1c0d 100644
--- a/css/settings.css
+++ b/css/settings.css
@@ -26,8 +26,12 @@
*
*/
-.section-onlyoffice h2 {
- display: inline;
+ #content .section-onlyoffice .icon-info {
+ box-sizing: content-box;
+ padding-top: 6px;
+}
+.onlyoffice-error {
+ color: red;
}
.onlyoffice-header {
display: inline-block;
@@ -35,19 +39,21 @@
}
.section-onlyoffice input {
display: block;
- margin: 6px 0 4px;
width: 250px;
}
.onlyoffice-hide {
display: none;
}
-.onlyoffice-link-action {
- border-bottom: 1px dotted;
+#onlyofficeAdv {
cursor: pointer;
text-decoration: none;
}
-.onlyoffice-error {
- color: red;
+#onlyofficeAdv .icon {
+ display: inline-block;
+ margin-bottom: -3px;
+}
+#s2id_onlyofficeLimitGroups {
+ margin-bottom: 16px;
}
.onlyoffice-exts {
column-width: 100px;
diff --git a/js/desktop.js b/js/desktop.js
index 34433b7..6289897 100644
--- a/js/desktop.js
+++ b/js/desktop.js
@@ -37,7 +37,8 @@
OCA.Onlyoffice.Desktop = true;
$("html").addClass("AscDesktopEditor");
- var domain = location.href.split(OC.generateUrl(""))[0];
+ var domain = new RegExp("^http(s)?:\/\/[^\/]+").exec(location)[0];
+ domain += + OC.getRootPath();
var data = {
displayName: oc_current_user,
diff --git a/js/main.js b/js/main.js
index 7b3825c..d964209 100644
--- a/js/main.js
+++ b/js/main.js
@@ -168,28 +168,28 @@
var register = function() {
var formats = OCA.Onlyoffice.setting.formats;
- $.each(formats, function (ext, attr) {
- if (!attr.mime) {
+ $.each(formats, function (ext, config) {
+ if (!config.mime) {
return true;
}
fileList.fileActions.registerAction({
name: "onlyofficeOpen",
displayName: t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE"),
- mime: attr.mime,
+ mime: config.mime,
permissions: OC.PERMISSION_READ,
iconClass: "icon-onlyoffice-open",
actionHandler: OCA.Onlyoffice.FileClick
});
- if (attr.def) {
- fileList.fileActions.setDefault(attr.mime, "onlyofficeOpen");
+ if (config.def) {
+ fileList.fileActions.setDefault(config.mime, "onlyofficeOpen");
}
- if (attr.conv) {
+ if (config.conv) {
fileList.fileActions.registerAction({
name: "onlyofficeConvert",
displayName: t(OCA.Onlyoffice.AppName, "Convert with ONLYOFFICE"),
- mime: attr.mime,
+ mime: config.mime,
permissions: ($("#isPublic").val() ? OC.PERMISSION_UPDATE : OC.PERMISSION_READ),
iconClass: "icon-onlyoffice-convert",
actionHandler: OCA.Onlyoffice.FileConvertClick
@@ -245,27 +245,34 @@
}
};
- var initPage = function(){
+ var getFileExtension = function (fileName) {
+ var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase();
+ return extension;
+ }
+
+ var initPage = function () {
if ($("#isPublic").val() === "1" && !$("#filestable").length) {
var fileName = $("#filename").val();
- var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase();
+ var extension = getFileExtension(fileName);
var initSharedButton = function() {
var formats = OCA.Onlyoffice.setting.formats;
- var conf = formats[extension];
- if (conf) {
- var button = document.createElement("a");
- button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val()));
- button.className = "button";
- button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE")
+ var config = formats[extension];
+ if (!config) {
+ return;
+ }
- if (!OCA.Onlyoffice.setting.sameTab) {
- button.target = "_blank";
- }
+ var button = document.createElement("a");
+ button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val()));
+ button.className = "button";
+ button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE")
- $("#preview").append(button);
+ if (!OCA.Onlyoffice.setting.sameTab) {
+ button.target = "_blank";
}
+
+ $("#preview").append(button);
};
OCA.Onlyoffice.GetSettings(initSharedButton);
diff --git a/js/settings.js b/js/settings.js
index a8b48cb..052a321 100644
--- a/js/settings.js
+++ b/js/settings.js
@@ -37,11 +37,11 @@
}
var advToogle = function () {
- $("#onlyofficeSecretPanel, #onlyofficeSaveBreak").toggleClass("onlyoffice-hide");
+ $("#onlyofficeSecretPanel").toggleClass("onlyoffice-hide");
+ $("#onlyofficeAdv .icon").toggleClass("icon-triangle-s icon-triangle-n");
};
if ($("#onlyofficeInternalUrl").val().length
- || $("#onlyofficeSecret").val().length
|| $("#onlyofficeStorageUrl").val().length) {
advToogle();
}
@@ -64,7 +64,7 @@
groupListToggle();
- $("#onlyofficeSave").click(function () {
+ $("#onlyofficeAddrSave").click(function () {
$(".section-onlyoffice").addClass("icon-loading");
var onlyofficeUrl = $("#onlyofficeUrl").val().trim();
@@ -76,6 +76,41 @@
var onlyofficeStorageUrl = ($("#onlyofficeStorageUrl:visible").val() || "").trim();
var onlyofficeSecret = $("#onlyofficeSecret:visible").val() || "";
+ $.ajax({
+ method: "PUT",
+ url: OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/settings/address"),
+ data: {
+ documentserver: onlyofficeUrl,
+ documentserverInternal: onlyofficeInternalUrl,
+ storageUrl: onlyofficeStorageUrl,
+ secret: onlyofficeSecret
+ },
+ success: function onSuccess(response) {
+ $(".section-onlyoffice").removeClass("icon-loading");
+ if (response && response.documentserver != null) {
+ $("#onlyofficeUrl").val(response.documentserver);
+ $("#onlyofficeInternalUrl").val(response.documentserverInternal);
+ $("#onlyofficeStorageUrl").val(response.storageUrl);
+ $("#onlyofficeSecret").val(response.secret);
+
+ $(".section-onlyoffice-2").toggleClass("onlyoffice-hide", !response.documentserver.length || !!response.error.length);
+
+ var message =
+ response.error
+ ? (t(OCA.Onlyoffice.AppName, "Error when trying to connect") + " (" + response.error + ")")
+ : t(OCA.Onlyoffice.AppName, "Settings have been successfully updated");
+ OC.Notification.show(message, {
+ type: response.error ? "error" : null,
+ timeout: 3
+ });
+ }
+ }
+ });
+ });
+
+ $("#onlyofficeSave").click(function () {
+ $(".section-onlyoffice").addClass("icon-loading");
+
var defFormats = {};
$("input[id^=\"onlyofficeDefFormat\"]").each(function() {
defFormats[this.name] = this.checked;
@@ -91,33 +126,31 @@
var limitGroupsString = $("#onlyofficeGroups").prop("checked") ? $("#onlyofficeLimitGroups").val() : "";
var limitGroups = limitGroupsString ? limitGroupsString.split("|") : [];
+ var chat = $("#onlyofficeChat").is(":checked");
+ var compactHeader = $("#onlyofficeCompactHeader").is(":checked");
+ var feedback = $("#onlyofficeFeedback").is(":checked");
+ var help = $("#onlyofficeHelp").is(":checked");
+ var toolbarNoTabs = !$("#onlyofficeToolbarNoTabs").is(":checked");
+
$.ajax({
method: "PUT",
- url: OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/settings"),
+ url: OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/settings/common"),
data: {
- documentserver: onlyofficeUrl,
- documentserverInternal: onlyofficeInternalUrl,
- storageUrl: onlyofficeStorageUrl,
- secret: onlyofficeSecret,
defFormats: defFormats,
editFormats: editFormats,
sameTab: sameTab,
- limitGroups: limitGroups
+ limitGroups: limitGroups,
+ chat: chat,
+ compactHeader: compactHeader,
+ feedback: feedback,
+ help: help,
+ toolbarNoTabs: toolbarNoTabs
},
success: function onSuccess(response) {
$(".section-onlyoffice").removeClass("icon-loading");
- if (response && response.documentserver != null) {
- $("#onlyofficeUrl").val(response.documentserver);
- $("#onlyofficeInternalUrl").val(response.documentserverInternal);
- $("#onlyofficeStorageUrl").val(response.storageUrl);
- $("#onlyofficeSecret").val(response.secret);
-
- var message =
- response.error
- ? (t(OCA.Onlyoffice.AppName, "Error when trying to connect") + " (" + response.error + ")")
- : t(OCA.Onlyoffice.AppName, "Settings have been successfully updated");
+ if (response) {
+ var message = t(OCA.Onlyoffice.AppName, "Settings have been successfully updated");
OC.Notification.show(message, {
- type: "error",
timeout: 3
});
}
@@ -128,7 +161,7 @@
$(".section-onlyoffice input").keypress(function (e) {
var code = e.keyCode || e.which;
if (code === 13) {
- $("#onlyofficeSave").click();
+ $("#onlyofficeAddrSave").click();
}
});
});
diff --git a/l10n/de.js b/l10n/de.js
index b578c2c..daf392b 100644
--- a/l10n/de.js
+++ b/l10n/de.js
@@ -45,6 +45,15 @@ OC.L10N.register(
"View details" : "Details anzeigen",
"Save" : "Speichern",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.",
- "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren"
+ "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren",
+ "Server settings" : "Servereinstellungen",
+ "Common settings" : "Allgemeine Einstellungen",
+ "Editor customization settings" : "Editor-Einstellungen",
+ "The customization section allows to customize the editor interface" : "Die Anpassungssektion ermöglicht die Anpassung der Editoroberfläche",
+ "Display Chat menu button" : "Chat-Taste anzeigen",
+ "Display the header more compact" : "Kompakten Header anzeigen",
+ "Display Feedback & Support menu button" : "Feedback-& Support-Taste anzeigen",
+ "Display Help menu button" : "Hilfetaste anzeigen",
+ "Display toolbar tabs" : "Symbolleiste-Registerkarten anzeigen"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/de.json b/l10n/de.json
index e29b9ce..1d6d315 100644
--- a/l10n/de.json
+++ b/l10n/de.json
@@ -43,6 +43,15 @@
"View details" : "Details anzeigen",
"Save" : "Speichern",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.",
- "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren"
+ "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren",
+ "Server settings" : "Servereinstellungen",
+ "Common settings" : "Allgemeine Einstellungen",
+ "Editor customization settings" : "Editor-Einstellungen",
+ "The customization section allows to customize the editor interface" : "Die Anpassungssektion ermöglicht die Anpassung der Editoroberfläche",
+ "Display Chat menu button" : "Chat-Taste anzeigen",
+ "Display the header more compact" : "Kompakten Header anzeigen",
+ "Display Feedback & Support menu button" : "Feedback-& Support-Taste anzeigen",
+ "Display Help menu button" : "Hilfetaste anzeigen",
+ "Display toolbar tabs" : "Symbolleiste-Registerkarten anzeigen"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/l10n/de_DE.js b/l10n/de_DE.js
index 05c90da..9fbbd91 100644
--- a/l10n/de_DE.js
+++ b/l10n/de_DE.js
@@ -45,6 +45,15 @@ OC.L10N.register(
"View details" : "Details anzeigen",
"Save" : "Speichern",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.",
- "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren"
+ "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren",
+ "Server settings" : "Servereinstellungen",
+ "Common settings" : "Allgemeine Einstellungen",
+ "Editor customization settings" : "Editor-Einstellungen",
+ "The customization section allows to customize the editor interface" : "Die Anpassungssektion ermöglicht die Anpassung der Editoroberfläche",
+ "Display Chat menu button" : "Chat-Taste anzeigen",
+ "Display the header more compact" : "Kompakten Header anzeigen",
+ "Display Feedback & Support menu button" : "Feedback-& Support-Taste anzeigen",
+ "Display Help menu button" : "Hilfetaste anzeigen",
+ "Display toolbar tabs" : "Symbolleiste-Registerkarten anzeigen"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/de_DE.json b/l10n/de_DE.json
index 6cf04f7..4ec1dc8 100644
--- a/l10n/de_DE.json
+++ b/l10n/de_DE.json
@@ -43,6 +43,15 @@
"View details" : "Details anzeigen",
"Save" : "Speichern",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.",
- "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren"
+ "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren",
+ "Server settings" : "Servereinstellungen",
+ "Common settings" : "Allgemeine Einstellungen",
+ "Editor customization settings" : "Editor-Einstellungen",
+ "The customization section allows to customize the editor interface" : "Die Anpassungssektion ermöglicht die Anpassung der Editoroberfläche",
+ "Display Chat menu button" : "Chat-Taste anzeigen",
+ "Display the header more compact" : "Kompakten Header anzeigen",
+ "Display Feedback & Support menu button" : "Feedback-& Support-Taste anzeigen",
+ "Display Help menu button" : "Hilfetaste anzeigen",
+ "Display toolbar tabs" : "Symbolleiste-Registerkarten anzeigen"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/l10n/es.js b/l10n/es.js
index e22b794..fb30dcf 100644
--- a/l10n/es.js
+++ b/l10n/es.js
@@ -45,6 +45,15 @@ OC.L10N.register(
"View details" : "Ver detalles",
"Save" : "Guardar",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Contenido Mixto Activo no está permitido. Se requiere la dirección HTTPS para Servidor de Documentos.",
- "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos"
+ "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos",
+ "Server settings" : "Ajustes de servidor",
+ "Common settings" : "Ajustes comunes",
+ "Editor customization settings" : "Ajustes del editor",
+ "The customization section allows to customize the editor interface" : "La sección de personalización permite customizar la interfaz del editor",
+ "Display Chat menu button" : "Mostrar el botón de Chat",
+ "Display the header more compact" : "Mostrar el encabezado más compacto",
+ "Display Feedback & Support menu button" : "Mostrar el botón de Feedback y Soporte",
+ "Display Help menu button" : "Mostrar el botón de Ayuda",
+ "Display toolbar tabs" : "Mostrar pestañas de barra de herramientas"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/es.json b/l10n/es.json
index 9c0922a..4d9ccf3 100644
--- a/l10n/es.json
+++ b/l10n/es.json
@@ -43,6 +43,15 @@
"View details" : "Ver detalles",
"Save" : "Guardar",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Contenido Mixto Activo no está permitido. Se requiere la dirección HTTPS para Servidor de Documentos.",
- "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos"
+ "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos",
+ "Server settings" : "Ajustes de servidor",
+ "Common settings" : "Ajustes comunes",
+ "Editor customization settings" : "Ajustes del editor",
+ "The customization section allows to customize the editor interface" : "La sección de personalización permite customizar la interfaz del editor",
+ "Display Chat menu button" : "Mostrar el botón de Chat",
+ "Display the header more compact" : "Mostrar el encabezado más compacto",
+ "Display Feedback & Support menu button" : "Mostrar el botón de Feedback y Soporte",
+ "Display Help menu button" : "Mostrar el botón de Ayuda",
+ "Display toolbar tabs" : "Mostrar pestañas de barra de herramientas"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/l10n/fr.js b/l10n/fr.js
index 6adddb8..7d1f9c9 100644
--- a/l10n/fr.js
+++ b/l10n/fr.js
@@ -45,6 +45,15 @@ OC.L10N.register(
"View details" : "Voir les détails",
"Save" : "Enregistrer",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Le contenu mixte actif n'est pas autorisé. Une adresse HTTPS pour le serveur de document est requise",
- "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants"
+ "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants",
+ "Server settings" : "Paramètres du serveur",
+ "Common settings" : "Paramètres communs",
+ "Editor customization settings" : "Paramètres de personnalisation de l'éditeur",
+ "The customization section allows to customize the editor interface" : "La section de personnalisation permet de personnaliser l'interface de l'éditeur",
+ "Display Chat menu button" : "Afficher le bouton du menu du chat",
+ "Display the header more compact" : "Afficher l'en-tête plus compact",
+ "Display Feedback & Support menu button" : "Afficher le bouton du menu 'Feedback & Support'",
+ "Display Help menu button" : "Afficher le bouton du menu 'Aide'",
+ "Display toolbar tabs" : "Afficher les onglets de la barre d'outils"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/fr.json b/l10n/fr.json
index b129788..c7ac146 100644
--- a/l10n/fr.json
+++ b/l10n/fr.json
@@ -43,6 +43,15 @@
"View details" : "Voir les détails",
"Save" : "Enregistrer",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Le contenu mixte actif n'est pas autorisé. Une adresse HTTPS pour le serveur de document est requise",
- "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants"
+ "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants",
+ "Server settings" : "Paramètres du serveur",
+ "Common settings" : "Paramètres communs",
+ "Editor customization settings" : "Paramètres de personnalisation de l'éditeur",
+ "The customization section allows to customize the editor interface" : "La section de personnalisation permet de personnaliser l'interface de l'éditeur",
+ "Display Chat menu button" : "Afficher le bouton du menu du chat",
+ "Display the header more compact" : "Afficher l'en-tête plus compact",
+ "Display Feedback & Support menu button" : "Afficher le bouton du menu 'Feedback & Support'",
+ "Display Help menu button" : "Afficher le bouton du menu 'Aide'",
+ "Display toolbar tabs" : "Afficher les onglets de la barre d'outils"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
diff --git a/l10n/ru.js b/l10n/ru.js
index b6ddd3e..03edecd 100644
--- a/l10n/ru.js
+++ b/l10n/ru.js
@@ -45,6 +45,15 @@ OC.L10N.register(
"View details" : "Подробнее",
"Save" : "Сохранить",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смешанное активное содержимое запрещено. Для Сервера документов необходимо использовать HTTPS-адрес.",
- "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам"
+ "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам",
+ "Server settings" : "Настройки сервера",
+ "Common settings" : "Общие настройки",
+ "Editor customization settings" : "Настройка редактора",
+ "The customization section allows to customize the editor interface" : "Раздел настройки позволяет изменить интерфейс редактора",
+ "Display Chat menu button" : "Отображать кнопку чата",
+ "Display the header more compact" : "Отображать заголовок компактным",
+ "Display Feedback & Support menu button" : "Отображать кнопку Обратной связи и поддержки",
+ "Display Help menu button" : "Отображать кнопку справки",
+ "Display toolbar tabs" : "Отображать вкладки панели инструментов"
},
"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);");
diff --git a/l10n/ru.json b/l10n/ru.json
index 58a53d2..c6f751c 100644
--- a/l10n/ru.json
+++ b/l10n/ru.json
@@ -43,6 +43,15 @@
"View details" : "Подробнее",
"Save" : "Сохранить",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смешанное активное содержимое запрещено. Для Сервера документов необходимо использовать HTTPS-адрес.",
- "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам"
+ "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам",
+ "Server settings" : "Настройки сервера",
+ "Common settings" : "Общие настройки",
+ "Editor customization settings" : "Настройка редактора",
+ "The customization section allows to customize the editor interface" : "Раздел настройки позволяет изменить интерфейс редактора",
+ "Display Chat menu button" : "Отображать кнопку чата",
+ "Display the header more compact" : "Отображать заголовок компактным",
+ "Display Feedback & Support menu button" : "Отображать кнопку Обратной связи и поддержки",
+ "Display Help menu button" : "Отображать кнопку справки",
+ "Display toolbar tabs" : "Отображать вкладки панели инструментов"
},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"
} \ No newline at end of file
diff --git a/lib/appconfig.php b/lib/appconfig.php
index 52a6812..7d37ecf 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -110,6 +110,41 @@ class AppConfig {
private $_sameTab = "sameTab";
/**
+ * The config key for the chat display setting
+ *
+ * @var string
+ */
+ private $_customizationChat = "customizationChat";
+
+ /**
+ * The config key for display the header more compact setting
+ *
+ * @var string
+ */
+ private $_customizationCompactHeader = "customizationCompactHeader";
+
+ /**
+ * The config key for the feedback display setting
+ *
+ * @var string
+ */
+ private $_customizationFeedback = "customizationFeedback";
+
+ /**
+ * The config key for the help display setting
+ *
+ * @var string
+ */
+ private $_customizationHelp = "customizationHelp";
+
+ /**
+ * The config key for the no tabs setting
+ *
+ * @var string
+ */
+ private $_customizationToolbarNoTabs = "customizationToolbarNoTabs";
+
+ /**
* The config key for the setting limit groups
*
* @var string
@@ -431,6 +466,106 @@ class AppConfig {
}
/**
+ * Save chat display setting
+ *
+ * @param bool $value - display chat
+ */
+ public function SetCustomizationChat($value) {
+ $this->logger->info("Set chat display: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationChat, json_encode($value));
+ }
+
+ /**
+ * Get chat display setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationChat() {
+ return $this->config->getAppValue($this->appName, $this->_customizationChat, "true") === "true";
+ }
+
+ /**
+ * Save compact header setting
+ *
+ * @param bool $value - display compact header
+ */
+ public function SetCustomizationCompactHeader($value) {
+ $this->logger->info("Set compact header display: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationCompactHeader, json_encode($value));
+ }
+
+ /**
+ * Get compact header setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationCompactHeader() {
+ return $this->config->getAppValue($this->appName, $this->_customizationCompactHeader, "true") === "true";
+ }
+
+ /**
+ * Save feedback display setting
+ *
+ * @param bool $value - display feedback
+ */
+ public function SetCustomizationFeedback($value) {
+ $this->logger->info("Set feedback display: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationFeedback, json_encode($value));
+ }
+
+ /**
+ * Get feedback display setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationFeedback() {
+ return $this->config->getAppValue($this->appName, $this->_customizationFeedback, "true") === "true";
+ }
+
+ /**
+ * Save help display setting
+ *
+ * @param bool $value - display help
+ */
+ public function SetCustomizationHelp($value) {
+ $this->logger->info("Set help display: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationHelp, json_encode($value));
+ }
+
+ /**
+ * Get help display setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationHelp() {
+ return $this->config->getAppValue($this->appName, $this->_customizationHelp, "true") === "true";
+ }
+
+ /**
+ * Save without tabs setting
+ *
+ * @param bool $value - without tabs
+ */
+ public function SetCustomizationToolbarNoTabs($value) {
+ $this->logger->info("Set without tabs: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationToolbarNoTabs, json_encode($value));
+ }
+
+ /**
+ * Get without tabs setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationToolbarNoTabs() {
+ return $this->config->getAppValue($this->appName, $this->_customizationToolbarNoTabs, "true") === "true";
+ }
+
+ /**
* Save the list of groups
*
* @param array $groups - the list of groups
@@ -539,6 +674,28 @@ class AppConfig {
}
/**
+ * Checking encryption enabled
+ *
+ * @return string|bool
+ */
+ public function checkEncryptionModule() {
+ if (!\OC::$server->getAppManager()->isInstalled("encryption")) {
+ return false;
+ }
+ if (!\OC::$server->getEncryptionManager()->isEnabled()) {
+ return false;
+ }
+
+ $crypt = new \OCA\Encryption\Crypto\Crypt(\OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getL10N("encryption"));
+ $util = new \OCA\Encryption\Util(new \OC\Files\View(), $crypt, \OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getUserManager());
+ if ($util->isMasterKeyEnabled()) {
+ return "master";
+ }
+
+ return true;
+ }
+
+ /**
* Get supported formats
*
* @return array
diff --git a/lib/documentservice.php b/lib/documentservice.php
index ea14002..ba9507a 100644
--- a/lib/documentservice.php
+++ b/lib/documentservice.php
@@ -118,36 +118,32 @@ class DocumentService {
* @return array
*/
function SendRequestToConvertService($document_uri, $from_extension, $to_extension, $document_revision_id, $is_async) {
- if (empty($from_extension)) {
- $path_parts = pathinfo($document_uri);
- $from_extension = $path_parts["extension"];
- }
+ $documentServerUrl = $this->config->GetDocumentServerInternalUrl(false);
- $title = basename($document_uri);
- if (empty($title)) {
- $title = $document_revision_id . $from_extension;
+ if (empty($documentServerUrl)) {
+ throw new \Exception($this->trans->t("ONLYOFFICE app is not configured. Please contact admin"));
}
+ $urlToConverter = $documentServerUrl . "ConvertService.ashx";
+
if (empty($document_revision_id)) {
$document_revision_id = $document_uri;
}
$document_revision_id = self::GenerateRevisionId($document_revision_id);
- $documentServerUrl = $this->config->GetDocumentServerInternalUrl(false);
-
- if (empty($documentServerUrl)) {
- throw new \Exception($this->trans->t("ONLYOFFICE app is not configured. Please contact admin"));
+ if (empty($from_extension)) {
+ $from_extension = pathinfo($document_uri)["extension"];
+ } else {
+ $from_extension = trim($from_extension, ".");
}
- $urlToConverter = $documentServerUrl . "ConvertService.ashx";
-
$data = [
"async" => $is_async,
"url" => $document_uri,
"outputtype" => trim($to_extension, "."),
- "filetype" => trim($from_extension, "."),
- "title" => $title,
+ "filetype" => $from_extension,
+ "title" => $document_revision_id . "." . $from_extension,
"key" => $document_revision_id
];
@@ -347,7 +343,6 @@ class DocumentService {
*
* @return string
*/
-
public function Request($url, $method = "get", $opts = NULL) {
$httpClientService = \OC::$server->getHTTPClientService();
$client = $httpClientService->newClient();
diff --git a/settings.php b/settings.php
deleted file mode 100644
index 802d01f..0000000
--- a/settings.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- *
- * (c) Copyright Ascensio System SIA 2019
- *
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
- *
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
- *
- * You can contact Ascensio System SIA at 17-2 Elijas street, Riga, Latvia, EU, LV-1021.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
- *
- */
-
-namespace OCA\Onlyoffice;
-
-use OCP\User;
-
-use OCA\Onlyoffice\AppInfo\Application;
-use OCA\Onlyoffice\Controller\SettingsController;
-
-User::checkAdminUser();
-
-$app = new Application();
-$container = $app->getContainer();
-$response = $container->query(SettingsController::class)->index();
-
-return $response->render();
diff --git a/templates/settings.php b/templates/settings.php
index b7b567a..395705c 100644
--- a/templates/settings.php
+++ b/templates/settings.php
@@ -31,50 +31,65 @@
script("onlyoffice", "settings");
?>
<div class="section section-onlyoffice">
- <h2>ONLYOFFICE</h2>
- <a target="_blank" class="icon-info svg" title="" href="https://api.onlyoffice.com/editors/nextcloud" data-original-title="<?php p($l->t("Documentation")) ?>"></a>
+ <h2>
+ ONLYOFFICE
+ <a target="_blank" class="icon-info svg" title="" href="https://api.onlyoffice.com/editors/nextcloud" data-original-title="<?php p($l->t("Documentation")) ?>"></a>
+ </h2>
- <p><?php p($l->t("ONLYOFFICE Document Service Location specifies the address of the server with the document services installed. Please change the '<documentserver>' for the server address in the below line.")) ?></p>
+ <h3><?php p($l->t("Server settings")) ?></h3>
<?php if ($_["encryption"]) { ?>
<p class="onlyoffice-error">
<?php p($l->t("Encryption App is enabled, the application cannot work. You can continue working with the application if you enable master key.")) ?>
<a target="_blank" class="icon-info svg" title="" href="https://api.onlyoffice.com/editors/nextcloud#masterKey" data-original-title="encryption:enable-master-key"></a>
</p>
+ <br />
<?php } ?>
- <p class="onlyoffice-header"><?php p($l->t("Document Editing Service address")) ?></p>
- <input id="onlyofficeUrl" value="<?php p($_["documentserver"]) ?>" placeholder="https://<documentserver>/" type="text">
+ <p class="settings-hint"><?php p($l->t("ONLYOFFICE Document Service Location specifies the address of the server with the document services installed. Please change the '<documentserver>' for the server address in the below line.")) ?></p>
+
+ <p><?php p($l->t("Document Editing Service address")) ?></p>
+ <p><input id="onlyofficeUrl" value="<?php p($_["documentserver"]) ?>" placeholder="https://<documentserver>/" type="text"></p>
- <a id="onlyofficeAdv" class="onlyoffice-link-action onlyoffice-header"><?php p($l->t("Advanced server settings")) ?></a>
+ <p class="onlyoffice-header"><?php p($l->t("Secret key (leave blank to disable)")) ?></p>
+ <p><input id="onlyofficeSecret" value="<?php p($_["secret"]) ?>" placeholder="secret" type="text"></p>
+
+ <p>
+ <a id="onlyofficeAdv" class="onlyoffice-header">
+ <?php p($l->t("Advanced server settings")) ?>
+ <span class="icon icon-triangle-s"></span>
+ </a>
+ </p>
<div id="onlyofficeSecretPanel" class="onlyoffice-hide">
<p class="onlyoffice-header"><?php p($l->t("Document Editing Service address for internal requests from the server")) ?></p>
- <input id="onlyofficeInternalUrl" value="<?php p($_["documentserverInternal"]) ?>" placeholder="https://<documentserver>/" type="text">
+ <p><input id="onlyofficeInternalUrl" value="<?php p($_["documentserverInternal"]) ?>" placeholder="https://<documentserver>/" type="text"></p>
<p class="onlyoffice-header"><?php p($l->t("Server address for internal requests from the Document Editing Service")) ?></p>
- <input id="onlyofficeStorageUrl" value="<?php p($_["storageUrl"]) ?>" placeholder="<?php p($_["currentServer"]) ?>" type="text">
-
- <p class="onlyoffice-header"><?php p($l->t("Secret key (leave blank to disable)")) ?></p>
- <input id="onlyofficeSecret" value="<?php p($_["secret"]) ?>" placeholder="secret" type="text">
+ <p><input id="onlyofficeStorageUrl" value="<?php p($_["storageUrl"]) ?>" placeholder="<?php p($_["currentServer"]) ?>" type="text"></p>
</div>
- <br id="onlyofficeSaveBreak" />
+ <br />
- <p class="onlyoffice-header">
+ <p><button id="onlyofficeAddrSave" class="button"><?php p($l->t("Save")) ?></button></p>
+
+</div>
+
+<div class="section section-onlyoffice section-onlyoffice-2 <?php if (empty($_["documentserver"]) || !$_["successful"]) { ?>onlyoffice-hide<?php } ?>">
+ <h3><?php p($l->t("Common settings")) ?></h3>
+
+ <p>
<input type="checkbox" class="checkbox" id="onlyofficeGroups"
<?php if (count($_["limitGroups"]) > 0) { ?>checked="checked"<?php } ?> />
<label for="onlyofficeGroups"><?php p($l->t("Restrict access to editors to following groups")) ?></label>
<input type="hidden" id="onlyofficeLimitGroups" value="<?php p(implode("|", $_["limitGroups"])) ?>" style="display: block; margin-top: 6px; width: 250px;" />
</p>
- <br />
- <p class="onlyoffice-header">
+ <p>
<input type="checkbox" class="checkbox" id="onlyofficeSameTab"
<?php if ($_["sameTab"]) { ?>checked="checked"<?php } ?> />
<label for="onlyofficeSameTab"><?php p($l->t("Open file in the same tab")) ?></label>
</p>
- <br />
- <h3 class="onlyoffice-header"><?php p($l->t("The default application for opening the format")) ?></h3>
+ <p class="onlyoffice-header"><?php p($l->t("The default application for opening the format")) ?></p>
<div class="onlyoffice-exts">
<?php foreach ($_["formats"] as $format => $setting) { ?>
<?php if (array_key_exists("mime", $setting)) { ?>
@@ -89,8 +104,10 @@
<?php } ?>
</div>
- <h3 class="onlyoffice-header"><?php p($l->t("Open the file for editing (due to format restrictions, the data might be lost when saving to the formats from the list below)")) ?></h3>
- <a target="_blank" class="icon-info svg" title="" href="https://api.onlyoffice.com/editors/nextcloud#editable" data-original-title="<?php p($l->t("View details")) ?>"></a>
+ <p class="onlyoffice-header">
+ <?php p($l->t("Open the file for editing (due to format restrictions, the data might be lost when saving to the formats from the list below)")) ?>
+ <a target="_blank" class="icon-info svg" title="" href="https://api.onlyoffice.com/editors/nextcloud#editable" data-original-title="<?php p($l->t("View details")) ?>"></a>
+ </p>
<div class="onlyoffice-exts">
<?php foreach ($_["formats"] as $format => $setting) { ?>
<?php if (array_key_exists("editable", $setting)) { ?>
@@ -104,6 +121,45 @@
<?php } ?>
<?php } ?>
</div>
+ <br />
+
+ <h3>
+ <?php p($l->t("Editor customization settings")) ?>
+ <a target="_blank" class="icon-info svg" title="" href="https://api.onlyoffice.com/editors/config/editor/customization" data-original-title="<?php p($l->t("View details")) ?>"></a>
+ </h3>
+
+ <p><?php p($l->t("The customization section allows to customize the editor interface")) ?></p>
+
+ <p>
+ <input type="checkbox" class="checkbox" id="onlyofficeChat"
+ <?php if ($_["chat"]) { ?>checked="checked"<?php } ?> />
+ <label for="onlyofficeChat"><?php p($l->t("Display Chat menu button")) ?></label>
+ </p>
+
+ <p>
+ <input type="checkbox" class="checkbox" id="onlyofficeCompactHeader"
+ <?php if ($_["compactHeader"]) { ?>checked="checked"<?php } ?> />
+ <label for="onlyofficeCompactHeader"><?php p($l->t("Display the header more compact")) ?></label>
+ </p>
+
+ <p>
+ <input type="checkbox" class="checkbox" id="onlyofficeFeedback"
+ <?php if ($_["feedback"]) { ?>checked="checked"<?php } ?> />
+ <label for="onlyofficeFeedback"><?php p($l->t("Display Feedback & Support menu button")) ?></label>
+ </p>
+
+ <p>
+ <input type="checkbox" class="checkbox" id="onlyofficeHelp"
+ <?php if ($_["help"]) { ?>checked="checked"<?php } ?> />
+ <label for="onlyofficeHelp"><?php p($l->t("Display Help menu button")) ?></label>
+ </p>
+
+ <p>
+ <input type="checkbox" class="checkbox" id="onlyofficeToolbarNoTabs"
+ <?php if (!$_["toolbarNoTabs"]) { ?>checked="checked"<?php } ?> />
+ <label for="onlyofficeToolbarNoTabs"><?php p($l->t("Display toolbar tabs")) ?></label>
+ </p>
+ <br />
- <a id="onlyofficeSave" class="button onlyoffice-header"><?php p($l->t("Save")) ?></a>
+ <p><button id="onlyofficeSave" class="button"><?php p($l->t("Save")) ?></button></p>
</div> \ No newline at end of file