Commit 7281be95 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Moved required form field asterisks inside labels (Bug 1259393)"

parents eefcf77e 96f95186
......@@ -1404,15 +1404,20 @@ EOF;
// Element title
if (isset($element['title']) && $element['title'] !== '') {
$title = (!empty($element['labelescaped'])) ? $element['title'] : self::hsc($element['title']);
if ($this->get_property('requiredmarker') && !empty($element['rules']['required'])) {
$requiredmarker = ' <span class="requiredmarker">*</span>';
}
else {
$requiredmarker = '';
}
if (!empty($element['nolabel'])) {
// Don't bother with a label for the element
$element['labelhtml'] = $title;
$element['labelhtml'] = $title . $requiredmarker;
}
else {
$element['labelhtml'] = '<label for="' . $this->name . '_' . $element['id'] . '">' . $title . '</label>';
}
if ($this->get_property('requiredmarker') && !empty($element['rules']['required'])) {
$element['labelhtml'] .= ' <span class="requiredmarker">*</span>';
$element['labelhtml'] = '<label for="' . $this->name . '_' . $element['id'] . '">' . $title . $requiredmarker . '</label>';
}
}
......
......@@ -538,6 +538,7 @@ form {
/* required */
.requiredmarker {
color: #FF0000;
font-weight: normal;
}
/* description */
.pieform td.description {
......
Supports Markdown
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