Skip to content
Snippets Groups Projects
Commit 2ca46e03 authored by Jared Hancock's avatar Jared Hancock
Browse files

forms: Fix html rendering of checkbox description

parent 356ca50b
No related branches found
No related tags found
No related merge requests found
...@@ -616,6 +616,14 @@ class TextareaField extends FormField { ...@@ -616,6 +616,14 @@ class TextareaField extends FormField {
return (!$value) ? $value : Format::html2text($value); return (!$value) ? $value : Format::html2text($value);
} }
function parse($value) {
$config = $this->getConfiguration();
if ($config['html'])
return Format::sanitize($value);
else
return $value;
}
} }
class PhoneField extends FormField { class PhoneField extends FormField {
...@@ -1029,8 +1037,10 @@ class TextareaWidget extends Widget { ...@@ -1029,8 +1037,10 @@ class TextareaWidget extends Widget {
$cols = "cols=\"{$config['cols']}\""; $cols = "cols=\"{$config['cols']}\"";
if (isset($config['length']) && $config['length']) if (isset($config['length']) && $config['length'])
$maxlength = "maxlength=\"{$config['length']}\""; $maxlength = "maxlength=\"{$config['length']}\"";
if (isset($config['html']) && $config['html']) if (isset($config['html']) && $config['html']) {
$class = 'class="richtext no-bar small"'; $class = 'class="richtext no-bar small"';
$this->value = Format::viewableImages($this->value);
}
?> ?>
<span style="display:inline-block;width:100%"> <span style="display:inline-block;width:100%">
<textarea <?php echo $rows." ".$cols." ".$maxlength." ".$class <textarea <?php echo $rows." ".$cols." ".$maxlength." ".$class
...@@ -1126,13 +1136,13 @@ class CheckboxWidget extends Widget { ...@@ -1126,13 +1136,13 @@ class CheckboxWidget extends Widget {
if (!isset($this->value)) if (!isset($this->value))
$this->value = $this->field->get('default'); $this->value = $this->field->get('default');
?> ?>
<input type="checkbox" name="<?php echo $this->name; ?>[]" <?php <input style="vertical-align:top;" type="checkbox" name="<?php echo $this->name; ?>[]" <?php
if ($this->value) echo 'checked="checked"'; ?> value="<?php if ($this->value) echo 'checked="checked"'; ?> value="<?php
echo $this->field->get('id'); ?>"/> echo $this->field->get('id'); ?>"/>
<?php <?php
if ($config['desc']) { ?> if ($config['desc']) { ?>
<em style="display:inline-block"><?php <em style="display:inline-block"><?php
echo Format::htmlchars($config['desc']); ?></em> echo Format::viewableImages($config['desc']); ?></em>
<?php } <?php }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment