Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
- Base: wintercms/winter branch 1.2 (full framework) - Theme vivespos: Canvas 7 + Bootstrap 5 CDN, custom CSS - Layout: deferred GTM/GA4 tracking, JSON-LD SoftwareApplication - Partials: hero (offline-first), features, modes (offline/nube toggle), screenshots, pricing (3 planes), comparison, FAQ, CTA - Plugin VivesPOS.Site with ContactForm - Dockerfile: PHP 8.2 Apache, port 80, healthcheck - Added winter/wn-pages, blog, sitemap, seo plugins - Active theme set to vivespos
44 lines
1.5 KiB
PHP
44 lines
1.5 KiB
PHP
<?php
|
|
$fieldOptions = $field->options();
|
|
if ($fieldOptions instanceof Illuminate\Support\Collection) {
|
|
$fieldOptions = $fieldOptions->all();
|
|
}
|
|
?>
|
|
|
|
<!-- Dropdown -->
|
|
<?php if ($this->previewMode || $field->readOnly): ?>
|
|
<div class="form-control" <?= $field->readOnly ? 'disabled="disabled"' : ''; ?>>
|
|
<?= (isset($fieldOptions[$field->value])) ? e(trans($fieldOptions[$field->value])) : '' ?>
|
|
</div>
|
|
<input type="hidden" name="<?= $field->getName() ?>" value="<?= $field->value ?>">
|
|
<?php else:
|
|
$emptyOption = $field->getConfig('emptyOption', $field->placeholder);
|
|
$options = $field->getAttributes(htmlBuild:false);
|
|
$options['id'] = $field->getId();
|
|
$options['class'] = 'form-control custom-select';
|
|
if ($field->getConfig('showSearch', true) === false) {
|
|
$options['class'] .= ' select-no-search';
|
|
}
|
|
if ($field->getConfig('allowCustom', false)) {
|
|
$options['class'] .= ' select-modifiable';
|
|
}
|
|
if ($emptyOption) {
|
|
$options['emptyOption'] = e(trans($emptyOption));
|
|
}
|
|
if ($field->placeholder) {
|
|
$options['data-placeholder'] = e(trans($field->placeholder));
|
|
}
|
|
foreach ($fieldOptions as $key => &$value) {
|
|
if (is_string($value) && str_contains($value, '::')) {
|
|
$value = e(trans($value));
|
|
}
|
|
}
|
|
?>
|
|
<?= Form::select(
|
|
name: $field->getName(),
|
|
list: $fieldOptions,
|
|
selected: $field->value,
|
|
options: $options
|
|
) ?>
|
|
<?php endif ?>
|