Skip to content

Commit bcbd3d5

Browse files
committed
update fields
1 parent a818bc4 commit bcbd3d5

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

resources/views/fields/browse.blade.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{{-- browse server input --}}
2-
2+
@php
3+
$field['attributes']['data-elfinder-trigger-url'] = $field['attributes']['data-elfinder-trigger-url'] ?? url(config('elfinder.route.prefix').'/popup/'.$field['name']);
4+
$field['attributes']['data-elfinder-trigger-url'] .= '?mimes='.urlencode(Crypt::encrypt($field['mime_types'] ?? ''));
5+
@endphp
36
@include('crud::fields.inc.wrapper_start')
4-
57
<label>{!! $field['label'] !!}</label>
68
@include('crud::fields.inc.translatable_icon')
79
<div class="input-group">
@@ -10,7 +12,6 @@
1012
name="{{ $field['name'] }}"
1113
value="{{ old_empty_or_null($field['name'], '') ?? $field['value'] ?? $field['default'] ?? '' }}"
1214
data-init-function="bpFieldInitBrowseElement"
13-
data-elfinder-trigger-url="{{ url(config('elfinder.route.prefix').'/popup') }}"
1415
@include('crud::fields.inc.attributes')
1516

1617
@if(!isset($field['readonly']) || $field['readonly']) readonly @endif
@@ -71,7 +72,7 @@ function bpFieldInitBrowseElement(element) {
7172
7273
// trigger the reveal modal with elfinder inside
7374
$.colorbox({
74-
href: triggerUrl + '/' + name,
75+
href: triggerUrl,
7576
fastIframe: false,
7677
iframe: true,
7778
width: '80%',

resources/views/fields/browse_multiple.blade.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
$field['wrapper']['data-init-function'] = $field['wrapper']['data-init-function'] ?? 'bpFieldInitBrowseMultipleElement';
1212
$field['wrapper']['data-elfinder-trigger-url'] = $field['wrapper']['data-elfinder-trigger-url'] ?? url(config('elfinder.route.prefix').'/popup/'.$field['name'].'?multiple=1');
1313
14-
if (isset($field['mime_types'])) {
15-
$field['wrapper']['data-elfinder-trigger-url'] .= '&mimes='.urlencode(Crypt::encrypt($field['mime_types']));
16-
}
14+
$field['wrapper']['data-elfinder-trigger-url'] .= '&mimes='.urlencode(Crypt::encrypt($field['mime_types'] ?? ''));
1715
1816
if ($multiple) {
1917
$field['wrapper']['data-multiple'] = "true";

0 commit comments

Comments
 (0)