From efa2388df91983e060a7401c9d7cf2c50203e95f Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 23 Sep 2020 14:09:47 +1200 Subject: [PATCH] Support multi-lang in user profile fields. --- export.php | 4 ++-- settings.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/export.php b/export.php index 653c53d..24b7a7c 100644 --- a/export.php +++ b/export.php @@ -105,7 +105,7 @@ if ($formdata = $mform->get_data()) { } else if (in_array($opt, array_column($customfields, 'shortname'))) { foreach ($customfields as $customfield) { if ($opt == $customfield->shortname) { - $data->tabhead[] = $customfield->name; + $data->tabhead[] = format_string($customfield->name, true, array('context' => $context)); } } } else { @@ -169,7 +169,7 @@ if ($formdata = $mform->get_data()) { foreach (array_keys($formdata->ident) as $opt) { if (in_array($opt, array_column($customfields, 'shortname'))) { if (isset($user->profile[$opt])) { - $data->table[$i][] = $user->profile[$opt]; + $data->table[$i][] = format_string($user->profile[$opt], true, array('context' => $context)); } else { $data->table[$i][] = ''; } diff --git a/settings.php b/settings.php index eeb6342..9713075 100644 --- a/settings.php +++ b/settings.php @@ -109,7 +109,7 @@ if ($ADMIN->fulltree) { $fields = array('id' => get_string('studentid', 'attendance')); $customfields = profile_get_custom_fields(); foreach ($customfields as $field) { - $fields[$field->shortname] = $field->name; + $fields[$field->shortname] = format_string($field->name); } $settings->add(new admin_setting_configmultiselect('attendance/customexportfields',