12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- require_once __DIR__ . '/../include/utils.php';
- render_page_header(get_string('settings.title'));
- ?>
- <div class="container container-small">
- <h1 class="center"><?= get_string('settings.title') ?></h1>
- <?php if (SSFW_ONLY || SFW_ONLY) { ?>
- <div class="notice">
- <p><?= get_string(SSFW_ONLY ? 'settings.ssfw-notice' : 'settings.sfw-notice') ?></p>
- </div>
- <?php } ?>
- <form method="post" action="save.php" class="options">
- <input type="hidden" name="from"
- value="<?= isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : (BASE_URL . '/') ?>"
- ><?php
- foreach ($settings_entries as $entry) switch ($entry['type']) {
- case 'checkbox': ?>
- <div>
- <label for="<?= $entry['id'] ?>"><?= get_string('settings.' . $entry['id']) ?></label>
- <input type="hidden" value="off" name="<?= $entry['id'] ?>">
- <input type="checkbox" class="switch" autocomplete="off"
- name="<?= $entry['id'] ?>" id="<?= $entry['id'] ?>"
- <?php if ($settings[$entry['id']] == 'on') echo 'checked'; ?>
- >
- </div><?php
- break;
- case 'dropdown': ?>
- <div>
- <label><?= get_string('settings.' . $entry['id']) ?></label>
- <select name="<?= $entry['id'] ?>" autocomplete="off">
- <?php foreach ($entry['options'] as $option) { ?>
- <option value="<?= $option ?>"
- <?php if ($settings[$entry['id']] == $option) echo 'selected' ?>
- ><?= get_string('settings.' . $option) ?: $option ?></option>
- <?php } ?>
- </select>
- </div><?php
- break;
- }
- ?>
- <p class="center">
- <button type="submit"><?= get_string('settings.save') ?></button>
- </p>
- </form>
- </div>
- <?php
- render_page_footer();
|