Skip to content

Commit 0d017dd

Browse files
committed
remove some configs
1 parent 22f45f1 commit 0d017dd

File tree

7 files changed

+32
-651
lines changed

7 files changed

+32
-651
lines changed

src/Lfm.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function getDisplayMode()
101101

102102
public function getUserSlug()
103103
{
104-
$config = $this->config->get('lfm.user_folder_name');
104+
$config = $this->config->get('lfm.private_folder_name');
105105

106106
if (is_callable($config)) {
107107
return call_user_func($config);
@@ -138,11 +138,6 @@ public function getThumbFolderName()
138138
return $this->config->get('lfm.thumb_folder_name');
139139
}
140140

141-
public function getFileIcon($ext)
142-
{
143-
return $this->config->get("lfm.file_icon_array.{$ext}", 'fa-file-o');
144-
}
145-
146141
public function getFileType($ext)
147142
{
148143
return $this->config->get("lfm.file_type_array.{$ext}", 'File');
@@ -165,7 +160,7 @@ public function maxUploadSize()
165160
*/
166161
public function allowMultiUser()
167162
{
168-
return $this->config->get('lfm.allow_multi_user') === true;
163+
return $this->config->get('lfm.allow_private_folder') === true;
169164
}
170165

171166
/**
@@ -180,7 +175,7 @@ public function allowShareFolder()
180175
return true;
181176
}
182177

183-
return $this->config->get('lfm.allow_share_folder') === true;
178+
return $this->config->get('lfm.allow_shared_folder') === true;
184179
}
185180

186181
/**

src/config/lfm.php

+17-51
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,33 @@
1717

1818
'use_package_routes' => true,
1919

20-
// // Use relative paths (without domain)
21-
// 'relative_paths' => false,
22-
2320
/*
2421
|--------------------------------------------------------------------------
25-
| Multi-User Mode
22+
| Shared folder / Private folder
2623
|--------------------------------------------------------------------------
24+
|
25+
| If both options are set to false, then shared folder will be activated.
26+
|
2727
*/
2828

29-
'allow_multi_user' => true,
30-
31-
'allow_share_folder' => true,
32-
33-
/*
34-
|--------------------------------------------------------------------------
35-
| Folder Names
36-
|--------------------------------------------------------------------------
37-
*/
29+
'allow_private_folder' => true,
3830

3931
// Flexible way to customize client folders accessibility
4032
// If you want to customize client folders, publish tag="lfm_handler"
4133
// Then you can rewrite userField function in App\Handler\ConfigHandler class
4234
// And set 'user_field' to App\Handler\ConfigHandler::class
4335
// Ex: The private folder of user will be named as the user id.
44-
'user_folder_name' => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,
36+
'private_folder_name' => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,
37+
38+
'allow_shared_folder' => true,
4539

4640
'shared_folder_name' => 'shares',
4741

48-
'thumb_folder_name' => 'thumbs',
42+
/*
43+
|--------------------------------------------------------------------------
44+
| Folder Names
45+
|--------------------------------------------------------------------------
46+
*/
4947

5048
'folder_categories' => [
5149
'file' => [
@@ -94,15 +92,6 @@
9492

9593
'should_validate_mime' => false,
9694

97-
// permissions to be set when create a new folder or when it creates automatically with thumbnails
98-
'create_folder_mode' => 0755,
99-
100-
// permissions to be set on file upload.
101-
'create_file_mode' => 0644,
102-
103-
// If true, it will attempt to chmod the file after upload
104-
'should_change_file_mode' => true,
105-
10695
// behavior on files with identical name
10796
// setting it to true cause old file replace with new one
10897
// setting it to false show `error-file-exist` error and stop upload
@@ -117,26 +106,18 @@
117106
// If true, image thumbnails would be created during upload
118107
'should_create_thumbnails' => true,
119108

109+
'thumb_folder_name' => 'thumbs',
110+
120111
// Create thumbnails automatically only for listed types.
121112
'raster_mimetypes' => [
122113
'image/jpeg',
123114
'image/pjpeg',
124115
'image/png',
125116
],
126117

127-
'thumb_img_width' => 200,
118+
'thumb_img_width' => 200, // px
128119

129-
'thumb_img_height' => 200,
130-
131-
/*
132-
|--------------------------------------------------------------------------
133-
| jQuery UI options
134-
|--------------------------------------------------------------------------
135-
*/
136-
137-
'resize_aspectRatio' => false,
138-
139-
'resize_containment' => true,
120+
'thumb_img_height' => 200, // px
140121

141122
/*
142123
|--------------------------------------------------------------------------
@@ -159,21 +140,6 @@
159140
'pptx' => 'Microsoft PowerPoint',
160141
],
161142

162-
'file_icon_array' => [
163-
'pdf' => 'fa-file-pdf-o',
164-
'doc' => 'fa-file-word-o',
165-
'docx' => 'fa-file-word-o',
166-
'xls' => 'fa-file-excel-o',
167-
'xlsx' => 'fa-file-excel-o',
168-
'zip' => 'fa-file-archive-o',
169-
'gif' => 'fa-file-image-o',
170-
'jpg' => 'fa-file-image-o',
171-
'jpeg' => 'fa-file-image-o',
172-
'png' => 'fa-file-image-o',
173-
'ppt' => 'fa-file-powerpoint-o',
174-
'pptx' => 'fa-file-powerpoint-o',
175-
],
176-
177143
/*
178144
|--------------------------------------------------------------------------
179145
| php.ini override

src/views/resize.blade.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@
7878
renderResizedValues($("#width_display").val(), $("#height_display").val());
7979
8080
$("#resize").resizable({
81-
aspectRatio: {{ config('lfm.resize_aspectRatio')?'true':'false' }},
82-
@if(config('lfm.resize_containment'))
81+
aspectRatio: true,
8382
containment: "#containment",
84-
@endif
8583
handles: "n, e, s, w, se, sw, ne, nw",
8684
resize: function (event, ui) {
8785
renderResizedValues(ui.size.width, ui.size.height);

0 commit comments

Comments
 (0)