{{-- CKeditor --}} @php $field['options'] ??= []; $field['options']['extraPlugins'] = $field['extra_plugins'] ?? $field['options']['extra_plugins'] ?? []; $hasElfinder = class_exists('Backpack\FileManager\FileManagerServiceProvider') && (isset($field['elfinderOptions']) && $field['elfinderOptions'] !== false ? true : false); $toolbar = $field['options']['toolbar'] ?? ['undo', 'redo', '|', 'heading', 'outdent', 'indent', '|', 'bold', 'italic', '|', 'blockQuote', 'insertTable', 'bulletedList', 'numberedList', '|', 'link', 'mediaEmbed']; if($hasElfinder) { $field['attributes']['data-elfinder-trigger-url'] = $field['attributes']['data-elfinder-trigger-url'] ?? url(config('elfinder.route.prefix').'/popup/'.$field['name'].'?multiple=1'); $field['attributes']['data-elfinder-trigger-url'] .= '&mimes='.urlencode(Crypt::encrypt($field['elfinderOptions']['onlyMimes'] ?? '')); if(! in_array('ckfinder', $toolbar)) { $toolbar = array_merge($toolbar, ['|', 'ckfinder']); } } $defaultOptions = [ 'language' => app()->getLocale(), 'extraPlugins' => $field['options']['extraPlugins'], 'toolbar' => $toolbar, ]; $field['options'] = array_merge($defaultOptions, $field['options'] ?? []); $field['elfinderOptions'] ??= []; if(!is_array($field['elfinderOptions'])) { $field['elfinderOptions'] = []; } $initFunction = $field['attributes']['data-init-function'] ?? 'bpFieldInitCKEditorElement'; @endphp @include('crud::fields.inc.wrapper_start') @include('crud::fields.inc.translatable_icon') {{-- HINT --}} @if (isset($field['hint']))
{!! $field['hint'] !!}
@endif @include('crud::fields.inc.wrapper_end') {{-- ########################################## --}} {{-- Extra CSS and JS for this particular field --}} {{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} @push('crud_fields_styles') @if($hasElfinder) @basset('https://unpkg.com/jquery-colorbox@1.6.4/example2/colorbox.css') @basset('https://unpkg.com/jquery-colorbox@1.6.4/example2/images/loading.gif', false) @basset('https://unpkg.com/jquery-colorbox@1.6.4/example2/images/controls.png', false) @bassetBlock('backpack/pro/fields/browse-field.css') @endBassetBlock @endif @endpush {{-- FIELD JS - will be loaded in the after_scripts section --}} @push('crud_fields_scripts') @if(isset($field['custom_build'])) @foreach($field['custom_build'] as $script) @basset($script) @endforeach @else @basset('https://cdn.ckeditor.com/ckeditor5/37.1.0/classic/ckeditor.js') @if($hasElfinder) @basset('https://unpkg.com/jquery-colorbox@1.6.4/jquery.colorbox-min.js') @endif @bassetBlock('backpack/pro/fields/ckeditor.js') @endBassetBlock @endif @endpush {{-- End of Extra CSS and JS --}} {{-- ########################################## --}}