@@ -149,6 +149,25 @@ class="fb--conf--registration_type"
149149 return $select ;
150150 }
151151
152+ // TODO: Translate password types
153+ private async function genStrongPasswordsSelect (): Awaitable <:xhp > {
154+ $types = await Configuration :: genAllPasswordTypes();
155+ $config = await Configuration :: genCurrentPasswordType();
156+ $select = <select name = " fb--conf--password_type" ></select > ;
157+ foreach ($types as $type ) {
158+ $select -> appendChild(
159+ <option
160+ class = " fb--conf--password_type"
161+ value = { strval ($type -> getField())}
162+ selected = { ($type -> getField() === $config -> getField()) } >
163+ { $type -> getDescription()}
164+ </option >
165+ );
166+ }
167+
168+ return $select ;
169+ }
170+
152171 private async function genConfigurationDurationSelect (): Awaitable <:xhp > {
153172 $config = await Configuration :: gen(' game_duration_unit' );
154173 $duration_unit = $config -> getValue();
@@ -295,6 +314,9 @@ class="fb-cta cta--yellow"
295314 ' end_ts' => Configuration :: gen(' end_ts' ),
296315 ' livesync' => Configuration :: gen(' livesync' ),
297316 ' livesync_auth_key' => Configuration :: gen(' livesync_auth_key' ),
317+ ' custom_logo' => Configuration :: gen(' custom_logo' ),
318+ ' custom_text' => Configuration :: gen(' custom_text' ),
319+ ' custom_logo_image' => Configuration :: gen(' custom_logo_image' ),
298320 };
299321
300322 $results = await \HH \Asio \ m ($awaitables );
@@ -322,6 +344,9 @@ class="fb-cta cta--yellow"
322344 $end_ts = $results [' end_ts' ];
323345 $livesync = $results [' livesync' ];
324346 $livesync_auth_key = $results [' livesync_auth_key' ];
347+ $custom_logo = $results [' custom_logo' ];
348+ $custom_text = $results [' custom_text' ];
349+ $custom_logo_image = $results [' custom_logo_image' ];
325350
326351 $registration_on = $registration -> getValue() === ' 1' ;
327352 $registration_off = $registration -> getValue() === ' 0' ;
@@ -343,6 +368,8 @@ class="fb-cta cta--yellow"
343368 $timer_off = $timer -> getValue() === ' 0' ;
344369 $livesync_on = $livesync -> getValue() === ' 1' ;
345370 $livesync_off = $livesync -> getValue() === ' 0' ;
371+ $custom_logo_on = $custom_logo -> getValue() === ' 1' ;
372+ $custom_logo_off = $custom_logo -> getValue() === ' 0' ;
346373
347374 $game_start_array = array ();
348375 if ($start_ts -> getValue() !== ' 0' && $start_ts -> getValue() !== ' NaN' ) {
@@ -416,13 +443,52 @@ class="fb-cta cta--yellow"
416443 ' configuration_duration_select' =>
417444 $this -> genConfigurationDurationSelect(),
418445 ' language_select' => $this -> genLanguageSelect(),
446+ ' password_types_select' => $this -> genStrongPasswordsSelect(),
419447 };
420448 $results = await \HH \Asio \ m ($awaitables );
421449
422450 $registration_type_select = $results [' registration_type_select' ];
423451 $configuration_duration_select =
424452 $results [' configuration_duration_select' ];
425453 $language_select = $results [' language_select' ];
454+ $password_types_select = $results [' password_types_select' ];
455+
456+ if ($login_strongpasswords -> getValue() === ' 0' ) { // Strong passwords are not enforced
457+ $strong_passwords = <div ></div > ;
458+ } else {
459+ $strong_passwords =
460+ <div class = " form-el el--block-label" >
461+ <label >{ tr (' Password Types' )} </label >
462+ { $password_types_select }
463+ </div > ;
464+ }
465+
466+ if ($custom_logo -> getValue() === ' 0' ) { // Custom branding is not enabled
467+ $custom_logo_xhp = <div ></div > ;
468+ } else {
469+ $custom_logo_xhp =
470+ <div class = " form-el el--block-label el--full-text" >
471+ <label for = " " >{ tr (' Logo' )} </label >
472+ <img
473+ id = " custom-logo-image"
474+ class = " icon--badge"
475+ src = { $custom_logo_image -> getValue()}
476+ />
477+ <br />
478+ <h6 >
479+ <a class = " icon-text" href = " #" id = " custom-logo-link" >
480+ { tr (' Change' )}
481+ </a >
482+ </h6 >
483+ <input
484+ autocomplete = " off"
485+ name = " custom-logo-input"
486+ id = " custom-logo-input"
487+ type = " file"
488+ accept = " image/*"
489+ />
490+ </div > ;
491+ }
426492
427493 return
428494 <div >
@@ -527,56 +593,59 @@ class="fb-cta cta--yellow"
527593 </div >
528594 </header >
529595 <div class = " fb-column-container" >
530- <div class = " col col-pad col-1-2 " >
596+ <div class = " col col-pad col-1-3 " >
531597 <div class = " form-el el--block-label" >
532- <label >{ tr (' Strong Passwords ' )} </label >
598+ <label >{ tr (' Team Selection ' )} </label >
533599 <div class = " admin-section-toggle radio-inline" >
534600 <input
535601 type = " radio"
536- name = " fb--conf--login_strongpasswords "
537- id = " fb--conf--login_strongpasswords --on"
538- checked = { $strong_passwords_on }
602+ name = " fb--conf--login_select "
603+ id = " fb--conf--login_select --on"
604+ checked = { $login_select_on }
539605 />
540- <label for = " fb--conf--login_strongpasswords --on" >
606+ <label for = " fb--conf--login_select --on" >
541607 { tr (' On' )}
542608 </label >
543609 <input
544610 type = " radio"
545- name = " fb--conf--login_strongpasswords "
546- id = " fb--conf--login_strongpasswords --off"
547- checked = { $strong_passwords_off }
611+ name = " fb--conf--login_select "
612+ id = " fb--conf--login_select --off"
613+ checked = { $login_select_off }
548614 />
549- <label for = " fb--conf--login_strongpasswords --off" >
615+ <label for = " fb--conf--login_select --off" >
550616 { tr (' Off' )}
551617 </label >
552618 </div >
553619 </div >
554620 </div >
555- <div class = " col col-pad col-2-2 " >
621+ <div class = " col col-pad col-1-3 " >
556622 <div class = " form-el el--block-label" >
557- <label >{ tr (' Team Selection ' )} </label >
623+ <label >{ tr (' Strong Passwords ' )} </label >
558624 <div class = " admin-section-toggle radio-inline" >
559625 <input
560626 type = " radio"
561- name = " fb--conf--login_select "
562- id = " fb--conf--login_select --on"
563- checked = { $login_select_on }
627+ name = " fb--conf--login_strongpasswords "
628+ id = " fb--conf--login_strongpasswords --on"
629+ checked = { $strong_passwords_on }
564630 />
565- <label for = " fb--conf--login_select --on" >
631+ <label for = " fb--conf--login_strongpasswords --on" >
566632 { tr (' On' )}
567633 </label >
568634 <input
569635 type = " radio"
570- name = " fb--conf--login_select "
571- id = " fb--conf--login_select --off"
572- checked = { $login_select_off }
636+ name = " fb--conf--login_strongpasswords "
637+ id = " fb--conf--login_strongpasswords --off"
638+ checked = { $strong_passwords_off }
573639 />
574- <label for = " fb--conf--login_select --off" >
640+ <label for = " fb--conf--login_strongpasswords --off" >
575641 { tr (' Off' )}
576642 </label >
577643 </div >
578644 </div >
579645 </div >
646+ <div class = " col col-pad col-2-3" >
647+ { $strong_passwords }
648+ </div >
580649 </div >
581650 </section >
582651 <section class = " admin-box" >
@@ -932,11 +1001,59 @@ class="fb-cta cta--yellow"
9321001 </section >
9331002 <section class = " admin-box" >
9341003 <header class = " admin-box-header" >
935- <h3 >{ tr (' Language' )} </h3 >
1004+ <h3 >{ tr (' Internationalization' )} </h3 >
1005+ </header >
1006+ <div class = " fb-column-container" >
1007+ <div class = " col col-pad col-2-4" >
1008+ <div class = " form-el el--block-label" >
1009+ <label for = " " >{ tr (' Language' )} </label >
1010+ { $language_select }
1011+ </div >
1012+ </div >
1013+ </div >
1014+ </section >
1015+ <section class = " admin-box" >
1016+ <header class = " admin-box-header" >
1017+ <h3 >{ tr (' Branding' )} </h3 >
9361018 </header >
937- <div class = " col col-pad col-1-2" >
938- <div class = " form-el el--block-label el--full-text" >
939- { $language_select }
1019+ <div class = " fb-column-container" >
1020+ <div class = " col col-pad col-1-3" >
1021+ <div class = " form-el el--block-label" >
1022+ <label >{ tr (' Custom Logo' )} </label >
1023+ <div class = " admin-section-toggle radio-inline" >
1024+ <input
1025+ type = " radio"
1026+ name = " fb--conf--custom_logo"
1027+ id = " fb--conf--custom_logo--on"
1028+ checked = { $custom_logo_on }
1029+ />
1030+ <label for = " fb--conf--custom_logo--on" >
1031+ { tr (' On' )}
1032+ </label >
1033+ <input
1034+ type = " radio"
1035+ name = " fb--conf--custom_logo"
1036+ id = " fb--conf--custom_logo--off"
1037+ checked = { $custom_logo_off }
1038+ />
1039+ <label for = " fb--conf--custom_logo--off" >
1040+ { tr (' Off' )}
1041+ </label >
1042+ </div >
1043+ </div >
1044+ </div >
1045+ <div class = " col col-pad col-1-3" >
1046+ { $custom_logo_xhp }
1047+ </div >
1048+ <div class = " col col-pad col-1-3" >
1049+ <div class = " form-el el--block-label el--full-text" >
1050+ <label for = " " >{ tr (' Custom Text' )} </label >
1051+ <input
1052+ type = " text"
1053+ name = " fb--conf--custom_text"
1054+ value = { $custom_text -> getValue()}
1055+ />
1056+ </div >
9401057 </div >
9411058 </div >
9421059 </section >
@@ -3786,6 +3903,7 @@ public function renderMainContent(): :xhp {
37863903 { tr (' Begin Game' )}
37873904 </a > ;
37883905 }
3906+ $branding_xhp = await $this -> genRenderBranding();
37893907 return
37903908 <div id = " fb-admin-nav" class = " admin-nav-bar fb-row-container" >
37913909 <header class = " admin-nav-header row-fixed" >
@@ -3858,7 +3976,7 @@ public function renderMainContent(): :xhp {
38583976 <a href = " /index.php?p=game" >{ tr (' Gameboard' )} </a >
38593977 <a href = " " class = " js-prompt-logout" >{ tr (' Logout' )} </a >
38603978 <a ></a >
3861- < fbbranding />
3979+ { $branding_xhp }
38623980 </div >
38633981 </div > ;
38643982 }
0 commit comments