Alan Lam 2 лет назад
Родитель
Сommit
a6770301f9
2 измененных файлов с 27 добавлено и 0 удалено
  1. 22 0
      engine/form.php
  2. 5 0
      json/age_verification_greene_king.json

+ 22 - 0
engine/form.php

@@ -166,6 +166,10 @@ class Form {
                 self::renderHorizontalBar($options);
                 break;
 
+			case "alert":
+				self::renderAlert($options);
+				break;
+
             case "time":
                 self::renderTimeField($options);
                 break;
@@ -387,6 +391,24 @@ class Form {
         <?php
     }
 
+	private static function renderAlert(object $options): void {
+		$class = $options->class ?? "alert-info";
+		$icon = $options->icon ?? "fa-info-circle";
+		$heading = $options->heading ?? "";
+		$content = $options->content;
+		?>
+		<div class="alert <?=$class?>">
+			<div class="mb-2">
+				<strong>
+					<i class="fa fa-fw <?=$icon?>"></i>
+					<?=htmlspecialchars($heading)?>
+				</strong>
+			</div>
+			<?=htmlspecialchars($content)?>
+		</div>
+		<?php
+	}
+
 	private static function renderCheckboxField(object $options): void {
 		$id = str_replace("_", "-", $options->name);
 		$checked = !empty($options->value) ? "checked" : "";

+ 5 - 0
json/age_verification_greene_king.json

@@ -80,6 +80,11 @@
 			"values": ["0", "1"],
 			"displayStrings": ["No", "Yes"]
 		},
+		{
+			"type": "alert",
+			"heading": "Reminder",
+			"content": "If the machine was in line of sight, please browse game menus for 1 minute. Otherwise browse game menus for 2 minutes."
+		},
 		{
 			"type": "hr"
 		},