Skip to content
Snippets Groups Projects
Commit a3261892 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #1160 from greezybacon/issue/checkbox-desc-html


forms: Fix html rendering of checkbox description

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents e7e7a308 2ca46e03
No related branches found
No related tags found
No related merge requests found
......@@ -616,6 +616,14 @@ class TextareaField extends FormField {
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 {
......@@ -1029,8 +1037,10 @@ class TextareaWidget extends Widget {
$cols = "cols=\"{$config['cols']}\"";
if (isset($config['length']) && $config['length'])
$maxlength = "maxlength=\"{$config['length']}\"";
if (isset($config['html']) && $config['html'])
if (isset($config['html']) && $config['html']) {
$class = 'class="richtext no-bar small"';
$this->value = Format::viewableImages($this->value);
}
?>
<span style="display:inline-block;width:100%">
<textarea <?php echo $rows." ".$cols." ".$maxlength." ".$class
......@@ -1126,13 +1136,13 @@ class CheckboxWidget extends Widget {
if (!isset($this->value))
$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
echo $this->field->get('id'); ?>"/>
<?php
if ($config['desc']) { ?>
<em style="display:inline-block"><?php
echo Format::htmlchars($config['desc']); ?></em>
echo Format::viewableImages($config['desc']); ?></em>
<?php }
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment