MDL-34563 - removed double labeling and add label for input text
This commit is contained in:
committed by
Aparup Banerjee
parent
408dfe97b8
commit
afee2a7af2
@@ -44,12 +44,9 @@ class data_field_date extends data_field_base {
|
||||
}
|
||||
|
||||
$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 @@ class data_field_date extends data_field_base {
|
||||
|
||||
//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;
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class data_field_file extends data_field_base {
|
||||
}
|
||||
|
||||
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.'" />';
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<?php
|
||||
$course->maxbytes = $DB->get_field('course', 'maxbytes', 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>
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
<?php
|
||||
$course->maxbytes = $DB->get_field('course', 'maxbytes', 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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
+3
-2
@@ -243,6 +243,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/
|
||||
}
|
||||
|
||||
$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>';
|
||||
|
||||
@@ -1671,9 +1672,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);
|
||||
|
||||
Reference in New Issue
Block a user