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
3 changes: 3 additions & 0 deletions src/config/lfm.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@
// The database field to identify a user.
// When set to 'id', the private folder will be named as the user id.
// NOTE: make sure to use an unique field.
// When choosing a startup view you can fill either 'grid' or 'list'.
'user_field' => 'id',

'shared_folder_name' => 'shares',
'thumb_folder_name' => 'thumbs',

'images_dir' => 'public/photos/',
'images_url' => '/photos/',
'images_startup_view' => 'list',

'files_dir' => 'public/files/',
'files_url' => '/files/',
'files_startup_view' => 'grid',

'max_image_size' => 500,
'max_file_size' => 1000,
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/LfmController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class LfmController extends Controller {
public $file_location = null;
public $dir_location = null;
public $file_type = null;
public $startup_view = null;
protected $user;

/**
Expand All @@ -29,9 +30,11 @@ public function __construct()
if ('Images' === $this->file_type) {
$this->dir_location = Config::get('lfm.images_url');
$this->file_location = Config::get('lfm.images_dir');
$this->startup_view = Config::get('lfm.images_startup_view');
} elseif ('Files' === $this->file_type) {
$this->dir_location = Config::get('lfm.files_url');
$this->file_location = Config::get('lfm.files_dir');
$this->startup_view = Config::get('lfm.files_startup_view');
} else {
throw new \Exception('unexpected type parameter');
}
Expand All @@ -57,6 +60,7 @@ public function show()
return view('laravel-filemanager::index')
->with('working_dir', $working_dir)
->with('file_type', $this->file_type)
->with('startup_view', $this->startup_view)
->with('extension_not_found', $extension_not_found);
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
</div>
</div>
<input type='hidden' name='working_dir' id='working_dir' value='{{$working_dir}}'>
<input type='hidden' name='show_list' id='show_list' value='0'>
<input type='hidden' name='show_list' id='show_list' value='{{ ($startup_view == 'list') ? 1 : 0 }}'>
<input type='hidden' name='type' id='type' value='{{$file_type}}'>
<input type='hidden' name='_token' value='{{csrf_token()}}'>
</form>
Expand Down