Skip to content

Commit

Permalink
remove some configs
Browse files Browse the repository at this point in the history
  • Loading branch information
streamtw committed Jan 8, 2020
1 parent 22f45f1 commit 0d017dd
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 651 deletions.
11 changes: 3 additions & 8 deletions src/Lfm.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getDisplayMode()

public function getUserSlug()
{
$config = $this->config->get('lfm.user_folder_name');
$config = $this->config->get('lfm.private_folder_name');

if (is_callable($config)) {
return call_user_func($config);
Expand Down Expand Up @@ -138,11 +138,6 @@ public function getThumbFolderName()
return $this->config->get('lfm.thumb_folder_name');
}

public function getFileIcon($ext)
{
return $this->config->get("lfm.file_icon_array.{$ext}", 'fa-file-o');
}

public function getFileType($ext)
{
return $this->config->get("lfm.file_type_array.{$ext}", 'File');
Expand All @@ -165,7 +160,7 @@ public function maxUploadSize()
*/
public function allowMultiUser()
{
return $this->config->get('lfm.allow_multi_user') === true;
return $this->config->get('lfm.allow_private_folder') === true;
}

/**
Expand All @@ -180,7 +175,7 @@ public function allowShareFolder()
return true;
}

return $this->config->get('lfm.allow_share_folder') === true;
return $this->config->get('lfm.allow_shared_folder') === true;
}

/**
Expand Down
68 changes: 17 additions & 51 deletions src/config/lfm.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,33 @@

'use_package_routes' => true,

// // Use relative paths (without domain)
// 'relative_paths' => false,

/*
|--------------------------------------------------------------------------
| Multi-User Mode
| Shared folder / Private folder
|--------------------------------------------------------------------------
|
| If both options are set to false, then shared folder will be activated.
|
*/

'allow_multi_user' => true,

'allow_share_folder' => true,

/*
|--------------------------------------------------------------------------
| Folder Names
|--------------------------------------------------------------------------
*/
'allow_private_folder' => true,

// Flexible way to customize client folders accessibility
// If you want to customize client folders, publish tag="lfm_handler"
// Then you can rewrite userField function in App\Handler\ConfigHandler class
// And set 'user_field' to App\Handler\ConfigHandler::class
// Ex: The private folder of user will be named as the user id.
'user_folder_name' => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,
'private_folder_name' => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,

'allow_shared_folder' => true,

'shared_folder_name' => 'shares',

'thumb_folder_name' => 'thumbs',
/*
|--------------------------------------------------------------------------
| Folder Names
|--------------------------------------------------------------------------
*/

'folder_categories' => [
'file' => [
Expand Down Expand Up @@ -94,15 +92,6 @@

'should_validate_mime' => false,

// permissions to be set when create a new folder or when it creates automatically with thumbnails
'create_folder_mode' => 0755,

// permissions to be set on file upload.
'create_file_mode' => 0644,

// If true, it will attempt to chmod the file after upload
'should_change_file_mode' => true,

// behavior on files with identical name
// setting it to true cause old file replace with new one
// setting it to false show `error-file-exist` error and stop upload
Expand All @@ -117,26 +106,18 @@
// If true, image thumbnails would be created during upload
'should_create_thumbnails' => true,

'thumb_folder_name' => 'thumbs',

// Create thumbnails automatically only for listed types.
'raster_mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
],

'thumb_img_width' => 200,
'thumb_img_width' => 200, // px

'thumb_img_height' => 200,

/*
|--------------------------------------------------------------------------
| jQuery UI options
|--------------------------------------------------------------------------
*/

'resize_aspectRatio' => false,

'resize_containment' => true,
'thumb_img_height' => 200, // px

/*
|--------------------------------------------------------------------------
Expand All @@ -159,21 +140,6 @@
'pptx' => 'Microsoft PowerPoint',
],

'file_icon_array' => [
'pdf' => 'fa-file-pdf-o',
'doc' => 'fa-file-word-o',
'docx' => 'fa-file-word-o',
'xls' => 'fa-file-excel-o',
'xlsx' => 'fa-file-excel-o',
'zip' => 'fa-file-archive-o',
'gif' => 'fa-file-image-o',
'jpg' => 'fa-file-image-o',
'jpeg' => 'fa-file-image-o',
'png' => 'fa-file-image-o',
'ppt' => 'fa-file-powerpoint-o',
'pptx' => 'fa-file-powerpoint-o',
],

/*
|--------------------------------------------------------------------------
| php.ini override
Expand Down
4 changes: 1 addition & 3 deletions src/views/resize.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@
renderResizedValues($("#width_display").val(), $("#height_display").val());
$("#resize").resizable({
aspectRatio: {{ config('lfm.resize_aspectRatio')?'true':'false' }},
@if(config('lfm.resize_containment'))
aspectRatio: true,
containment: "#containment",
@endif
handles: "n, e, s, w, se, sw, ne, nw",
resize: function (event, ui) {
renderResizedValues(ui.size.width, ui.size.height);
Expand Down
Loading

0 comments on commit 0d017dd

Please sign in to comment.