diff --git a/src/config/lfm.php b/src/config/lfm.php index ad02ebcd..9c265b8e 100644 --- a/src/config/lfm.php +++ b/src/config/lfm.php @@ -24,6 +24,7 @@ // 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', @@ -31,9 +32,11 @@ '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, diff --git a/src/controllers/LfmController.php b/src/controllers/LfmController.php index 4ef3852d..748607d8 100644 --- a/src/controllers/LfmController.php +++ b/src/controllers/LfmController.php @@ -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; /** @@ -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'); } @@ -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); } diff --git a/src/views/index.blade.php b/src/views/index.blade.php index 68018586..fe00f963 100644 --- a/src/views/index.blade.php +++ b/src/views/index.blade.php @@ -119,7 +119,7 @@ - +