Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-34563 - removed double labeling and add label for input text

  • Loading branch information...
commit 3a5543d43b5fd8a96cbc55eb83672129799b33d6 1 parent 01ac783
@rwijaya rwijaya authored nebgor committed
View
14 mod/data/field/date/field.class.php
@@ -44,12 +44,9 @@ function display_add_field($recordid=0) {
}
$str = '<div title="'.s($this->field->description).'">';
- $dayselector = html_writer::label(get_string('days'), 'menufield_'.$this->field->id.'_day', false, array('class' => 'accesshide'))
- . html_writer::select_time('days', 'field_'.$this->field->id.'_day', $content);
- $monthselector = html_writer::label(get_string('months'), 'menufield_'.$this->field->id.'_month', false, array('class' => 'accesshide'))
- . html_writer::select_time('months', 'field_'.$this->field->id.'_month', $content);
- $yearselector = html_writer::label(get_string('years'), 'menufield_'.$this->field->id.'_year', false, array('class' => 'accesshide'))
- . html_writer::select_time('years', 'field_'.$this->field->id.'_year', $content);
+ $dayselector = html_writer::select_time('days', 'field_'.$this->field->id.'_day', $content);
+ $monthselector = html_writer::select_time('months', 'field_'.$this->field->id.'_month', $content);
+ $yearselector = html_writer::select_time('years', 'field_'.$this->field->id.'_year', $content);
$str .= $dayselector . $monthselector . $yearselector;
$str .= '</div>';
@@ -58,11 +55,8 @@ function display_add_field($recordid=0) {
//Enable the following three functions once core API issues have been addressed.
function display_search_field($value=0) {
- $selectors = html_writer::label(get_string('days'), 'menuf_'.$this->field->id.'_d', false, array('class' => 'accesshide'))
- . html_writer::select_time('days', 'f_'.$this->field->id.'_d', $value)
- . html_writer::label(get_string('months'), 'menuf_'.$this->field->id.'_m', false, array('class' => 'accesshide'))
+ $selectors = html_writer::select_time('days', 'f_'.$this->field->id.'_d', $value)
. html_writer::select_time('months', 'f_'.$this->field->id.'_m', $value)
- . html_writer::label(get_string('years'), 'menuf_'.$this->field->id.'_y', false, array('class' => 'accesshide'))
. html_writer::select_time('years', 'f_'.$this->field->id.'_y', $value);
return $selectors;
View
2  mod/data/field/file/field.class.php
@@ -91,7 +91,7 @@ function display_add_field($recordid=0) {
}
function display_search_field($value = '') {
- return '<label class="accesshide" for=f_"' . $this->field->id . '">' . $this->field->name . '</label>' .
+ return '<label class="accesshide" for="f_' . $this->field->id . '">' . $this->field->name . '</label>' .
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" value="'.$value.'" />';
}
View
1  mod/data/field/file/mod.html
@@ -14,7 +14,6 @@
<?php
$course = $DB->get_record('course', array('id'=>$this->data->course));
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
- echo html_writer::label($this->field->param3, 'menuparam3', false, array('class' => 'accesshide'));
echo html_writer::select($choices, 'param3', $this->field->param3, false, array('id' => 'param3'));
?>
</td>
View
1  mod/data/field/picture/mod.html
@@ -46,7 +46,6 @@
<?php
$course = $DB->get_record('course', array('id'=>$this->data->course));
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
- echo html_writer::label($this->field->param3, 'menuparam3', false, array('class' => 'accesshide'));
echo html_writer::select($choices, 'param3', $this->field->param3, false, array('id'=>'param3'));
?>
</td>
View
2  mod/data/field/url/mod.html
@@ -8,7 +8,7 @@
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description);?>" /></td>
</tr>
<tr>
- <td class="c0"><label for="param2"><?php echo get_string('forcelinkname', 'data'); ?></label></td>
+ <td class="c0"><label for="forcelinkname"><?php echo get_string('forcelinkname', 'data'); ?></label></td>
<td class="c1"><input class="forcelinkname" type="text" name="param2" id="forcelinkname" value="<?php p($this->field->param2);?>" /></td>
</tr>
<tr>
View
5 mod/data/lib.php
@@ -243,6 +243,7 @@ function display_add_field($recordid=0){
}
$str = '<div title="'.s($this->field->description).'">';
+ $str .= '<label class="accesshide" for="field_'.$this->field->id.'">'.$this->field->description.'</label>';
$str .= '<input style="width:300px;" type="text" name="field_'.$this->field->id.'" id="field_'.$this->field->id.'" value="'.s($content).'" />';
$str .= '</div>';
@@ -1605,9 +1606,9 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
$fn = !empty($search_array[DATA_FIRSTNAME]->data) ? $search_array[DATA_FIRSTNAME]->data : '';
$ln = !empty($search_array[DATA_LASTNAME]->data) ? $search_array[DATA_LASTNAME]->data : '';
$patterns[] = '/##firstname##/';
- $replacement[] = '<input type="text" size="16" name="u_fn" value="'.$fn.'" />';
+ $replacement[] = '<label class="accesshide" for="u_fn">'.get_string('authorfirstname', 'data').'</label><input type="text" size="16" id="u_fn" name="u_fn" value="'.$fn.'" />';
$patterns[] = '/##lastname##/';
- $replacement[] = '<input type="text" size="16" name="u_ln" value="'.$ln.'" />';
+ $replacement[] = '<label for="u_ln">'.get_string('authorfirstname', 'data').'</label><input type="text" size="16" id="u_ln" name="u_ln" value="'.$ln.'" />';
// actual replacement of the tags
$newtext = preg_replace($patterns, $replacement, $data->asearchtemplate);
Please sign in to comment.
Something went wrong with that request. Please try again.