cvs: smarty / NEWS /libs/plugins function.html_checkboxes.php function.html_options.php function.html_radios.php
| From: | Messju Mohr | Date: | Tue, 18 Mar 2003 00:01:42 +0000 |
| Subject: | cvs: smarty / NEWS /libs/plugins function.html_checkboxes.php function.html_options.php function.html_radios.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-466@lists.php.net to get a copy of this message | ||
messju Mon Mar 17 19:01:42 2003 EDT
Modified files:
/smarty NEWS
/smarty/libs/plugins function.html_checkboxes.php
function.html_options.php
function.html_radios.php
Log:
html_options, html_checkboxes and html_radios now pass-thru all unknown paramters
Index: smarty/NEWS diff -u smarty/NEWS:1.313 smarty/NEWS:1.314 --- smarty/NEWS:1.313 Mon Mar 17 11:36:01 2003 +++ smarty/NEWS Mon Mar 17 19:01:41 2003 @@ -1,4 +1,6 @@ - - html_options passthru all unknown paramters now + - html_checkboxes and html_radios passthru all unknown paramters now + additionally their output is now XHTML compliant (messju) + - html_options passthru all unknown paramters now (messju) - fix link functionality of html_image, also make output XHTML compatible (Hinrich Donner, Monte) - append "@" to default modifier vars/args Index: smarty/libs/plugins/function.html_checkboxes.php diff -u smarty/libs/plugins/function.html_checkboxes.php:1.3 smarty/libs/plugins/function.html_checkboxes.php:1.4 --- smarty/libs/plugins/function.html_checkboxes.php:1.3 Fri Feb 28 10:08:14 2003 +++ smarty/libs/plugins/function.html_checkboxes.php Mon Mar 17 19:01:41 2003 @@ -24,41 +24,75 @@ */ function smarty_function_html_checkboxes($params, &$smarty) { - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + + $name = 'checkbox'; + $values = null; + $checkboxes = null; + $checked = null; + $separator = ''; + $output = null; + + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + case 'separator': + $$_key = $_val; + break; + + case 'checkboxes': + $$_key = (array)$_val; + break; + + case 'values': + case 'output': + case 'checked': + $$_key = array_values((array)$_val); + break; + + default: + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + break; + } + } + + if (!isset($checkboxes) && !isset($values)) + return ''; /* raise error here? */ + + settype($checked, 'array'); + $_html_result = ''; + + if (is_array($checkboxes)) { + + foreach ($checkboxes as $_key=>$_val) + $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $checked, $extra, $separator); + + + } else { + foreach ($values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $checked, $extra, $separator); + } - extract($params); + } - $_html_result = ''; - if(!isset($name)){ - $name = 'checkbox'; - } - settype($checked, 'array'); - if (isset($checkboxes)) { - settype($checkboxes, 'array'); - foreach ($checkboxes as $_key => $_val) { - $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $checked, $separator); - } - } else { - settype($output, 'array'); - settype($values, 'array'); - for ($_i = 0, $_for_max = count($output); $_i < $_for_max; $_i++) { - $_html_result .= smarty_function_html_checkboxes_output($name, $values[$_i], $output[$_i], $checked, $separator); - } - } - - return $_html_result; + return $_html_result; + } -function smarty_function_html_checkboxes_output($name, $value, $output, $checked, $separator) { - $_output = '<input type="checkbox" name="' . smarty_function_escape_special_chars($name) . '[]' .'" value="' . smarty_function_escape_special_chars($value) . '"'; - - if (in_array($value, $checked)) { - $_output .= " checked=\"checked\""; - } - $_output .= '>' . $output . $separator . "\n"; - - return $_output; +function smarty_function_html_checkboxes_output($name, $value, $output, $checked, $extra, $separator) { + $_output = '<input type="checkbox" name="' + . smarty_function_escape_special_chars($name) . '[]" value="' + . smarty_function_escape_special_chars($value) . '"'; + + if (in_array($value, $checked)) { + $_output .= ' checked="checked"'; + } + $_output .= $extra . ' />' . $output . $separator . "\n"; + + return $_output; } - ?> Index: smarty/libs/plugins/function.html_options.php diff -u smarty/libs/plugins/function.html_options.php:1.12 smarty/libs/plugins/function.html_options.php:1.13 --- smarty/libs/plugins/function.html_options.php:1.12 Mon Mar 17 11:36:02 2003 +++ smarty/libs/plugins/function.html_options.php Mon Mar 17 19:01:41 2003 @@ -5,71 +5,96 @@ * ------------------------------------------------------------- * Type: function * Name: html_options + * Input: name (optional) - string default "select" + * values (required if no options supplied) - array + * options (required if no values supplied) - associative array + * selected (optional) - string default not set + * output (required if not options supplied) - array * Purpose: Prints the list of <option> tags generated from * the passed parameters * ------------------------------------------------------------- */ function smarty_function_html_options($params, &$smarty) { - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + + $name = 'select'; + $values = null; + $options = null; + $selected = array(); + $output = null; + + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + $$_key = (string)$_val; + break; + + case 'options': + $$_key = (array)$_val; + break; + + case 'selected': + case 'values': + case 'output': + $$_key = array_values((array)$_val); + break; + + default: + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + break; + } + } + + if (!isset($options) && !isset($values)) + return ''; /* raise error here? */ + + $_html_result = ''; + + if (is_array($options)) { + + foreach ($options as $_key=>$_val) + $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); + + } else { + + foreach ((array)$values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); + } + + } + + if(!empty($name)) { + $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n"; + } - extract($params); + return $_html_result; - $html_result = ''; - - settype($selected, 'array'); - if (isset($options)) { - settype($options, 'array'); - foreach ($options as $key => $value) { - $html_result .= smarty_function_html_options_optoutput($key, $value, $selected); - } - } else { - settype($output, 'array'); - settype($values, 'array'); - for ($i = 0, $for_max = count($output); $i < $for_max; $i++) { - if ($i < count($values)) { - $html_result .= smarty_function_html_options_optoutput($values[$i], $output[$i], $selected); - } else { - $html_result .= smarty_function_html_options_optoutput($output[$i], $output[$i], $selected); - } - } - } - - /* passthru all unknown params to $extra */ - $extra = ''; - unset($params['values']); - unset($params['output']); - unset($params['selected']); - unset($params['options']); - unset($params['name']); - foreach ($params as $key=>$value) $extra .= ' ' . $key . '="'. htmlspecialchars($value) . '"'; - - if(!empty($name)) { - $html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $html_result . '</select>' . "\n"; - } - return $html_result; } function smarty_function_html_options_optoutput($key, $value, $selected) { - if(!is_array($value)) { - $html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . - smarty_function_escape_special_chars($key) . '"'; - if (in_array($key, $selected)) - $html_result .= " selected=\"selected\""; - $html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; - } else { - $html_result = smarty_function_html_options_optgroup($key, $value, $selected); - } - return $html_result; + if(!is_array($value)) { + $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . + smarty_function_escape_special_chars($key) . '"'; + if (in_array($key, $selected)) + $_html_result .= ' selected="selected"'; + $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; + } else { + $_html_result = smarty_function_html_options_optgroup($key, $value, $selected); + } + return $_html_result; } function smarty_function_html_options_optgroup($key, $values, $selected) { - $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($value) . '">' . "\n"; - foreach ($values as $key => $value) { - $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); - } - $optgroup_html .= "</optgroup>\n"; - return $optgroup_html; + $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($value) . '">' . "\n"; + foreach ($values as $key => $value) { + $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); + } + $optgroup_html .= "</optgroup>\n"; + return $optgroup_html; } /* vim: set expandtab: */ Index: smarty/libs/plugins/function.html_radios.php diff -u smarty/libs/plugins/function.html_radios.php:1.6 smarty/libs/plugins/function.html_radios.php:1.7 --- smarty/libs/plugins/function.html_radios.php:1.6 Fri Mar 14 10:52:34 2003 +++ smarty/libs/plugins/function.html_radios.php Mon Mar 17 19:01:41 2003 @@ -22,42 +22,75 @@ * {html_radios values=$ids checked=$checked separator='<br>' output=$names} * ------------------------------------------------------------- */ -require_once $this->_get_plugin_filepath('shared','escape_special_chars'); function smarty_function_html_radios($params, &$smarty) { - extract($params); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); - $_html_result = ''; - if(!isset($name)){ - $name = 'radio'; - } - settype($checked, 'array'); - if (isset($radios)) { - settype($radios, 'array'); - foreach ($radios as $_key => $_val) { - $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $checked, $separator); - } - } else { - settype($output, 'array'); - settype($values, 'array'); - for ($_i = 0, $_for_max = count($output); $_i < $_for_max; $_i++) { - $_html_result .= smarty_function_html_radios_output($name, $values[$_i], $output[$_i], $checked, $separator); - } - } + $name = 'radio'; + $values = null; + $radios = null; + $checked = null; + $separator = ''; + $output = null; + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + case 'separator': + case 'checked': + $$_key = (string)$_val; + break; - return $_html_result; -} + case 'radios': + $$_key = (array)$_val; + break; + + case 'values': + case 'output': + $$_key = array_values((array)$_val); + break; + + default: + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + break; + } + } + + if (!isset($radios) && !isset($values)) + return ''; /* raise error here? */ + + $_html_result = ''; -function smarty_function_html_radios_output($name, $value, $output, $checked, $separator) { - $_output = '<input type="radio" name="' . smarty_function_escape_special_chars($name) . '" value="' . smarty_function_escape_special_chars($value) . '"'; - - if (in_array($value, $checked)) { - $_output .= " checked=\"checked\""; - } - $_output .= '>' . $output . $separator . "\n"; + if (isset($radios) && is_array($radios)) { - return $_output; + foreach ((array)$radios as $_key=>$_val) + $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $checked, $extra, $separator); + + } else { + + foreach ((array)$values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $checked, $extra, $separator); + } + + } + + return $_html_result; + } +function smarty_function_html_radios_output($name, $value, $output, $checked, $extra, $separator) { + $_output = '<input type="radio" name="' + . smarty_function_escape_special_chars($name) . '" value="' + . smarty_function_escape_special_chars($value) . '"'; + + if ($value==$checked) { + $_output .= ' checked="checked"'; + } + $_output .= $extra . ' />' . $output . $separator . "\n"; + + return $_output; +} ?>
Index: smarty/NEWS diff -u smarty/NEWS:1.313 smarty/NEWS:1.314 --- smarty/NEWS:1.313 Mon Mar 17 11:36:01 2003 +++ smarty/NEWS Mon Mar 17 19:01:41 2003 @@ -1,4 +1,6 @@ - - html_options passthru all unknown paramters now + - html_checkboxes and html_radios passthru all unknown paramters now + additionally their output is now XHTML compliant (messju) + - html_options passthru all unknown paramters now (messju) - fix link functionality of html_image, also make output XHTML compatible (Hinrich Donner, Monte) - append "@" to default modifier vars/args Index: smarty/libs/plugins/function.html_checkboxes.php diff -u smarty/libs/plugins/function.html_checkboxes.php:1.3 smarty/libs/plugins/function.html_checkboxes.php:1.4 --- smarty/libs/plugins/function.html_checkboxes.php:1.3 Fri Feb 28 10:08:14 2003 +++ smarty/libs/plugins/function.html_checkboxes.php Mon Mar 17 19:01:41 2003 @@ -24,41 +24,75 @@ */ function smarty_function_html_checkboxes($params, &$smarty) { - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + + $name = 'checkbox'; + $values = null; + $checkboxes = null; + $checked = null; + $separator = ''; + $output = null; + + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + case 'separator': + $$_key = $_val; + break; + + case 'checkboxes': + $$_key = (array)$_val; + break; + + case 'values': + case 'output': + case 'checked': + $$_key = array_values((array)$_val); + break; + + default: + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + break; + } + } + + if (!isset($checkboxes) && !isset($values)) + return ''; /* raise error here? */ + + settype($checked, 'array'); + $_html_result = ''; + + if (is_array($checkboxes)) { + + foreach ($checkboxes as $_key=>$_val) + $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $checked, $extra, $separator); + + + } else { + foreach ($values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $checked, $extra, $separator); + } - extract($params); + } - $_html_result = ''; - if(!isset($name)){ - $name = 'checkbox'; - } - settype($checked, 'array'); - if (isset($checkboxes)) { - settype($checkboxes, 'array'); - foreach ($checkboxes as $_key => $_val) { - $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $checked, $separator); - } - } else { - settype($output, 'array'); - settype($values, 'array'); - for ($_i = 0, $_for_max = count($output); $_i < $_for_max; $_i++) { - $_html_result .= smarty_function_html_checkboxes_output($name, $values[$_i], $output[$_i], $checked, $separator); - } - } - - return $_html_result; + return $_html_result; + } -function smarty_function_html_checkboxes_output($name, $value, $output, $checked, $separator) { - $_output = '<input type="checkbox" name="' . smarty_function_escape_special_chars($name) . '[]' .'" value="' . smarty_function_escape_special_chars($value) . '"'; - - if (in_array($value, $checked)) { - $_output .= " checked=\"checked\""; - } - $_output .= '>' . $output . $separator . "\n"; - - return $_output; +function smarty_function_html_checkboxes_output($name, $value, $output, $checked, $extra, $separator) { + $_output = '<input type="checkbox" name="' + . smarty_function_escape_special_chars($name) . '[]" value="' + . smarty_function_escape_special_chars($value) . '"'; + + if (in_array($value, $checked)) { + $_output .= ' checked="checked"'; + } + $_output .= $extra . ' />' . $output . $separator . "\n"; + + return $_output; } - ?> Index: smarty/libs/plugins/function.html_options.php diff -u smarty/libs/plugins/function.html_options.php:1.12 smarty/libs/plugins/function.html_options.php:1.13 --- smarty/libs/plugins/function.html_options.php:1.12 Mon Mar 17 11:36:02 2003 +++ smarty/libs/plugins/function.html_options.php Mon Mar 17 19:01:41 2003 @@ -5,71 +5,96 @@ * ------------------------------------------------------------- * Type: function * Name: html_options + * Input: name (optional) - string default "select" + * values (required if no options supplied) - array + * options (required if no values supplied) - associative array + * selected (optional) - string default not set + * output (required if not options supplied) - array * Purpose: Prints the list of <option> tags generated from * the passed parameters * ------------------------------------------------------------- */ function smarty_function_html_options($params, &$smarty) { - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + + $name = 'select'; + $values = null; + $options = null; + $selected = array(); + $output = null; + + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + $$_key = (string)$_val; + break; + + case 'options': + $$_key = (array)$_val; + break; + + case 'selected': + case 'values': + case 'output': + $$_key = array_values((array)$_val); + break; + + default: + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + break; + } + } + + if (!isset($options) && !isset($values)) + return ''; /* raise error here? */ + + $_html_result = ''; + + if (is_array($options)) { + + foreach ($options as $_key=>$_val) + $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); + + } else { + + foreach ((array)$values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); + } + + } + + if(!empty($name)) { + $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n"; + } - extract($params); + return $_html_result; - $html_result = ''; - - settype($selected, 'array'); - if (isset($options)) { - settype($options, 'array'); - foreach ($options as $key => $value) { - $html_result .= smarty_function_html_options_optoutput($key, $value, $selected); - } - } else { - settype($output, 'array'); - settype($values, 'array'); - for ($i = 0, $for_max = count($output); $i < $for_max; $i++) { - if ($i < count($values)) { - $html_result .= smarty_function_html_options_optoutput($values[$i], $output[$i], $selected); - } else { - $html_result .= smarty_function_html_options_optoutput($output[$i], $output[$i], $selected); - } - } - } - - /* passthru all unknown params to $extra */ - $extra = ''; - unset($params['values']); - unset($params['output']); - unset($params['selected']); - unset($params['options']); - unset($params['name']); - foreach ($params as $key=>$value) $extra .= ' ' . $key . '="'. htmlspecialchars($value) . '"'; - - if(!empty($name)) { - $html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $html_result . '</select>' . "\n"; - } - return $html_result; } function smarty_function_html_options_optoutput($key, $value, $selected) { - if(!is_array($value)) { - $html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . - smarty_function_escape_special_chars($key) . '"'; - if (in_array($key, $selected)) - $html_result .= " selected=\"selected\""; - $html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; - } else { - $html_result = smarty_function_html_options_optgroup($key, $value, $selected); - } - return $html_result; + if(!is_array($value)) { + $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . + smarty_function_escape_special_chars($key) . '"'; + if (in_array($key, $selected)) + $_html_result .= ' selected="selected"'; + $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; + } else { + $_html_result = smarty_function_html_options_optgroup($key, $value, $selected); + } + return $_html_result; } function smarty_function_html_options_optgroup($key, $values, $selected) { - $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($value) . '">' . "\n"; - foreach ($values as $key => $value) { - $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); - } - $optgroup_html .= "</optgroup>\n"; - return $optgroup_html; + $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($value) . '">' . "\n"; + foreach ($values as $key => $value) { + $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); + } + $optgroup_html .= "</optgroup>\n"; + return $optgroup_html; } /* vim: set expandtab: */ Index: smarty/libs/plugins/function.html_radios.php diff -u smarty/libs/plugins/function.html_radios.php:1.6 smarty/libs/plugins/function.html_radios.php:1.7 --- smarty/libs/plugins/function.html_radios.php:1.6 Fri Mar 14 10:52:34 2003 +++ smarty/libs/plugins/function.html_radios.php Mon Mar 17 19:01:41 2003 @@ -22,42 +22,75 @@ * {html_radios values=$ids checked=$checked separator='<br>' output=$names} * ------------------------------------------------------------- */ -require_once $this->_get_plugin_filepath('shared','escape_special_chars'); function smarty_function_html_radios($params, &$smarty) { - extract($params); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); - $_html_result = ''; - if(!isset($name)){ - $name = 'radio'; - } - settype($checked, 'array'); - if (isset($radios)) { - settype($radios, 'array'); - foreach ($radios as $_key => $_val) { - $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $checked, $separator); - } - } else { - settype($output, 'array'); - settype($values, 'array'); - for ($_i = 0, $_for_max = count($output); $_i < $_for_max; $_i++) { - $_html_result .= smarty_function_html_radios_output($name, $values[$_i], $output[$_i], $checked, $separator); - } - } + $name = 'radio'; + $values = null; + $radios = null; + $checked = null; + $separator = ''; + $output = null; + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + case 'separator': + case 'checked': + $$_key = (string)$_val; + break; - return $_html_result; -} + case 'radios': + $$_key = (array)$_val; + break; + + case 'values': + case 'output': + $$_key = array_values((array)$_val); + break; + + default: + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + break; + } + } + + if (!isset($radios) && !isset($values)) + return ''; /* raise error here? */ + + $_html_result = ''; -function smarty_function_html_radios_output($name, $value, $output, $checked, $separator) { - $_output = '<input type="radio" name="' . smarty_function_escape_special_chars($name) . '" value="' . smarty_function_escape_special_chars($value) . '"'; - - if (in_array($value, $checked)) { - $_output .= " checked=\"checked\""; - } - $_output .= '>' . $output . $separator . "\n"; + if (isset($radios) && is_array($radios)) { - return $_output; + foreach ((array)$radios as $_key=>$_val) + $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $checked, $extra, $separator); + + } else { + + foreach ((array)$values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $checked, $extra, $separator); + } + + } + + return $_html_result; + } +function smarty_function_html_radios_output($name, $value, $output, $checked, $extra, $separator) { + $_output = '<input type="radio" name="' + . smarty_function_escape_special_chars($name) . '" value="' + . smarty_function_escape_special_chars($value) . '"'; + + if ($value==$checked) { + $_output .= ' checked="checked"'; + } + $_output .= $extra . ' />' . $output . $separator . "\n"; + + return $_output; +} ?>