|
@@ -36,94 +36,89 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<?php } ?>
|
|
<?php } ?>
|
|
|
- <div class="u-mt20">
|
|
|
|
|
- <?php
|
|
|
|
|
- foreach ($WebappInstaller->getOptions() as $form_name => $form_control) {
|
|
|
|
|
- $field_name = $WebappInstaller->formNs() . "_" . $form_name;
|
|
|
|
|
- $field_type = $form_control;
|
|
|
|
|
- $field_value = "";
|
|
|
|
|
- $field_label =
|
|
|
|
|
- isset($form_control["label"])
|
|
|
|
|
- ? htmlentities($form_control["label"])
|
|
|
|
|
- : ucwords(str_replace([".","_"], " ", $form_name));
|
|
|
|
|
- $field_placeholder = "";
|
|
|
|
|
- if (is_array($form_control)) {
|
|
|
|
|
- $field_type = !empty($form_control["type"]) ? $form_control["type"] : "text";
|
|
|
|
|
- $field_value = !empty($form_control["value"]) ? $form_control["value"] : "";
|
|
|
|
|
- $field_placeholder = !empty($form_control["placeholder"]) ? $form_control["placeholder"] : "";
|
|
|
|
|
- }
|
|
|
|
|
- $field_value = htmlentities($field_value);
|
|
|
|
|
- $field_label = htmlentities($field_label);
|
|
|
|
|
- $field_name = htmlentities($field_name);
|
|
|
|
|
- $field_placeholder = htmlentities($field_placeholder);
|
|
|
|
|
- ?>
|
|
|
|
|
- <div
|
|
|
|
|
- x-data="{
|
|
|
|
|
- value: '<?= !empty($field_value) ? $field_value : "" ?>'
|
|
|
|
|
- }"
|
|
|
|
|
- class="u-mb10"
|
|
|
|
|
- >
|
|
|
|
|
- <?php if ($field_type != "boolean"): ?>
|
|
|
|
|
- <label for="<?= $field_name ?>" class="form-label">
|
|
|
|
|
- <?= $field_label ?>
|
|
|
|
|
- <?php if ($field_type == "password") { ?>
|
|
|
|
|
- /
|
|
|
|
|
- <button
|
|
|
|
|
- x-on:click="value = Hestia.helpers.randomPassword()"
|
|
|
|
|
- class="form-link"
|
|
|
|
|
- type="button"
|
|
|
|
|
- >
|
|
|
|
|
- <?= _("Generate") ?>
|
|
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach ($WebappInstaller->getOptions() as $form_name => $form_control) {
|
|
|
|
|
+ $field_name = $WebappInstaller->formNs() . "_" . $form_name;
|
|
|
|
|
+ $field_type = $form_control;
|
|
|
|
|
+ $field_value = "";
|
|
|
|
|
+ $field_label =
|
|
|
|
|
+ isset($form_control["label"])
|
|
|
|
|
+ ? htmlentities($form_control["label"])
|
|
|
|
|
+ : ucwords(str_replace([".","_"], " ", $form_name));
|
|
|
|
|
+ $field_placeholder = "";
|
|
|
|
|
+ if (is_array($form_control)) {
|
|
|
|
|
+ $field_type = !empty($form_control["type"]) ? $form_control["type"] : "text";
|
|
|
|
|
+ $field_value = !empty($form_control["value"]) ? $form_control["value"] : "";
|
|
|
|
|
+ $field_placeholder = !empty($form_control["placeholder"]) ? $form_control["placeholder"] : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ $field_value = htmlentities($field_value);
|
|
|
|
|
+ $field_label = htmlentities($field_label);
|
|
|
|
|
+ $field_name = htmlentities($field_name);
|
|
|
|
|
+ $field_placeholder = htmlentities($field_placeholder);
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="u-mb10">
|
|
|
|
|
+ <?php if ($field_type != "boolean"): ?>
|
|
|
|
|
+ <label for="<?= $field_name ?>" class="form-label">
|
|
|
|
|
+ <?= $field_label ?>
|
|
|
|
|
+ <?php if ($field_type == "password"): ?>
|
|
|
|
|
+ <button type="button" title="<?= _("Generate") ?>" class="u-unstyled-button u-ml5 js-generate-password">
|
|
|
|
|
+ <i class="fas fa-arrows-rotate icon-green"></i>
|
|
|
</button>
|
|
</button>
|
|
|
- <?php } ?>
|
|
|
|
|
- </label>
|
|
|
|
|
- <?php endif; ?>
|
|
|
|
|
|
|
+ <?php endif; ?>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <?php endif; ?>
|
|
|
|
|
|
|
|
- <?php if ($field_type == 'select' && count($form_control['options'])) { ?>
|
|
|
|
|
- <select class="form-select" name="<?= $field_name ?>" id="<?= $field_name ?>">
|
|
|
|
|
- <?php
|
|
|
|
|
- foreach ($form_control['options'] as $key => $option) {
|
|
|
|
|
- $key = !is_numeric($key) ? $key : $option;
|
|
|
|
|
- $selected = !empty($form_control['value'] && $key == $form_control['value']) ? 'selected' : '';
|
|
|
|
|
- ?>
|
|
|
|
|
- <option
|
|
|
|
|
- value="<?= $key ?>"
|
|
|
|
|
- <?= $selected ?>
|
|
|
|
|
- >
|
|
|
|
|
- <?= htmlentities($option) ?>
|
|
|
|
|
- </option>
|
|
|
|
|
- <?php } ?>
|
|
|
|
|
- </select>
|
|
|
|
|
- <?php
|
|
|
|
|
- } elseif ($field_type == "boolean") {
|
|
|
|
|
- $checked = !empty($field_value) ? "checked" : "";
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="form-check">
|
|
|
|
|
|
|
+ <?php if ($field_type == 'select' && count($form_control['options'])): ?>
|
|
|
|
|
+ <select class="form-select" name="<?= $field_name ?>" id="<?= $field_name ?>">
|
|
|
|
|
+ <?php foreach ($form_control['options'] as $key => $option):
|
|
|
|
|
+ $key = !is_numeric($key) ? $key : $option;
|
|
|
|
|
+ $selected = !empty($form_control['value'] && $key == $form_control['value']) ? 'selected' : ''; ?>
|
|
|
|
|
+ <option value="<?= $key ?>" <?= $selected ?>>
|
|
|
|
|
+ <?= htmlentities($option) ?>
|
|
|
|
|
+ </option>
|
|
|
|
|
+ <?php endforeach; ?>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <?php elseif ($field_type == "boolean"):
|
|
|
|
|
+ $checked = !empty($field_value) ? "checked" : ""; ?>
|
|
|
|
|
+ <div class="form-check">
|
|
|
|
|
+ <input
|
|
|
|
|
+ class="form-check-input"
|
|
|
|
|
+ type="checkbox"
|
|
|
|
|
+ name="<?= $field_name ?>"
|
|
|
|
|
+ id="<?= $field_name ?>"
|
|
|
|
|
+ value="true"
|
|
|
|
|
+ <?= $checked ?>
|
|
|
|
|
+ >
|
|
|
|
|
+ <label for="<?= $field_name ?>">
|
|
|
|
|
+ <?= $field_label ?>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php else: ?>
|
|
|
|
|
+ <?php if ($field_type == "password"): ?>
|
|
|
|
|
+ <div class="u-pos-relative">
|
|
|
<input
|
|
<input
|
|
|
- class="form-check-input"
|
|
|
|
|
- type="checkbox"
|
|
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ class="form-control js-password-input"
|
|
|
name="<?= $field_name ?>"
|
|
name="<?= $field_name ?>"
|
|
|
id="<?= $field_name ?>"
|
|
id="<?= $field_name ?>"
|
|
|
- value="true"
|
|
|
|
|
- <?= $checked ?>
|
|
|
|
|
|
|
+ placeholder="<?= $field_placeholder ?>"
|
|
|
>
|
|
>
|
|
|
- <label for="<?= $field_name ?>">
|
|
|
|
|
- <?= $field_label ?>
|
|
|
|
|
- </label>
|
|
|
|
|
|
|
+ <div class="password-meter">
|
|
|
|
|
+ <meter max="4" class="password-meter-input js-password-meter"></meter>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- <?php } else { ?>
|
|
|
|
|
|
|
+ <?php else: ?>
|
|
|
<input
|
|
<input
|
|
|
- x-model="value"
|
|
|
|
|
type="text"
|
|
type="text"
|
|
|
class="form-control"
|
|
class="form-control"
|
|
|
name="<?= $field_name ?>"
|
|
name="<?= $field_name ?>"
|
|
|
id="<?= $field_name ?>"
|
|
id="<?= $field_name ?>"
|
|
|
placeholder="<?= $field_placeholder ?>"
|
|
placeholder="<?= $field_placeholder ?>"
|
|
|
>
|
|
>
|
|
|
- <?php } ?>
|
|
|
|
|
- </div>
|
|
|
|
|
- <?php } ?>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <?php endif; ?>
|
|
|
|
|
+ <?php endif; ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php } ?>
|
|
|
</div>
|
|
</div>
|
|
|
</form>
|
|
</form>
|
|
|
<?php } ?>
|
|
<?php } ?>
|