Display Names in Proper Format

Display Names in Proper Format

by Khalil Radhi -
Number of replies: 1
Using LDAP synchronization, majority of the users First and Last names are not in the proper format for some reason.
I've tried to apply the ucfirst PHP command, but it didn't work. Either nothing shows up, or the person's name disappear completely.

What I would like to be able to do is something like the following:
certificate_print_text($pdf, $x, $y + 36, 'C', 'Helvetica', '', 30, ucfirst(strtolower($USER));
This will make sure that all characters are first lowered to lowercase, then the first letter is capitalized.

Any suggestions on how to apply this formatting would be highly appreciated.
I am using moodle 2.9 and the latest version of the certificate plugin.
Average of ratings: -
In reply to Khalil Radhi

Re: Display Names in Proper Format

by Khalil Radhi -

Wow!

I managed to fix it big grin

In mod/certificate/type/A4_non_embeded (or any other type)

I've changed the original code:

certificate_print_text($pdf, $x, $y + 36, 'C', 'Helvetica', '', 30, fullname($USER));

to

certificate_print_text($pdf, $x, $y + 36, 'C', 'Helvetica', '', 30, ucwords(strtolower(fullname($USER))));

Average of ratings: Useful (1)