@@ -371,25 +371,21 @@ function ($email) {
371
371
get_lang ('Phone ' ),
372
372
['size ' => 20 ]
373
373
);
374
- //if ('true' === api_get_setting('registration', 'phone')) {
375
374
$ form ->addRule (
376
375
'phone ' ,
377
376
get_lang ('Required field ' ),
378
377
'required '
379
378
);
380
- //}
381
379
}
382
380
383
381
// Language
384
382
if (in_array ('language ' , $ allowedFields )) {
385
- //if ('true' === api_get_setting('registration', 'language')) {
386
383
$ form ->addSelectLanguage (
387
384
'language ' ,
388
385
get_lang ('Language ' ),
389
386
[],
390
387
['id ' => 'language ' ]
391
388
);
392
- //}
393
389
}
394
390
395
391
if (in_array ('official_code ' , $ allowedFields )) {
@@ -399,29 +395,19 @@ function ($email) {
399
395
get_lang ('Official code ' ),
400
396
['size ' => 40 ]
401
397
);
402
- //if ('true' === api_get_setting('registration', 'officialcode')) {
403
398
$ form ->addRule (
404
399
'official_code ' ,
405
400
get_lang ('Required field ' ),
406
401
'required '
407
402
);
408
- //}
409
403
}
410
404
411
- // STUDENT/TEACHER
412
- if ('false ' !== api_get_setting ('allow_registration_as_teacher ' )) {
413
- if (in_array ('status ' , $ allowedFields )) {
414
- $ form ->addRadio (
415
- 'status ' ,
416
- get_lang ('What do you want to do? ' ),
417
- [
418
- STUDENT => '<p class="caption"> ' .get_lang ('Follow courses ' ).'</p> ' ,
419
- COURSEMANAGER => '<p class="caption"> ' .get_lang ('Teach courses ' ).'</p> ' ,
420
- ],
421
- ['class ' => 'register-profile ' ]
422
- );
423
- $ form ->addRule ('status ' , get_lang ('Required field ' ), 'required ' );
424
- }
405
+ if (in_array ('date_of_birth ' , $ allowedFields , true )) {
406
+ $ form ->addDatePicker (
407
+ 'date_of_birth ' ,
408
+ get_lang ('Date of birth ' ),
409
+ ['required ' => false ]
410
+ );
425
411
}
426
412
427
413
$ captcha = api_get_setting ('allow_captcha ' );
@@ -595,6 +581,7 @@ function ($email) {
595
581
}
596
582
}
597
583
584
+ // Defaults
598
585
if (isset ($ _SESSION ['user_language_choice ' ]) && '' != $ _SESSION ['user_language_choice ' ]) {
599
586
$ defaults ['language ' ] = $ _SESSION ['user_language_choice ' ];
600
587
} else {
0 commit comments