diff --git a/Controller/ElFinderController.php b/Controller/ElFinderController.php index c3ce685..518af0d 100644 --- a/Controller/ElFinderController.php +++ b/Controller/ElFinderController.php @@ -70,7 +70,8 @@ private function selectEditor($parameters, $instance, $formTypeId = null) $result['params'] = array( 'locale' => $locale, 'includeAssets' => $includeAssets, - 'instance' => $instance + 'instance' => $instance, + 'relative_path' => $relativePath ); return $result; case 'form': diff --git a/Resources/views/Elfinder/tinymce4.html.twig b/Resources/views/Elfinder/tinymce4.html.twig index f743029..6c46056 100644 --- a/Resources/views/Elfinder/tinymce4.html.twig +++ b/Resources/views/Elfinder/tinymce4.html.twig @@ -29,7 +29,12 @@ url: '{{ path('ef_connect', {'instance': instance}) }}', // connector URL lang : '{{ locale }}', getFileCallback: function(file) { // editor callback - FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE + {% if relative_path %} + FileBrowserDialogue.mySubmit(file.path); // pass selected file path to TinyMCE + {% else %} + FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE + {% endif %} + } }).elfinder('instance'); });