auth fieldlocks: smarter handling of UI strings for user fields

This commit is contained in:
martinlanghoff
2005-06-01 08:05:28 +00:00
parent 770764f392
commit d08c400d31
+14 -3
View File
@@ -238,9 +238,6 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts,
}
foreach ($user_fields as $field) {
echo '<tr valign="top"><td align="right">';
echo get_string($field);
echo '</td><td>';
// 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 '<tr valign="top"><td align="right">';
echo $fieldname;
echo '</td><td>';
if ($retrieveopts) {
$varname = 'field_map_' . $field;