Skip to content

Commit 34597c8

Browse files
committed
Added sounds to basset
Improved installation, avoiding publishing elfinder assets
1 parent 0c3d8a1 commit 34597c8

File tree

9 files changed

+18
-21
lines changed

9 files changed

+18
-21
lines changed

resources/views/ckeditor4.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function getUrlParam(paramName) {
2727
_token: '{{ csrf_token() }}'
2828
},
2929
url: '{{ route("elfinder.connector") }}', // connector URL
30-
soundPath: '{{ asset($dir.'/sounds') }}',
30+
soundPath: '{{ Basset::getAssetUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
3131
getFileCallback : function(file) {
3232
window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
3333
window.close();

resources/views/common_scripts.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
@if($locale)
1717
@basset('https://cdnjs.cloudflare.com/ajax/libs/elfinder/2.1.61/js/i18n/elfinder.'.$locale.'.min.js')
1818
@endif
19+
20+
{{-- elFinder sounds --}}
21+
@basset(base_path('vendor/studio-42/elfinder/sounds/rm.wav'))

resources/views/filepicker.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
_token: '{{ csrf_token() }}'
1717
},
1818
url: '{{ route("elfinder.connector") }}', // connector URL
19-
soundPath: '{{ asset($dir.'/sounds') }}',
19+
soundPath: '{{ Basset::getAssetUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
2020
resizable: false,
2121
ui: ['toolbar', 'path','stat'],
2222
onlyMimes: [{{ $mimeTypes }}],

resources/views/standalonepopup.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
_token: '{{ csrf_token() }}'
1717
},
1818
url: '{{ route("elfinder.connector") }}', // connector URL
19-
soundPath: '{{ asset($dir.'/sounds') }}',
19+
soundPath: '{{ Basset::getAssetUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
2020
dialog: {width: 900, modal: true, title: 'Select a file'},
2121
resizable: false,
2222
onlyMimes: @json(unserialize(urldecode(request('mimes')))),

resources/views/tinymce.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
_token: '{{ csrf_token() }}'
4949
},
5050
url : '{{ route("elfinder.connector") }}', // connector URL
51-
soundPath: '{{ asset($dir.'/sounds') }}',
51+
soundPath: '{{ Basset::getAssetUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
5252
getFileCallback: function(file) { // editor callback
5353
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
5454
}

resources/views/tinymce4.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
_token: '{{ csrf_token() }}'
3131
},
3232
url: '{{ route("elfinder.connector") }}', // connector URL
33-
soundPath: '{{ asset($dir.'/sounds') }}',
33+
soundPath: '{{ Basset::getAssetUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
3434
getFileCallback: function(file) { // editor callback
3535
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
3636
}

resources/views/tinymce5.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
_token: '{{ csrf_token() }}'
3232
},
3333
url: '{{ route("elfinder.connector") }}', // connector URL
34-
soundPath: '{{ asset($dir.'/sounds') }}',
34+
soundPath: '{{ Basset::getAssetUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
3535
getFileCallback: function(file) { // editor callback
3636
FileBrowserDialogue.mySubmit(file); // pass selected file path to TinyMCE
3737
}

src/Console/Commands/Install.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
namespace Backpack\FileManager\Console\Commands;
44

55
use Backpack\CRUD\app\Console\Commands\Traits\PrettyCommandOutput;
6+
use Backpack\FileManager\FileManagerServiceProvider;
67
use Illuminate\Console\Command;
8+
use Illuminate\Support\Facades\File;
79
use Illuminate\Support\Str;
810

911
class Install extends Command
@@ -35,22 +37,16 @@ public function handle()
3537
{
3638
$this->infoBlock('Installing Backpack FileManager', 'Step 1');
3739

40+
// Creating uploads directory
3841
$this->progressBlock('Creating uploads directory');
39-
switch (DIRECTORY_SEPARATOR) {
40-
case '/': // unix
41-
$this->executeProcess(['mkdir', '-p', 'public/uploads']);
42-
break;
43-
case '\\': // windows
44-
if (! file_exists('public\uploads')) {
45-
$this->executeProcess(['mkdir', 'public\uploads']);
46-
}
47-
break;
48-
}
42+
File::ensureDirectoryExists('public/uploads');
4943
$this->closeProgressBlock();
5044

51-
// Publishing elFinder assets
52-
$this->progressBlock('Publishing elFinder assets');
53-
$this->executeArtisanProcess('elfinder:publish');
45+
// Publishing custom elfinder views
46+
$this->progressBlock('Publishing custom elfinder views');
47+
$this->executeArtisanProcess('vendor:publish', [
48+
'--provider' => FileManagerServiceProvider::class,
49+
]);
5450
$this->closeProgressBlock();
5551

5652
// Adding sidebar menu item

src/FileManagerServiceProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class FileManagerServiceProvider extends ServiceProvider
1818
*/
1919
public function boot()
2020
{
21-
// $this->loadViewsFrom(__DIR__.'/../resources/views', 'backpack');
22-
2321
// Publishing is only necessary when using the CLI.
2422
if ($this->app->runningInConsole()) {
2523
$this->bootForConsole();

0 commit comments

Comments
 (0)