diff --git a/Controller/ElFinderController.php b/Controller/ElFinderController.php index 6419c0d..5af2bfc 100644 --- a/Controller/ElFinderController.php +++ b/Controller/ElFinderController.php @@ -23,7 +23,7 @@ public function showAction($instance) { $efParameters = $this->container->getParameter('fm_elfinder'); $parameters = $efParameters['instances'][$instance]; - $result = $this->selectEditor($parameters, $instance); + $result = $this->selectEditor($parameters, $instance, $this->getRequest()->get("id")); return $this->render($result['template'], $result['params']); } @@ -33,7 +33,7 @@ public function showAction($instance) * @param $instance * @return array */ - private function selectEditor($parameters, $instance) + private function selectEditor($parameters, $instance, $formTypeId = null) { $editor = $parameters['editor']; $locale = $parameters['locale'] ?: $this->container->getParameter('locale'); @@ -76,7 +76,8 @@ private function selectEditor($parameters, $instance) 'locale' => $locale, 'fullscreen' => $fullscreen, 'includeAssets' => $includeAssets, - 'instance' => $instance + 'instance' => $instance, + 'id'=>$formTypeId ); return $result; default: diff --git a/Resources/views/Elfinder/elfinder_type.html.twig b/Resources/views/Elfinder/elfinder_type.html.twig index af785a5..393a234 100644 --- a/Resources/views/Elfinder/elfinder_type.html.twig +++ b/Resources/views/Elfinder/elfinder_type.html.twig @@ -15,7 +15,7 @@ url : '{{path('ef_connect', { 'instance': instance } )}}', lang : '{{locale}}', getFileCallback: function(file) { - window.opener.setValue(file.path); + window.opener.setValue(file.path, "{{ id }}"); window.close(); } }); diff --git a/Resources/views/Form/elfinder_widget.html.twig b/Resources/views/Form/elfinder_widget.html.twig index dc0c538..2724173 100644 --- a/Resources/views/Form/elfinder_widget.html.twig +++ b/Resources/views/Form/elfinder_widget.html.twig @@ -2,11 +2,11 @@ {% if enable and instance is defined %} {% endif %}