mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
MDL-42533 conditionlib: Field name is translated for students
This commit is contained in:
parent
2d2c5f36c4
commit
127816472e
@ -1044,8 +1044,14 @@ abstract class condition_info_base {
|
||||
if (!$this->is_field_condition_met($details->operator, $uservalue, $details->value)) {
|
||||
// Set available to false
|
||||
$available = false;
|
||||
// Display the fieldname into current lang.
|
||||
if (is_numeric($field)) {
|
||||
$translatedfieldname = $details->fieldname;
|
||||
} else {
|
||||
$translatedfieldname = get_user_field_name($details->fieldname);
|
||||
}
|
||||
$a = new stdClass();
|
||||
$a->field = format_string($details->fieldname, true, array('context' => $context));
|
||||
$a->field = format_string($translatedfieldname, true, array('context' => $context));
|
||||
$a->value = s($details->value);
|
||||
$information .= html_writer::start_tag('li');
|
||||
$information .= get_string('requires_user_field_'.$details->operator, 'condition', $a) . ' ';
|
||||
|
Loading…
x
Reference in New Issue
Block a user