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:
Diffstat (limited to 'lib/appconfig.php')
-rw-r--r--lib/appconfig.php97
1 files changed, 92 insertions, 5 deletions
diff --git a/lib/appconfig.php b/lib/appconfig.php
index 620c4ca..b3d0af4 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -117,6 +117,13 @@ class AppConfig {
private $_preview = "preview";
/**
+ * The config key for the advanced
+ *
+ * @var string
+ */
+ private $_advanced = "advanced";
+
+ /**
* The config key for the keep versions history
*
* @var string
@@ -173,6 +180,13 @@ class AppConfig {
private $_customizationReviewDisplay = "customizationReviewDisplay";
/**
+ * The config key for the theme setting
+ *
+ * @var string
+ */
+ private $_customizationTheme = "customizationTheme";
+
+ /**
* The config key for the setting limit groups
*
* @var string
@@ -278,6 +292,13 @@ class AppConfig {
public $_customization_goback = "customization_goback";
/**
+ * The config key for the macros
+ *
+ * @var string
+ */
+ public $_customizationMacros = "customization_macros";
+
+ /**
* @param string $AppName - application name
*/
public function __construct($AppName) {
@@ -645,6 +666,26 @@ class AppConfig {
}
/**
+ * Get advanced setting
+ *
+ * @return bool
+ */
+ public function GetAdvanced() {
+ return $this->config->getAppValue($this->appName, $this->_advanced, "false") === "true";
+ }
+
+ /**
+ * Save advanced setting
+ *
+ * @param bool $value - advanced
+ */
+ public function SetAdvanced($value) {
+ $this->logger->info("Set advanced: " . json_encode($value), ["app" => $this->appName]);
+
+ $this->config->setAppValue($this->appName, $this->_advanced, json_encode($value));
+ }
+
+ /**
* Get generate preview setting
*
* @return bool
@@ -821,6 +862,33 @@ class AppConfig {
}
/**
+ * Save theme setting
+ *
+ * @param string $value - theme
+ */
+ public function SetCustomizationTheme($value) {
+ $this->logger->info("Set theme: " . $value, array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationTheme, $value);
+ }
+
+ /**
+ * Get theme setting
+ *
+ * @return string
+ */
+ public function GetCustomizationTheme() {
+ $value = $this->config->getAppValue($this->appName, $this->_customizationTheme, "theme-classic-light");
+ if ($value === "theme-light") {
+ return "theme-light";
+ }
+ if ($value === "theme-dark") {
+ return "theme-dark";
+ }
+ return "theme-classic-light";
+ }
+
+ /**
* Save watermark settings
*
* @param array $settings - watermark settings
@@ -875,7 +943,7 @@ class AppConfig {
*/
public function GetWatermarkSettings() {
$result = [
- "text" => $this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, "watermark_text", "{userId}"),
+ "text" => $this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, "watermark_text", "{userId}, {date}"),
];
$watermarkLabels = [
@@ -1090,6 +1158,25 @@ class AppConfig {
return $result;
}
+ /**
+ * Save macros setting
+ *
+ * @param bool $value - enable macros
+ */
+ public function SetCustomizationMacros($value) {
+ $this->logger->info("Set macros enabled: " . json_encode($value), ["app" => $this->appName]);
+
+ $this->config->setAppValue($this->appName, $this->_customizationMacros, json_encode($value));
+ }
+
+ /**
+ * Get macros setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationMacros() {
+ return $this->config->getAppValue($this->appName, $this->_customizationMacros, "true") === "true";
+ }
/**
* Additional data about formats
@@ -1100,8 +1187,8 @@ class AppConfig {
"csv" => [ "mime" => "text/csv", "type" => "cell", "edit" => true, "editable" => true, "saveas" => ["ods", "pdf", "xlsx"] ],
"doc" => [ "mime" => "application/msword", "type" => "word", "conv" => true, "saveas" => ["docx", "odt", "pdf", "rtf", "txt"] ],
"docm" => [ "mime" => "application/vnd.ms-word.document.macroEnabled.12", "type" => "word", "conv" => true, "saveas" => ["docx", "odt", "pdf", "rtf", "txt"] ],
- "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "word", "edit" => true, "def" => true, "saveas" => ["odt", "pdf", "rtf", "txt", "docxf"] ],
- "docxf" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf", "type" => "word", "edit" => true, "def" => true, "saveas" => ["odt", "pdf", "rtf", "txt"], "createForm" => true ],
+ "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "word", "edit" => true, "def" => true, "review" => true, "comment" => true, "saveas" => ["odt", "pdf", "rtf", "txt", "docxf"] ],
+ "docxf" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf", "type" => "word", "edit" => true, "def" => true, "review" => true, "comment" => true, "saveas" => ["odt", "pdf", "rtf", "txt"], "createForm" => true ],
"oform" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform", "type" => "word", "fillForms" => true, "def" => true ],
"dot" => [ "type" => "word", "conv" => true, "saveas" => ["docx", "odt", "pdf", "rtf", "txt"] ],
"dotx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "type" => "word", "conv" => true, "saveas" => ["docx", "odt", "pdf", "rtf", "txt"] ],
@@ -1123,12 +1210,12 @@ class AppConfig {
"ppsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "type" => "slide", "conv" => true, "saveas" => ["pdf", "pptx", "odp"] ],
"ppt" => [ "mime" => "application/vnd.ms-powerpoint", "type" => "slide", "conv" => true, "saveas" => ["pdf", "pptx", "odp"] ],
"pptm" => [ "mime" => "application/vnd.ms-powerpoint.presentation.macroEnabled.12", "type" => "slide", "conv" => true, "saveas" => ["pdf", "pptx", "odp"] ],
- "pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "slide", "edit" => true, "def" => true, "saveas" => ["pdf", "odp"] ],
+ "pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "slide", "edit" => true, "def" => true, "comment" => true, "saveas" => ["pdf", "odp"] ],
"rtf" => [ "mime" => "text/rtf", "type" => "word", "conv" => true, "editable" => true, "saveas" => ["docx", "odt", "pdf", "txt"] ],
"txt" => [ "mime" => "text/plain", "type" => "word", "edit" => true, "editable" => true, "saveas" => ["docx", "odt", "pdf", "rtf"] ],
"xls" => [ "mime" => "application/vnd.ms-excel", "type" => "cell", "conv" => true, "saveas" => ["csv", "ods", "pdf", "xlsx"] ],
"xlsm" => [ "mime" => "application/vnd.ms-excel.sheet.macroEnabled.12", "type" => "cell", "conv" => true, "saveas" => ["csv", "ods", "pdf", "xlsx"] ],
- "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "cell", "edit" => true, "def" => true, "saveas" => ["csv", "ods", "pdf"] ],
+ "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "cell", "edit" => true, "def" => true, "comment" => true, "modifyFilter" => true, "saveas" => ["csv", "ods", "pdf"] ],
"xlt" => [ "type" => "cell", "conv" => true, "saveas" => ["csv", "ods", "pdf", "xlsx"] ],
"xltm" => [ "mime" => "application/vnd.ms-excel.template.macroEnabled.12", "type" => "cell", "conv" => true, "saveas" => ["csv", "ods", "pdf", "xlsx"] ],
"xltx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "type" => "cell", "conv" => true, "saveas" => ["csv", "ods", "pdf", "xlsx"] ]