From d08c400d310242b9a1bc6cb8d642bf0dd5c6ced6 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 1 Jun 2005 08:05:28 +0000 Subject: [PATCH] auth fieldlocks: smarter handling of UI strings for user fields --- admin/auth.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/admin/auth.php b/admin/auth.php index 8b1c98fe402..04196eb75b2 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -238,9 +238,6 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, } foreach ($user_fields as $field) { - echo ''; - echo get_string($field); - echo ''; // Define some vars we'll work with optional_variable($pluginconfig->{"field_map_$field"}, ''); @@ -248,6 +245,20 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, optional_variable($pluginconfig->{"field_updateremote_$field"}, ''); optional_variable($pluginconfig->{"field_lock_$field"}, ''); + // define the fieldname we display to the user + $fieldname = $field; + if ($fieldname === 'lang') { + $fieldname = get_string('language'); + } elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) { + $fieldname = get_string($matches[1]) . ' ' . $matches[2]; + } else { + $fieldname = get_string($fieldname); + } + + echo ''; + echo $fieldname; + echo ''; + if ($retrieveopts) { $varname = 'field_map_' . $field;