MDL-56725 mod_data: better field alignment

Labels containing only accesshide text should have the accesshide class
on the label, not the content so the label does not push the content
down.
This commit is contained in:
Damyon Wiese
2016-11-10 16:25:48 +08:00
parent 398be7c897
commit 930ce60550
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -52,8 +52,8 @@ class data_field_multimenu extends data_field_base {
$str = '<div title="'.s($this->field->description).'">';
$str .= '<input name="field_' . $this->field->id . '[xxx]" type="hidden" value="xxx"/>'; // hidden field - needed for empty selection
$str .= '<label for="field_' . $this->field->id . '">';
$str .= html_writer::span($this->field->name, 'accesshide');
$str .= '<label for="field_' . $this->field->id . '" class="accesshide">';
$str .= html_writer::span($this->field->name);
if ($this->field->required) {
$str .= '<div class="inline-req">';
$str .= html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
+2 -2
View File
@@ -61,8 +61,8 @@ class data_field_textarea extends data_field_base {
$text = '';
$format = 0;
$str = '<div title="' . s($this->field->description) . '">';
$str .= '<label for="field_' . $this->field->id . '">';
$str .= html_writer::span($this->field->name, "accesshide");
$str .= '<label for="field_' . $this->field->id . '" class="accesshide">';
$str .= html_writer::span($this->field->name);
if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));