$mform->setType('email2', PARAM_NOTAGS);
$mform->addRule('email2', get_string('missingemail'), 'required', null, 'server');
- $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="25"');
+ $nameordercheck->firstname = 'a';
+ $nameordercheck->lastname = 'b';
+ if (fullname($nameordercheck) == 'b a' ) { // See MDL-4325
+ $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
+ $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
+ } else {
+ $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
+ $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
+ }
+
$mform->setType('firstname', PARAM_TEXT);
$mform->addRule('firstname', get_string('missingfirstname'), 'required', null, 'server');
- $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="25"');
$mform->setType('lastname', PARAM_TEXT);
$mform->addRule('lastname', get_string('missinglastname'), 'required', null, 'server');
$strrequired = get_string('required');
- $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
+ $nameordercheck->firstname = 'a';
+ $nameordercheck->lastname = 'b';
+ if (fullname($nameordercheck) == 'b a' ) { // See MDL-4325
+ $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
+ $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
+ } else {
+ $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
+ $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
+ }
+
$mform->addRule('firstname', $strrequired, 'required', null, 'client');
$mform->setType('firstname', PARAM_NOTAGS);
- $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
$mform->addRule('lastname', $strrequired, 'required', null, 'client');
$mform->setType('lastname', PARAM_NOTAGS);
$mform->setType('address', PARAM_MULTILANG);
}
-?>
\ No newline at end of file
+?>