From 903044dc98505e0a22acf9f41ec12fd365d43e52 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 16 Jan 2008 19:56:31 +0000 Subject: [PATCH] support textarea for config options --- lam/lib/modules.inc | 3 ++- lam/templates/config/confmain.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 284f096c..3a05f0a7 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -606,12 +606,13 @@ function parseHtml($module, $input, $values, $restricted, &$tabindex, &$tabindex echo ' rows="' . $input[$i][$j]['rows'] . '"'; echo ">"; if (isset($values[$input[$i][$j]['name']])) { - echo htmlspecialchars($values[$input[$i][$j]['name']], ENT_QUOTES, "UTF-8"); + echo htmlspecialchars(implode("\r\n", $values[$input[$i][$j]['name']]), ENT_QUOTES, "UTF-8"); } else { echo htmlspecialchars($input[$i][$j]['value'], ENT_QUOTES, "UTF-8"); } echo ""; + $ret[$input[$i][$j]['name']] = 'textarea'; // save type break; // inner fieldset case 'fieldset': diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index 35a59a81..597d22fb 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -572,6 +572,10 @@ function saveSettings() { elseif ($_SESSION['conf_types'][$element] == "multiselect") { $options[$element] = $_POST[$element]; // value is already an array } + // textarea + elseif ($_SESSION['conf_types'][$element] == "textarea") { + $options[$element] = explode("\r\n", $_POST[$element]); + } } // get list of scopes of modules