<?php if ($this->previewMode): ?>
    <div class="form-control"><?= e($value) ?></div>
<?php else: ?>
    <div
        id="<?= $this->getId() ?>"
        class="field-codeeditor size-<?= $size ?> <?= $stretch?'layout-relative':'' ?>"
        data-control="codeeditor"
        data-font-size="<?= $fontSize ?>"
        data-word-wrap="<?= $wordWrap ?>"
        data-code-folding="<?= $codeFolding ?>"
        data-tab-size="<?= $tabSize ?>"
        data-theme="<?= $theme ?>"
        data-show-invisibles="<?= $showInvisibles ?>"
        data-highlight-active-line="<?= $highlightActiveLine ?>"
        data-use-soft-tabs="<?= $useSoftTabs ?>"
        data-show-gutter="<?= $showGutter ? 'true' : 'false' ?>"
        data-language="<?= $language ?>"
        data-margin="<?= $margin ?>"
        data-vendor-path="<?= URL::asset('/modules/backend/formwidgets/codeeditor/assets/vendor/ace') ?>">
        <div class="editor-toolbar">
            <ul>
                <li class="fullscreen-enable">
                    <a href="javascript:;">
                        <i class="icon-desktop"></i>
                        <abbr title="ctrl+alt+f"><?= e(trans('cms::lang.editor.enter_fullscreen')) ?></abbr>
                    </a>
                </li>
                <li class="fullscreen-disable">
                    <a href="javascript:;">
                        <i class="icon-desktop"></i>
                        <abbr title="ctrl+alt+f or esc"><?= e(trans('cms::lang.editor.exit_fullscreen')) ?></abbr>
                    </a>
                </li>
            </ul>
        </div>
        <textarea name="<?= $name ?>" id="<?= $this->getId('textarea') ?>"><?= e($value) ?></textarea>
    </div>
<?php endif ?>