Commit 2ef6a286 authored by Nigel McNie's avatar Nigel McNie
Browse files

Merged in pieforms change to textarea element. Now newlines are converted to...

Merged in pieforms change to textarea element. Now newlines are converted to be unix newlines from form data.
parent 1f8d9061
......@@ -66,4 +66,21 @@ function pieform_element_textarea(Pieform $form, $element) {
. '>' . Pieform::hsc($form->get_value($element)) . '</textarea>';
}
function pieform_element_textarea_get_value(Pieform $form, $element) {
if (isset($element['value'])) {
return $element['value'];
}
$global = ($form->get_property('method') == 'get') ? $_GET : $_POST;
if (isset($global[$element['name']])) {
return str_replace("\r\n", "\n", $global[$element['name']]);
}
if (isset($element['defaultvalue'])) {
return $element['defaultvalue'];
}
return '';
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment