aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/configuration/type-edit.php
blob: 1cec3f094a819e7cd4ab85b4d8126644f6cd487b (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
28
29
30
31
<?php
/**
 * @var string $value
 */
?>
<? if ($type === 'boolean') : ?>
    <input type="hidden" name="value" value="0">
    <label>
        <input type="checkbox" name="value" value="1" <? if ($value) echo 'checked'; ?>>
        <?= _('aktiviert') ?>
    </label>
<? else : ?>
    <label>
        <?= _('Inhalt') ?>
        <? if ($type === 'integer'): ?>
            <input name="value" type="number" id="item-value"
                   value="<?= htmlReady($value) ?>">
        <? elseif ($type === 'array') : ?>
            <?php $v = json_encode($value, JSON_UNESCAPED_UNICODE) ?>
            <textarea cols="80" rows="5" name="value" id="item-value"><?= htmlReady($v, true, true) ?></textarea>
        <? elseif ($type === 'i18n'): ?>
            <?= I18N::textarea('value', $value, [
                'id' => 'item-value',
                'cols' => 80,
                'rows' => 3,
            ]) ?>
        <? else: ?>
            <textarea cols="80" rows="3" name="value" id="item-value"><?= htmlReady($value) ?></textarea>
        <? endif; ?>
    </label>
<? endif ?>