@php /** * Taxonomy icon source — one dropdown that shows only the selected input: * • Flag → (cuisines only) the country flag: "Auto" (detect by name, sentinel * 'flag') or a specific country ('flag:') * • Font Awesome → a glyph or brand mark from partials/icon-library.php (stored as the class, * e.g. "fa-cheese", or a brand key) * • Image → any image, chosen from the media library * Only the selected option's input is shown, so a glyph and an image are never both set. * * THERE IS NO BUILT-IN "DEFAULT ICONS" SOURCE. The shipped 3D and ingredient sets are image * files, not an icon font, so a source that presented them as icons was naming them wrongly and * duplicating the Image source that already reaches them. An image now comes from one place. * JS in taxonomy.php wires the switching, selection and scroll-to-selected. * * This stays a separate control from partials/pc-icon-field.php on purpose. That one picks a * glyph; this one picks between SOURCES and funnels them through a single hidden field so they can * never both be set. What the two share is the glyph list itself — the one place icons are added. * * @var string $id base id — the media field id + name="icon"; "$id-pick" hidden; "$id-mode" select * @var array $flags cuisines only: country flags [['iso'=>..,'name'=>..], ...] * @var bool $withFlag whether to offer the "Flag" option first (cuisines) */ $flags = $flags ?? []; $withFlag = !empty($withFlag); $modes = []; if ($withFlag) { $modes[] = ['key' => 'flag', 'label' => t_raw('admin.taxonomy.icon_mode_flag')]; } $modes[] = ['key' => 'fa', 'label' => t_raw('admin.taxonomy.icon_mode_fa')]; $modes[] = ['key' => 'image', 'label' => t_raw('admin.taxonomy.icon_mode_image')]; $first = $modes[0]['key']; @endphp @if ($withFlag)
@foreach ($flags as $fl) @endforeach
@endif @php /* The glyph source draws from partials/icon-library.php — the same