From 8e3f265f1e502ba3011888b725045406193ce8e8 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Wed, 22 Mar 2006 00:47:13 +0000
Subject: Added support to array-typed hidden field.
---
framework/Web/UI/TClientScriptManager.php | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 01be9944..015ef1c1 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -285,7 +285,8 @@ class TClientScriptManager extends TApplicationComponent
/**
* Registers a hidden field to be rendered in the form.
* @param string a unique key identifying the hidden field
- * @param string hidden field value
+ * @param string|array hidden field value, if the value is an array, every element
+ * in the array will be rendered as a hidden field value.
*/
public function registerHiddenField($name,$value)
{
@@ -446,8 +447,15 @@ class TClientScriptManager extends TApplicationComponent
{
if($value!==true)
{
- $value=THttpUtility::htmlEncode($value);
- $str.="\n";
+ if(is_array($value))
+ {
+ foreach($value as $v)
+ $str.='\n";
+ }
+ else
+ {
+ $str.='\n";
+ }
// set hidden field value to true to indicate this field is rendered
// Note, hidden field rendering is invoked twice (at the beginning and ending of TForm)
$this->_hiddenFields[$name]=true;
--
cgit v1.2.3