From cb45641c911482885b2356abd719b98ad8ad2443 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Tue, 15 Mar 2022 20:35:04 +0100 Subject: [PATCH] Add default URL Callback --- src/ElfinderController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ElfinderController.php b/src/ElfinderController.php index f4b4dc7..b8027c4 100644 --- a/src/ElfinderController.php +++ b/src/ElfinderController.php @@ -104,12 +104,15 @@ public function showConnector() 'driver' => 'Flysystem', 'filesystem' => $disk->getDriver(), 'alias' => $key, - 'URLCallback' => function($path) use ($disk) { - return $disk->url($path); - }, 'accessControl' => $this->app->config->get('elfinder.access') // filter callback (OPTIONAL) ]; - $roots[] = array_merge($defaults, $root); + $root = array_merge($defaults, $root); + if (!isset($root['URL'])) { + $root['URLCallback'] = function($path) use ($disk) { + return $disk->url($path); + }; + } + $roots[] = $root; } } }