Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions resources/views/common_scripts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,5 @@
{{-- elFinder JS (REQUIRED) --}}
@basset(base_path('vendor/studio-42/elfinder/js/elfinder.min.js'))

{{-- elFinder translation (OPTIONAL) --}}
@if($locale)
@basset('bp-elfinder-i18n-'.$locale)
@endif

{{-- elFinder sounds --}}
@basset(base_path('vendor/studio-42/elfinder/sounds/rm.wav'))
6 changes: 6 additions & 0 deletions resources/views/elfinder.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
<script type="text/javascript" charset="utf-8">
// Documentation for client options:
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options

// elFinder does not fully support jQuery UI 1.13+ yet, so we need to add this workaround.
if (typeof $.fn.buttonset !== 'function' && typeof $.fn.controlgroup === 'function') {
$.fn.buttonset = $.fn.controlgroup;
}

$(document).ready(function() {
$('#elfinder').elfinder({
// set your elFinder options here
Expand Down
6 changes: 3 additions & 3 deletions src/BackpackElfinderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Backpack\FileManager;

use Backpack\Basset\Facades\Basset;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Log;

Expand Down Expand Up @@ -49,14 +48,15 @@ public function showIndex()

protected function getViewVars()
{
$dir = 'packages/barryvdh/'.$this->package;
$locale = str_replace('-', '_', $this->app->config->get('app.locale'));

if (! array_key_exists('bp-elfinder-i18n-'.$locale, Basset::getNamedAssets())) {
if (! file_exists(base_path("vendor/studio-42/elfinder/js/i18n/elfinder.{$locale}.js"))) {
$locale = false;
}

$csrf = true;

return compact('locale', 'csrf');
return compact('dir', 'locale', 'csrf');
}
}
Loading