aboutsummaryrefslogtreecommitdiff
path: root/templates/i18n/textarea.php
blob: a9e8715afb3094d5d6186d64f26183b3183c35e6 (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
<? foreach ($languages as $locale => $lang): ?>
    <?
        $attr = $attributes;
        if ($locale === $base_lang) {
            $attr['name'] = $name;
            $text = $value->original();
        } else {
            $attr['name'] = "{$name}_i18n[{$locale}]";
            $text = $value->translation($locale);

            unset(
                $attr['id'],
                $attr['required']
            );
        }

        // If special attribute locale_names is defined, use name from that
        if (isset($attr['locale_names']) && is_array($attr['locale_names'])) {
            $attr['name'] = $attr['locale_names'][$locale];
            unset($attr['locale_names']);
        }
    ?>
    <div class="i18n" data-lang="<?= $lang['name'] ?>" data-icon="url(<?= Assets::image_path("languages/{$lang['picture']}") ?>)">
        <textarea <?= arrayToHtmlAttributes($attr) ?>
        ><?= $wysiwyg ? wysiwygReady($text) : htmlReady($text) ?></textarea>
    </div>
<? endforeach; ?>