From 92b7f1fe41234dd2b9e23f22c502141eda88bbda Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 26 Oct 2016 19:28:10 +0200 Subject: [PATCH 1/3] get boolean value of showSingleSearchHit with getBoolValue() --- op/op.Settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op/op.Settings.php b/op/op.Settings.php index 7873ea292..a4f346ec5 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -72,7 +72,7 @@ if ($action == "saveSettings") $settings->_maxSizeForFullText = intval($_POST["maxSizeForFullText"]); $settings->_fullSearchEngine = $_POST["fullSearchEngine"]; $settings->_defaultSearchMethod = $_POST["defaultSearchMethod"]; - $settings->_showSingleSearchHit = $_POST["showSingleSearchHit"]; + $settings->_showSingleSearchHit = getBoolValue("showSingleSearchHit"); $settings->_enableClipboard = getBoolValue("enableClipboard"); $settings->_enableDropUpload = getBoolValue("enableDropUpload"); $settings->_enableFolderTree = getBoolValue("enableFolderTree"); From 4647856c77c1a64b1b0c8b955b7d6bee6fb7ff7c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 27 Oct 2016 07:04:32 +0200 Subject: [PATCH 2/3] =?UTF-8?q?check=20if=20used=20values=20are=20in=20val?= =?UTF-8?q?ue=D1=95et?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/bootstrap/class.AttributeMgr.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.AttributeMgr.php b/views/bootstrap/class.AttributeMgr.php index 7fd0702a5..0807a8249 100644 --- a/views/bootstrap/class.AttributeMgr.php +++ b/views/bootstrap/class.AttributeMgr.php @@ -76,7 +76,7 @@ $(document).ready( function() {
@@ -89,9 +89,21 @@ $(document).ready( function() { print "\n\n"; print "".getMLText("attribute_value")."\n"; print "".getMLText("attribute_count")."\n"; + print "\n"; print "\n\n"; foreach($res['frequencies'][$type] as $entry) { - echo "".$entry['value']."".$entry['c'].""; + echo ""; + echo "".$entry['value']."".$entry['c'].""; + /* various checks, if the value is valid */ + echo ""; + /* Check if value is in value set */ + if($selattrdef->getValueSet()) { + if(false === array_search($entry['value'], $selattrdef->getValueSetAsArray())) + printMLText("attribute_value_not_in_valueset"); + } else { + } + echo ""; + echo ""; } print ""; } From 269db21067239908fd0ed79a6950c5a7720a4b58 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 27 Oct 2016 07:09:15 +0200 Subject: [PATCH 3/3] use in_array() instead of array_search() --- views/bootstrap/class.AttributeMgr.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/views/bootstrap/class.AttributeMgr.php b/views/bootstrap/class.AttributeMgr.php index 0807a8249..994c5716f 100644 --- a/views/bootstrap/class.AttributeMgr.php +++ b/views/bootstrap/class.AttributeMgr.php @@ -98,9 +98,8 @@ $(document).ready( function() { echo ""; /* Check if value is in value set */ if($selattrdef->getValueSet()) { - if(false === array_search($entry['value'], $selattrdef->getValueSetAsArray())) + if(in_array($entry['value'], $selattrdef->getValueSetAsArray())) printMLText("attribute_value_not_in_valueset"); - } else { } echo ""; echo "";