From 526ae37b083f266105b95c63b99ff0b3200bf109 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 9 Mar 2016 07:45:37 +0100 Subject: [PATCH] add new parameter editOnlineFileTypes --- inc/inc.ClassSettings.php | 24 ++++++++++++++++++++++++ op/op.Settings.php | 1 + views/bootstrap/class.Settings.php | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index 443344e6e..71d523703 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -103,6 +103,8 @@ class Settings { /* {{{ */ var $_updateNotifyTime = 86400; // files with one of the following endings can be viewed online var $_viewOnlineFileTypes = array(); + // files with one of the following endings can be edited online + var $_editOnlineFileTypes = array(); // enable/disable converting of files var $_enableConverting = false; // default style @@ -310,6 +312,26 @@ class Settings { /* {{{ */ return implode(";", $this->_viewOnlineFileTypes); } /* }}} */ + /** + * set $_editOnlineFileTypes + * + * @param string $stringValue string value + * + */ + function setEditOnlineFileTypesFromString($stringValue) { /* {{{ */ + $this->_editOnlineFileTypes = explode(";", $stringValue); + } /* }}} */ + + /** + * get $_editOnlineFileTypes in a string value + * + * @return string value + * + */ + function getEditOnlineFileTypesToString() { /* {{{ */ + return implode(";", $this->_editOnlineFileTypes); + } /* }}} */ + /** * Load config file * @@ -345,6 +367,7 @@ class Settings { /* {{{ */ $tab = $node[0]->attributes(); $this->_strictFormCheck = Settings::boolVal($tab["strictFormCheck"]); $this->setViewOnlineFileTypesFromString(strval($tab["viewOnlineFileTypes"])); + $this->setEditOnlineFileTypesFromString(strval($tab["editOnlineFileTypes"])); $this->_enableConverting = Settings::boolVal($tab["enableConverting"]); $this->_enableEmail = Settings::boolVal($tab["enableEmail"]); $this->_enableUsersView = Settings::boolVal($tab["enableUsersView"]); @@ -623,6 +646,7 @@ class Settings { /* {{{ */ $node = $this->getXMLNode($xml, '/configuration/site', 'edition'); $this->setXMLAttributValue($node, "strictFormCheck", $this->_strictFormCheck); $this->setXMLAttributValue($node, "viewOnlineFileTypes", $this->getViewOnlineFileTypesToString()); + $this->setXMLAttributValue($node, "editOnlineFileTypes", $this->getEditOnlineFileTypesToString()); $this->setXMLAttributValue($node, "enableConverting", $this->_enableConverting); $this->setXMLAttributValue($node, "enableEmail", $this->_enableEmail); $this->setXMLAttributValue($node, "enableUsersView", $this->_enableUsersView); diff --git a/op/op.Settings.php b/op/op.Settings.php index 141156e83..f39679ef6 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -63,6 +63,7 @@ if ($action == "saveSettings") // SETTINGS - SITE - EDITION $settings->_strictFormCheck = getBoolValue("strictFormCheck"); $settings->setViewOnlineFileTypesFromString($_POST["viewOnlineFileTypes"]); + $settings->setEditOnlineFileTypesFromString($_POST["editOnlineFileTypes"]); $settings->_enableConverting = getBoolValue("enableConverting"); $settings->_enableEmail =getBoolValue("enableEmail"); $settings->_enableUsersView = getBoolValue("enableUsersView"); diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 85e5d599c..196aee8e9 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -166,6 +166,10 @@ if(!is_writeable($settings->_configFilePath)) { : showTextField("viewOnlineFileTypes", $settings->getViewOnlineFileTypesToString()); ?> + "> + : + showTextField("editOnlineFileTypes", $settings->getEditOnlineFileTypesToString()); ?> + "> : _enableConverting) echo "checked" ?> />