aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/settings_editor.php
blob: 1bf72b7bfc59a71688a92f19361f03b13ae9a03e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
use Digitigrade\GlobalSettings;

$settings = GlobalSettings::getInstance();
?>
<form class="settings nopanel" action="/todo" hx-post="/fragment/admin/settings/<?= $prefix ?>" hx-swap="outerHTML"
    hx-disabled-elt="find button">
    <?php foreach ($settings->getAllInPrefix($prefix) as $key => $value) {
        $info = $settings->getInfo($key);
        call_template('settings_field', [
            'key' => $key,
            'value' => $value,
            'name' => $info['name'] ?? $key,
            'description' => $info['description'] ?? '',
            'options' => $info['options'] ?? null,
            'type' => $info['type'] ?? 'string'
        ]);
    } ?>
    <div class="row">
        <div>
            <?php if ($saved ?? false): ?>
                <span class="temporaryIndicator"><?= __('form.saved') ?></span>
            <?php endif; ?>
        </div>
        <button class="primary"><?= __('form.saveChanges') ?></button>
    </div>
</form>