File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 2424 // The database field to identify a user.
2525 // When set to 'id', the private folder will be named as the user id.
2626 // NOTE: make sure to use an unique field.
27+ // When choosing a startup view you can fill either 'grid' or 'list'.
2728 'user_field ' => 'id ' ,
2829
2930 'shared_folder_name ' => 'shares ' ,
3031 'thumb_folder_name ' => 'thumbs ' ,
3132
3233 'images_dir ' => 'public/photos/ ' ,
3334 'images_url ' => '/photos/ ' ,
35+ 'images_startup_view ' => 'list ' ,
3436
3537 'files_dir ' => 'public/files/ ' ,
3638 'files_url ' => '/files/ ' ,
39+ 'files_startup_view ' => 'grid ' ,
3740
3841 'max_image_size ' => 500 ,
3942 'max_file_size ' => 1000 ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class LfmController extends Controller {
1717 public $ file_location = null ;
1818 public $ dir_location = null ;
1919 public $ file_type = null ;
20+ public $ startup_view = null ;
2021 protected $ user ;
2122
2223 /**
@@ -29,9 +30,11 @@ public function __construct()
2930 if ('Images ' === $ this ->file_type ) {
3031 $ this ->dir_location = Config::get ('lfm.images_url ' );
3132 $ this ->file_location = Config::get ('lfm.images_dir ' );
33+ $ this ->startup_view = Config::get ('lfm.images_startup_view ' );
3234 } elseif ('Files ' === $ this ->file_type ) {
3335 $ this ->dir_location = Config::get ('lfm.files_url ' );
3436 $ this ->file_location = Config::get ('lfm.files_dir ' );
37+ $ this ->startup_view = Config::get ('lfm.files_startup_view ' );
3538 } else {
3639 throw new \Exception ('unexpected type parameter ' );
3740 }
@@ -57,6 +60,7 @@ public function show()
5760 return view ('laravel-filemanager::index ' )
5861 ->with ('working_dir ' , $ working_dir )
5962 ->with ('file_type ' , $ this ->file_type )
63+ ->with ('startup_view ' , $ this ->startup_view )
6064 ->with ('extension_not_found ' , $ extension_not_found );
6165 }
6266
Original file line number Diff line number Diff line change 119119 </div >
120120 </div >
121121 <input type =' hidden' name =' working_dir' id =' working_dir' value =' {{ $working_dir } }' >
122- <input type =' hidden' name =' show_list' id =' show_list' value =' 0 ' >
122+ <input type =' hidden' name =' show_list' id =' show_list' value =' {{ ( $startup_view == ' list ' ) ? 1 : 0 } } ' >
123123 <input type =' hidden' name =' type' id =' type' value =' {{ $file_type } }' >
124124 <input type =' hidden' name =' _token' value =' {{ csrf_token ()} }' >
125125 </form >
You can’t perform that action at this time.
0 commit comments