<?php print_string("configmaxbytes") ?>
</td>
</tr>
+<tr valign=top>
+ <td align=right><p>fullnamedisplay:</td>
+ <td>
+ <?php
+ unset($options);
+ $options['language'] = get_string('language');
+ $options['firstname lastname'] = get_string('firstname') . ' + ' . get_string('lastname');
+ $options['lastname firstname'] = get_string('lastname') . ' + ' . get_string('firstname');
+ $options['firstname'] = get_string('firstname');
+
+ choose_from_menu ($options, "fullnamedisplay", $config->fullnamedisplay, "", "", "");
+ ?>
+ </td>
+ <td>
+ <?php print_string("configfullnamedisplay") ?>
+ </td>
+</tr>
<tr>
<td colspan=3 align=center>
$string['configdebug'] = 'If you turn this on, then PHP\'s error_reporting will be increased so that more warnings are printed. This is only useful for developers.';
$string['configerrorlevel'] = 'Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.';
$string['configframename'] = 'If you are embedding Moodle within a web frame, then put the name of this frame here. Otherwise this value should remain as \'_top\'';
+$string['configfullnamedisplay'] = 'This defines how names are shown when they are displayed in full. For most mono-lingual sites the most efficient setting is the default \"Given names + Surname\", but you may choose to hide surnames altogether, or to leave it up to the current language pack to decide (some languages have different conventions).';
$string['configgdversion'] = 'Indicate the version of GD that is installed. The version shown by default is the one that has been auto-detected. Don\'t change this unless you really know what you\'re doing.';
$string['confightmleditor'] = 'Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible browser (IE 5.5 or later). Users can also choose not to use it.';
$string['configidnumber'] = 'This option specifies whether (a) Users are not be asked for an ID number at all, (b) Users are asked for an ID number but can leave it blank or (c) Users are asked for an ID Number and cannot leave it blank. If given the User\'s ID number is displayed in their Profile.';
$string['filesfolders'] = 'Files/folders';
$string['filloutallfields'] = 'Please fill out all fields in this form';
$string['findmorecourses'] = 'Find more courses...';
-$string['firstname'] = 'First name';
+$string['firstname'] = 'Given name(s)';
$string['firsttime'] = 'Is this your first time here?';
$string['followingoptional'] = 'The following items are optional';
$string['followingrequired'] = 'The following items are required';
$string['frontpagenews'] = 'Show news items';
$string['fulllistofcourses'] = 'All courses';
$string['fullname'] = 'Full name';
+$string['fullnamedisplay'] = '$a->firstname $a->lastname';
$string['fullprofile'] = 'Full profile';
$string['fullsitename'] = 'Full site name';
$string['gd1'] = 'GD 1.x is installed';
$string['lastedited'] = 'Last edited';
$string['lastlogin'] = 'Last Login';
$string['lastmodified'] = 'Last modified';
-$string['lastname'] = 'Last name';
+$string['lastname'] = 'Surname';
$string['latestlanguagepack'] = 'Check for latest language pack on moodle.org';
$string['latestnews'] = 'Latest news';
$string['leavetokeep'] = 'Leave blank to keep current password';
}
function fullname($user, $override=false) {
-/// Given a user object, this function returns a
-/// string with the full name of the person.
+/// Given an object containing firstname and lastname
+/// values, this function returns a string with the
+/// full name of the person.
/// The result may depend on system settings
-/// or language. Override will force both names
+/// or language. 'override' will force both names
/// to be used even if system settings specify one.
+
global $CFG;
- /// XXX
- /// XXX this function is not finished yet!
- /// XXX
+ if ($CFG->fullnamedisplay == 'firstname lastname') {
+ return "$user->firstname $user->lastname";
+
+ } else if ($CFG->fullnamedisplay == 'lastname firstname') {
+ return "$user->lastname $user->firstname";
- return "$user->firstname $user->lastname";
+ } else if ($CFG->fullnamedisplay == 'firstname') {
+ if ($override) {
+ return get_string('fullnamedisplay', '', $user);
+ } else {
+ return $user->firstname;
+ }
+ }
+ return get_string('fullnamedisplay', '', $user);
}