Skip to content

Commit

Permalink
Fix StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienheyd committed Mar 13, 2024
1 parent 7142bb3 commit de01985
Show file tree
Hide file tree
Showing 20 changed files with 128 additions and 128 deletions.
26 changes: 13 additions & 13 deletions src/Controllers/MediaManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public function __construct()
public function delete(Request $request)
{
$validation = Validator::make($request->all(), [
'path' => 'required',
'path' => 'required',
'files' => 'required',
]);

if ($validation->fails()) {
return response()->json([
'status' => 'error',
'error' => implode(' / ', (array) $validation->errors()),
'error' => implode(' / ', (array) $validation->errors()),
]);
}
$path = new Path($request->input('path'));
Expand Down Expand Up @@ -141,11 +141,11 @@ public function mce(Request $request)
}

$data = [
'type' => $request->input('type', 'all'),
'path' => $path ?? '/',
'field' => $request->input('field'),
'type' => $request->input('type', 'all'),
'path' => $path ?? '/',
'field' => $request->input('field'),
'return_type' => $request->input('return_type'),
'selected' => $selected,
'selected' => $selected,
];

return view('boilerplate-media-manager::index-mce', $data);
Expand Down Expand Up @@ -174,15 +174,15 @@ public function newFolder(Request $request)
public function paste(Request $request)
{
$validation = Validator::make($request->all(), [
'from' => 'required',
'files' => 'required',
'from' => 'required',
'files' => 'required',
'destination' => 'required',
]);

if ($validation->fails()) {
return response()->json([
'status' => 'error',
'error' => implode(' / ', (array) $validation->errors()),
'error' => implode(' / ', (array) $validation->errors()),
]);
}

Expand Down Expand Up @@ -212,10 +212,10 @@ public function rename(Request $request)
}

$validator = Validator::make($request->post(), [
'path' => 'required',
'type' => ['required', Rule::in(['folder', 'file'])],
'path' => 'required',
'type' => ['required', Rule::in(['folder', 'file'])],
'fileName' => 'required',
'newName' => 'required',
'newName' => 'required',
]);

if ($validator->fails()) {
Expand Down Expand Up @@ -255,7 +255,7 @@ public function upload(Request $request)
if ($validation->fails()) {
return response()->json([
'status' => 'error',
'error' => $validation->errors()->first('file'),
'error' => $validation->errors()->first('file'),
]);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Menu/BoilerplateMediaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public function make(Builder $menu)
{
$menu->add(__('boilerplate-media-manager::menu.medialibrary'), [
'permission' => 'media_manager',
'icon' => 'images',
'route' => 'mediamanager.index', ])
'icon' => 'images',
'route' => 'mediamanager.index', ])
->activeIfRoute('mediamanager.*')
->order(500);
}
Expand Down
14 changes: 7 additions & 7 deletions src/Models/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ public function toArray()
{
return [
'download' => '',
'isDir' => true,
'type' => 'folder',
'name' => basename($this->directory),
'size' => '-',
'link' => route('mediamanager.index', ['path' => $this->directory], false),
'url' => $this->storage->url($this->directory),
'time' => $this->getFileChangeTime(),
'isDir' => true,
'type' => 'folder',
'name' => basename($this->directory),
'size' => '-',
'link' => route('mediamanager.index', ['path' => $this->directory], false),
'url' => $this->storage->url($this->directory),
'time' => $this->getFileChangeTime(),
];
}

Expand Down
24 changes: 12 additions & 12 deletions src/Models/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,19 @@ public function toArray()
$ts = filemtime($this->getFullPath());

return [
'download' => '',
'icon' => $this->getIcon(),
'thumb' => $this->getThumbUrl().'?'.$ts,
'type' => $this->detectFileType(),
'name' => basename($this->file),
'filename' => $this->pathinfo['filename'],
'download' => '',
'icon' => $this->getIcon(),
'thumb' => $this->getThumbUrl().'?'.$ts,
'type' => $this->detectFileType(),
'name' => basename($this->file),
'filename' => $this->pathinfo['filename'],
'extension' => $this->pathinfo['extension'],
'isDir' => false,
'size' => $this->getFilesize(),
'link' => route('mediamanager.index', ['path' => $this->file], false),
'url' => $this->storage->url($this->file).'?'.$ts,
'time' => $this->getFileChangeTime(),
'ts' => $ts,
'isDir' => false,
'size' => $this->getFilesize(),
'link' => route('mediamanager.index', ['path' => $this->file], false),
'url' => $this->storage->url($this->file).'?'.$ts,
'time' => $this->getFileChangeTime(),
'ts' => $ts,
];
}

Expand Down
6 changes: 3 additions & 3 deletions src/Models/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private function formatDirectories($dirs = [])
/**
* Create a new folder in the current path.
*
* @param $name
* @param $name
*/
public function newFolder($name)
{
Expand Down Expand Up @@ -207,7 +207,7 @@ public function upload($file, $fileName = null)
/**
* Delete a folder or a file in the current path.
*
* @param $name
* @param $name
* @return bool
*/
public function delete($name)
Expand Down Expand Up @@ -236,7 +236,7 @@ public function delete($name)
/**
* Get relative path from root.
*
* @param $path
* @param $path
* @return mixed|string
*/
private function getRelativePath($path)
Expand Down
54 changes: 27 additions & 27 deletions src/config/mediamanager.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

return [
'base_url' => '/storage',
'base_url' => '/storage',
'tinymce_upload_dir' => 'edition',
'thumbs_dir' => 'thumbs',
'hide_thumbs_dir' => true,
'authorized' => [
'size' => '2048',
'thumbs_dir' => 'thumbs',
'hide_thumbs_dir' => true,
'authorized' => [
'size' => '2048',
'mimes' => [// @see https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
'jpg',
'jpeg',
Expand Down Expand Up @@ -34,32 +34,32 @@
'wmv',
],
],
'filetypes' => [// Recognized filetypes
'image' => 'png|jpg|jpeg|gif|svg',
'word' => 'doc|docx|odt',
'excel' => 'xls|xlsx|ods',
'ppt' => 'ppt|pptx',
'pdf' => 'pdf',
'code' => 'php|js|java|python|ruby|go|c|cpp|sql|m|h|json|html|aspx',
'filetypes' => [// Recognized filetypes
'image' => 'png|jpg|jpeg|gif|svg',
'word' => 'doc|docx|odt',
'excel' => 'xls|xlsx|ods',
'ppt' => 'ppt|pptx',
'pdf' => 'pdf',
'code' => 'php|js|java|python|ruby|go|c|cpp|sql|m|h|json|html|aspx',
'archive' => 'zip|tar\.gz|rar|rpm',
'txt' => 'txt|pac|log|md',
'audio' => 'mp3|wav|flac|3pg|aa|aac|ape|au|m4a|mpc|ogg',
'video' => 'mkv|rmvb|flv|mp4|avi|wmv|rm|asf|mpeg',
'txt' => 'txt|pac|log|md',
'audio' => 'mp3|wav|flac|3pg|aa|aac|ape|au|m4a|mpc|ogg',
'video' => 'mkv|rmvb|flv|mp4|avi|wmv|rm|asf|mpeg',
],
'icons' => [// Icons linked to filetypes
'file' => 'file', // default
'image' => 'file-image',
'word' => 'file-word',
'excel' => 'file-excel',
'ppt' => 'file-powerpoint',
'pdf' => 'file-pdf',
'code' => 'file-code',
'icons' => [// Icons linked to filetypes
'file' => 'file', // default
'image' => 'file-image',
'word' => 'file-word',
'excel' => 'file-excel',
'ppt' => 'file-powerpoint',
'pdf' => 'file-pdf',
'code' => 'file-code',
'archive' => 'file-zip',
'txt' => 'file-text',
'audio' => 'file-audio',
'video' => 'file-video',
'txt' => 'file-text',
'audio' => 'file-audio',
'video' => 'file-video',
],
'filter' => [
'filter' => [
'.gitignore',
'.git',
'.htaccess',
Expand Down
8 changes: 4 additions & 4 deletions src/migrations/2019_02_18_171649_permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class Permission extends Migration
public function up()
{
DB::table('permissions')->insert([
'name' => 'media_manager',
'name' => 'media_manager',
'display_name' => 'boilerplate-media-manager::permissions.media_manager.display_name',
'description' => 'boilerplate-media-manager::permissions.media_manager.description',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'description' => 'boilerplate-media-manager::permissions.media_manager.description',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/lang/en/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

return [
'notfound' => 'The folder does not exist',
'back' => 'Back to the root folder',
'back' => 'Back to the root folder',
];
8 changes: 4 additions & 4 deletions src/resources/lang/en/list.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

return [
'name' => 'Name',
'weight' => 'Weight',
'type' => 'Type',
'date' => 'Date',
'name' => 'Name',
'weight' => 'Weight',
'type' => 'Type',
'date' => 'Date',
'nocontent' => 'No content for the moment, click on upload to add medias',
];
16 changes: 8 additions & 8 deletions src/resources/lang/en/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

return [
'medialibrary' => 'Media library',
'medialist' => 'Media listing',
'view' => 'View',
'rename' => 'Rename',
'delete' => 'Delete',
'upload' => 'Upload',
'newFolder' => 'New folder',
'paste' => 'Move here',
'cancel' => 'Cancel',
'medialist' => 'Media listing',
'view' => 'View',
'rename' => 'Rename',
'delete' => 'Delete',
'upload' => 'Upload',
'newFolder' => 'New folder',
'paste' => 'Move here',
'cancel' => 'Cancel',
];
6 changes: 3 additions & 3 deletions src/resources/lang/en/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
'success' => 'The deletion has been completed',
],
'folder' => [
'name' => 'Name of the folder',
'name' => 'Name of the folder',
'success' => 'The folder has been created',
],
'rename' => [
'title' => 'Rename',
'title' => 'Rename',
'success' => 'The renaming has been done',
],
'upload' => [
'success' => 'The upload is complete',
],
'paste' => [
'success' => 'Item(s) successfully moved',
'files' => 'item(s) selected',
'files' => 'item(s) selected',
],
'deletemedia' => 'Remove image ?',
];
2 changes: 1 addition & 1 deletion src/resources/lang/en/permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
return [
'media_manager' => [
'display_name' => 'Media manager',
'description' => 'User can access to the media manager and manage medias',
'description' => 'User can access to the media manager and manage medias',
],
];
22 changes: 11 additions & 11 deletions src/resources/lang/en/types.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

return [
'folder' => 'folder',
'file' => 'file',
'image' => 'image',
'word' => 'word',
'excel' => 'excel',
'ppt' => 'powerpoint',
'pdf' => 'pdf',
'code' => 'text',
'folder' => 'folder',
'file' => 'file',
'image' => 'image',
'word' => 'word',
'excel' => 'excel',
'ppt' => 'powerpoint',
'pdf' => 'pdf',
'code' => 'text',
'archive' => 'archive',
'txt' => 'text',
'audio' => 'audio',
'video' => 'video',
'txt' => 'text',
'audio' => 'audio',
'video' => 'video',
];
2 changes: 1 addition & 1 deletion src/resources/lang/fr/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

return [
'notfound' => "Le dossier n'existe pas",
'back' => 'Revenir au dossier racine',
'back' => 'Revenir au dossier racine',
];
8 changes: 4 additions & 4 deletions src/resources/lang/fr/list.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

return [
'name' => 'Nom',
'weight' => 'Poids',
'type' => 'Type',
'date' => 'Date',
'name' => 'Nom',
'weight' => 'Poids',
'type' => 'Type',
'date' => 'Date',
'nocontent' => 'Aucun contenu pour le moment, cliquez sur télécharger pour ajouter des médias',
];
16 changes: 8 additions & 8 deletions src/resources/lang/fr/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

return [
'medialibrary' => 'Médiathèque',
'medialist' => 'Liste des médias',
'view' => 'Voir',
'rename' => 'Renommer',
'delete' => 'Supprimer',
'upload' => 'Télécharger',
'newFolder' => 'Nouveau dossier',
'paste' => 'Déplacer ici',
'cancel' => 'Annuler',
'medialist' => 'Liste des médias',
'view' => 'Voir',
'rename' => 'Renommer',
'delete' => 'Supprimer',
'upload' => 'Télécharger',
'newFolder' => 'Nouveau dossier',
'paste' => 'Déplacer ici',
'cancel' => 'Annuler',
];
Loading

0 comments on commit de01985

Please sign in to comment.