diff options
| author | Christian Fowler <spider@viovio.com> | 2011-03-16 19:00:16 -0400 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2011-03-16 19:00:16 -0400 |
| commit | d862f8f9f5912aa2d20ef4ad069a8c33376eddf4 (patch) | |
| tree | 7332c5deb296187bef625613a442223ec5fd9b21 | |
| parent | e35c374493612c36f32e3227d33f0e8d870d7c42 (diff) | |
| download | themes-d862f8f9f5912aa2d20ef4ad069a8c33376eddf4.tar.gz themes-d862f8f9f5912aa2d20ef4ad069a8c33376eddf4.tar.bz2 themes-d862f8f9f5912aa2d20ef4ad069a8c33376eddf4.zip | |
handle nested arrays for feedback
| -rw-r--r-- | smartyplugins/function.formfeedback.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/smartyplugins/function.formfeedback.php b/smartyplugins/function.formfeedback.php index 6b49826..48a5399 100644 --- a/smartyplugins/function.formfeedback.php +++ b/smartyplugins/function.formfeedback.php @@ -51,7 +51,13 @@ function smarty_function_formfeedback( $params, &$gBitSmarty ) { } foreach( $val as $valText ) { - $feedback .= '<p id="fat'.rand( 0, 10000 ).'" class="fade-'.$color.' '.$key.'">'.smarty_function_biticon( $biticon, $gBitSmarty ).' '.$valText.'</p>'; + if( is_array( $valText ) ) { + foreach( $valText as $text ) { + $feedback .= '<p id="fat'.rand( 0, 10000 ).'" class="fade-'.$color.' '.$key.'">'.smarty_function_biticon( $biticon, $gBitSmarty ).' '.$text.'</p>'; + } + } else { + $feedback .= '<p id="fat'.rand( 0, 10000 ).'" class="fade-'.$color.' '.$key.'">'.smarty_function_biticon( $biticon, $gBitSmarty ).' '.$valText.'</p>'; + } } } else { @@ -59,8 +65,14 @@ function smarty_function_formfeedback( $params, &$gBitSmarty ) { * to allow setting of a background color we have to exclude that param when rendering out the html * otherwise we'll render the color as text. -wjames5 */ - if ( $key != 'color' ){ - $feedback .= '<p class="'.$key.'">'.$val.'</p>'; + if ( $key != 'color' ) { + if( is_array( $val ) ) { + foreach( $val as $text ) { + $feedback .= '<p class="'.$key.'">'.$text.'</p>'; + } + } else { + $feedback .= '<p class="'.$key.'">'.$val.'</p>'; + } } } } @@ -74,4 +86,5 @@ function smarty_function_formfeedback( $params, &$gBitSmarty ) { } return $html; } + ?> |
