From 22825616d5d097799caea8c4d2cd57908bcea741 Mon Sep 17 00:00:00 2001 From: Albert Ganiev Date: Tue, 6 Jan 2015 02:38:59 +1000 Subject: [PATCH] tinymce relative path --- Controller/ElFinderController.php | 3 ++- Resources/views/Elfinder/tinymce4.html.twig | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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'); });