|
|
@@ -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" : "";
|