From 939cbd7a5641c68ece2c99ce332bd9257012a07e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 26 Mar 2018 10:00:20 +0200 Subject: [PATCH] make counted task in menu selectable --- inc/inc.ClassSettings.php | 20 +++++++++++++++++++- op/op.Settings.php | 1 + views/bootstrap/class.Settings.php | 11 +++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index d6747c118..29f3f8ff0 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -214,6 +214,8 @@ class Settings { /* {{{ */ var $_enableClipboard = true; // enable/disable list of tasks in main menu var $_enableMenuTasks = true; + // select which tasks show up in main menu + var $_tasksInMenu = array(); // enable/disable list of files in drop folder var $_enableDropFolderList = false; // enable/disable display of the session list @@ -379,6 +381,18 @@ class Settings { /* {{{ */ return $out; } /* }}} */ + /** + * Check if a variable is a string and returns an array + * + * @param array $var value + * @return true/false + */ + function arrayVal($var) { /* {{{ */ + if((string) $var) + return explode(';', $var); + return array(); + } /* }}} */ + /** * set $_viewOnlineFileTypes * @@ -473,6 +487,7 @@ class Settings { /* {{{ */ $this->_enableSessionList = Settings::boolVal($tab["enableSessionList"]); $this->_enableClipboard = Settings::boolVal($tab["enableClipboard"]); $this->_enableMenuTasks = Settings::boolVal($tab["enableMenuTasks"]); + $this->_tasksInMenu = Settings::arrayVal($tab["tasksInMenu"]); $this->_enableDropFolderList = Settings::boolVal($tab["enableDropFolderList"]); $this->_enableDropUpload = Settings::boolVal($tab["enableDropUpload"]); $this->_enableMultiUpload = Settings::boolVal($tab["enableMultiUpload"]); @@ -733,7 +748,9 @@ class Settings { /* {{{ */ $attributValue = "true"; else $attributValue = "false"; - } + } elseif(is_array($attributValue)) { + $attributValue = implode(';', $attributValue); + } if (isset($node[$attributName])) { $node[$attributName] = $attributValue; @@ -808,6 +825,7 @@ class Settings { /* {{{ */ $this->setXMLAttributValue($node, "enableSessionList", $this->_enableSessionList); $this->setXMLAttributValue($node, "enableClipboard", $this->_enableClipboard); $this->setXMLAttributValue($node, "enableMenuTasks", $this->_enableMenuTasks); + $this->setXMLAttributValue($node, "tasksInMenu", $this->_tasksInMenu); $this->setXMLAttributValue($node, "enableDropFolderList", $this->_enableDropFolderList); $this->setXMLAttributValue($node, "enableDropUpload", $this->_enableDropUpload); $this->setXMLAttributValue($node, "enableMultiUpload", $this->_enableMultiUpload); diff --git a/op/op.Settings.php b/op/op.Settings.php index 8c8aec43b..e16129949 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -88,6 +88,7 @@ if ($action == "saveSettings") $settings->_enableSessionList = getBoolValue("enableSessionList"); $settings->_enableClipboard = getBoolValue("enableClipboard"); $settings->_enableMenuTasks = getBoolValue("enableMenuTasks"); + $settings->_tasksInMenu = $_POST["tasksInMenu"]; $settings->_enableDropFolderList = getBoolValue("enableDropFolderList"); $settings->_enableDropUpload = getBoolValue("enableDropUpload"); $settings->_enableMultiUpload = getBoolValue("enableMultiUpload"); diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 1d924fcf4..748638bda 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -288,6 +288,17 @@ if(!is_writeable($settings->_configFilePath)) { "> : _enableMenuTasks) echo "checked" ?> /> + + "> + : + + + "> :