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
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ You can use elFinder in Backpack:
You can publish the views to your `resources/views/vendor/backpack/filemanager` folder by running:

```bash
php vendor:publish --provider="Backpack\FileManager\FileManagerServiceProvider" --tag="views"
php vendor:publish --provider="Backpack\FileManager\FileManagerServiceProvider" --tag="elfinder-views"
php vendor:publish --provider="Backpack\FileManager\FileManagerServiceProvider" --tag="elfinder-fields"
php vendor:publish --provider="Backpack\FileManager\FileManagerServiceProvider" --tag="elfinder-columns"

```

## Upgrade

To upgrade from v2 to v3 of this package:
To upgrade from v3 to v4 of this package:
```bash
# remove the published blade views
rm -rf resources/views/vendor/elfinder

# publish the new blade views
php artisan backpack:filemanager:install
```

## Security
Expand Down
4 changes: 2 additions & 2 deletions resources/views/elfinder.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

@section('after_scripts')

@include('backpack.elfinder::common_scripts')
@include('backpack.elfinder::common_styles')
@include('backpack.filemanager::common_scripts')
@include('backpack.filemanager::common_styles')

<!-- elFinder initialization (REQUIRED) -->
<script type="text/javascript" charset="utf-8">
Expand Down
4 changes: 2 additions & 2 deletions resources/views/standalonepopup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<html lang="{{ app()->getLocale() }}">
<head>

@include('backpack.elfinder::common_scripts')
@include('backpack.elfinder::common_styles', ['styleBodyElement' => true])
@include('backpack.filemanager::common_scripts')
@include('backpack.filemanager::common_styles', ['styleBodyElement' => true])
<style type="text/css">
.elfinder-workzone {
min-height: max-content !important;
Expand Down
4 changes: 2 additions & 2 deletions src/BackpackElfinderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public function showPopup($input_id)
}

return $this->app['view']
->make('backpack.elfinder::standalonepopup')
->make('backpack.filemanager::standalonepopup')
->with($this->getViewVars())
->with(compact('input_id'));
}

public function showIndex()
{
return $this->app['view']
->make('backpack.elfinder::elfinder')
->make('backpack.filemanager::elfinder')
->with($this->getViewVars());
}
}
4 changes: 2 additions & 2 deletions src/Console/Commands/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function handle()
$this->infoBlock('Installing Backpack FileManager', 'Step 1');

// Creating uploads directory
$this->progressBlock('Creating uploads directory');
$this->progressBlock('Creating uploads directory in case it does not exist');
File::ensureDirectoryExists('public/uploads');
$this->closeProgressBlock();

Expand All @@ -60,7 +60,7 @@ public function handle()
// Done
$url = Str::of(config('app.url'))->finish('/')->append('admin/elfinder');
$this->infoBlock('Backpack FileManager installation complete.', 'done');
$this->note('Go to <fg=blue>$url</> to access your filemanager.');
$this->note('Go to <fg=blue>'.$url.'</> to access your filemanager.');
$this->note('You may need to run <fg=blue>php artisan serve</> to serve your Laravel project.');
$this->newLine();
}
Expand Down
28 changes: 22 additions & 6 deletions src/FileManagerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ public function boot()
$this->bootForConsole();
}

$this->loadViewsFrom(__DIR__.'/../resources/views', 'backpack.elfinder');
if (is_dir(base_path('resources/views/vendor/backpack/filemanager'))) {
$this->loadViewsFrom(base_path('resources/views/vendor/backpack/filemanager'), 'backpack.filemanager');
}

// Fallback to package views
$this->loadViewsFrom(__DIR__.'/../resources/views', 'backpack.filemanager');

$crudLanguages = array_keys(config('backpack.crud.languages', []));
foreach ($crudLanguages as $language) {
Expand All @@ -45,11 +50,11 @@ public function register()
Basset::addViewPath(realpath(__DIR__.'/../resources/views'));

ViewNamespaces::addFor('fields', [
'backpack.elfinder::fields',
'backpack.filemanager::fields',
]);

ViewNamespaces::addFor('columns', [
'backpack.elfinder::columns',
'backpack.filemanager::columns',
]);
}

Expand All @@ -60,10 +65,21 @@ public function register()
*/
protected function bootForConsole()
{
// Publishing the views.
// Publishing exclusively the elfinder files, not the columns and fields folders
$this->publishes([
__DIR__.'/../resources/views/elfinder.blade.php' => resource_path('views/vendor/backpack/filemanager/elfinder.blade.php'),
__DIR__.'/../resources/views/standalonepopup.blade.php' => resource_path('views/vendor/backpack/filemanager/standalonepopup.blade.php'),
__DIR__.'/../resources/views/common_scripts.blade.php' => resource_path('views/vendor/backpack/filemanager/common_scripts.blade.php'),
__DIR__.'/../resources/views/common_styles.blade.php' => resource_path('views/vendor/backpack/filemanager/common_styles.blade.php'),
], 'elfinder-views');

$this->publishes([
__DIR__.'/../resources/views/columns' => resource_path('views/vendor/backpack/filemanager/columns'),
], 'filemanager-columns');

$this->publishes([
__DIR__.'/../resources/views' => resource_path('views/vendor/backpack/filemanager'),
], 'views');
__DIR__.'/../resources/views/fields' => resource_path('views/vendor/backpack/filemanager/fields'),
], 'filemanager-fields');

// Publishing config file.
$this->publishes([
Expand Down