MDL-42533 conditionlib: Field name is translated for students

This commit is contained in:
Frederic Massart 2013-10-25 09:46:36 +08:00
parent 2d2c5f36c4
commit 127816472e

View File

@ -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) . ' ';