Skip to content

Commit

Permalink
tinymce relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
helios-ag committed Jan 5, 2015
1 parent ea65d5e commit 2282561
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Controller/ElFinderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
7 changes: 6 additions & 1 deletion Resources/views/Elfinder/tinymce4.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down

0 comments on commit 2282561

Please sign in to comment.