make counted task in menu selectable

This commit is contained in:
Uwe Steinmann 2018-03-26 10:00:20 +02:00
parent 8d7e6715fa
commit 939cbd7a56
3 changed files with 31 additions and 1 deletions

View File

@ -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);

View File

@ -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");

View File

@ -288,6 +288,17 @@ if(!is_writeable($settings->_configFilePath)) {
<tr title="<?php printMLText("settings_enableMenuTasks_desc");?>">
<td><?php printMLText("settings_enableMenuTasks");?>:</td>
<td><input name="enableMenuTasks" type="checkbox" <?php if ($settings->_enableMenuTasks) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_tasksInMenu_desc");?>">
<td><?php printMLText("settings_tasksInMenu");?>:</td>
<td>
<select name="tasksInMenu[]" multiple>
<option value="review" <?php if (in_array('review', $settings->_tasksInMenu)) echo "selected" ?>><?php printMLText("settings_tasksInMenu_review");?></option>
<option value="approval" <?php if (in_array('approval', $settings->_tasksInMenu)) echo "selected" ?>><?php printMLText("settings_tasksInMenu_approval");?></option>
<option value="receipt" <?php if (in_array('receipt', $settings->_tasksInMenu)) echo "selected" ?>><?php printMLText("settings_tasksInMenu_receipt");?></option>
<option value="revision" <?php if (in_array('revision', $settings->_tasksInMenu)) echo "selected" ?>><?php printMLText("settings_tasksInMenu_revision");?></option>
</select>
</td>
</tr>
<tr title="<?php printMLText("settings_enableDropFolderList_desc");?>">
<td><?php printMLText("settings_enableDropFolderList");?>:</td>