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

Fix double rendering of label on some form elements

parent cf5b3ad4
No related branches found
No related tags found
No related merge requests found
......@@ -2023,8 +2023,8 @@ class DatetimePickerWidget extends Widget {
class SectionBreakWidget extends Widget {
function render($mode=false) {
?><div class="form-header section-break"><h3><?php
echo Format::htmlchars($this->field->get('label'));
?></h3><em><?php echo Format::htmlchars($this->field->get('hint'));
echo Format::htmlchars($this->field->getLocal('label'));
?></h3><em><?php echo Format::htmlchars($this->field->getLocal('hint'));
?></em></div>
<?php
}
......@@ -2044,6 +2044,9 @@ class ThreadEntryWidget extends Widget {
}
list($draft, $attrs) = Draft::getDraftAndDataAttrs($namespace, $object_id, $this->value);
?>
<span class="required"><?php
echo Format::htmlchars($this->field->getLocal('label'));
?>: <span class="error">*</span></span><br/>
<textarea style="width:100%;" name="<?php echo $this->field->get('name'); ?>"
placeholder="<?php echo Format::htmlchars($this->field->get('hint')); ?>"
class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext';
......@@ -2189,9 +2192,9 @@ class FreeTextWidget extends Widget {
function render($mode=false) {
$config = $this->field->getConfiguration();
?><div class=""><h3><?php
echo Format::htmlchars($this->field->get('label'));
echo Format::htmlchars($this->field->getLocal('label'));
?></h3><em><?php
echo Format::htmlchars($this->field->get('hint'));
echo Format::htmlchars($this->field->getLocal('hint'));
?></em><div><?php
echo Format::viewableImages($config['content']); ?></div>
</div>
......
......@@ -21,21 +21,23 @@
?>
<tr>
<td colspan="2" style="padding-top:8px;">
<?php if (!$field->isBlockLevel()) { ?>
<label for="<?php echo $field->getFormName(); ?>"><span class="<?php
if ($field->get('required')) echo 'required'; ?>">
<?php echo Format::htmlchars($field->getLocal('label')); ?>
<?php if ($field->get('required')) { ?>
<span class="error">*</span>
<?php
}
}
?></span><?php
if ($field->get('hint') && !$field->isBlockLevel()) { ?>
<br /><em style="color:gray;display:inline-block"><?php
echo Format::htmlchars($field->getLocal('hint')); ?></em>
<?php
} ?>
if ($field->get('hint')) { ?>
<br /><em style="color:gray;display:inline-block"><?php
echo Format::htmlchars($field->getLocal('hint')); ?></em>
<?php
} ?>
<br/>
<?php
}
$field->render('client');
?></label><?php
foreach ($field->errors() as $e) { ?>
......
......@@ -47,9 +47,6 @@ if (isset($options['entry']) && $options['mode'] == 'edit') { ?>
?>
<tr><?php if ($field->isBlockLevel()) { ?>
<td colspan="2">
<div style="margin-bottom:0.5em;margin-top:0.5em"><strong><?php
echo Format::htmlchars($field->getLocal('label'));
?></strong>:</div>
<?php
}
else { ?>
......@@ -60,8 +57,8 @@ if (isset($options['entry']) && $options['mode'] == 'edit') { ?>
<td><div style="position:relative"><?php
}
$field->render(); ?>
<?php if ($field->get('required')) { ?>
<font class="error">*</font>
<?php if (!$field->isBlockLevel() && $field->get('required')) { ?>
<span class="error">*</span>
<?php
}
if (($a = $field->getAnswer()) && $a->isDeleted()) {
......
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