Skip to content

Commit

Permalink
Add default URL Callback
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Mar 15, 2022
1 parent 99bd269 commit cb45641
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ElfinderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit cb45641

Please sign in to comment.