laravel-6 support

This commit is contained in:
RafficMohammed
2023-01-08 01:17:22 +05:30
parent 1a5c16ae4b
commit 774eed8b0e
4962 changed files with 279380 additions and 297961 deletions

View File

@@ -6,9 +6,6 @@ use Intervention\Image\Facades\Image;
use UniSharp\LaravelFilemanager\Events\ImageIsCropping;
use UniSharp\LaravelFilemanager\Events\ImageWasCropped;
/**
* Class CropController.
*/
class CropController extends LfmController
{
/**
@@ -18,11 +15,11 @@ class CropController extends LfmController
*/
public function getCrop()
{
$working_dir = request('working_dir');
$img = parent::objectPresenter(parent::getCurrentPath(request('img')));
return view('laravel-filemanager::crop')
->with(compact('working_dir', 'img'));
->with([
'working_dir' => request('working_dir'),
'img' => $this->lfm->pretty(request('img'))
]);
}
/**
@@ -30,34 +27,27 @@ class CropController extends LfmController
*/
public function getCropimage($overWrite = true)
{
$dataX = request('dataX');
$dataY = request('dataY');
$dataHeight = request('dataHeight');
$dataWidth = request('dataWidth');
$image_path = parent::getCurrentPath(request('img'));
$image_name = request('img');
$image_path = $this->lfm->setName($image_name)->path('absolute');
$crop_path = $image_path;
if (! $overWrite) {
$fileParts = explode('.', request('img'));
$fileParts = explode('.', $image_name);
$fileParts[count($fileParts) - 2] = $fileParts[count($fileParts) - 2] . '_cropped_' . time();
$crop_path = parent::getCurrentPath(implode('.', $fileParts));
$crop_path = $this->lfm->setName(implode('.', $fileParts))->path('absolute');
}
event(new ImageIsCropping($image_path));
$crop_info = request()->only('dataWidth', 'dataHeight', 'dataX', 'dataY');
// crop image
Image::make($image_path)
->crop($dataWidth, $dataHeight, $dataX, $dataY)
->crop(...array_values($crop_info))
->save($crop_path);
if (config('lfm.should_create_thumbnails', true)) {
// create thumb folder
parent::createFolderByPath(parent::getThumbPath());
// make new thumbnail
Image::make($crop_path)
->fit(config('lfm.thumb_img_width', 200), config('lfm.thumb_img_height', 200))
->save(parent::getThumbPath(parent::getName($crop_path)));
}
// make new thumbnail
$this->lfm->generateThumbnail($image_name);
event(new ImageWasCropped($image_path));
}

View File

@@ -2,13 +2,14 @@
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use UniSharp\LaravelFilemanager\Events\FileIsDeleting;
use UniSharp\LaravelFilemanager\Events\FileWasDeleted;
use UniSharp\LaravelFilemanager\Events\FolderIsDeleting;
use UniSharp\LaravelFilemanager\Events\FolderWasDeleted;
use UniSharp\LaravelFilemanager\Events\ImageIsDeleting;
use UniSharp\LaravelFilemanager\Events\ImageWasDeleted;
/**
* Class CropController.
*/
class DeleteController extends LfmController
{
/**
@@ -18,39 +19,61 @@ class DeleteController extends LfmController
*/
public function getDelete()
{
$name_to_delete = request('items');
$item_names = request('items');
$errors = [];
$file_to_delete = parent::getCurrentPath($name_to_delete);
$thumb_to_delete = parent::getThumbPath($name_to_delete);
foreach ($item_names as $name_to_delete) {
$file = $this->lfm->setName($name_to_delete);
event(new ImageIsDeleting($file_to_delete));
if (is_null($name_to_delete)) {
return parent::error('folder-name');
}
if (! File::exists($file_to_delete)) {
return parent::error('folder-not-found', ['folder' => $file_to_delete]);
}
if (File::isDirectory($file_to_delete)) {
if (! parent::directoryIsEmpty($file_to_delete)) {
return parent::error('delete-folder');
if ($file->isDirectory()) {
event(new FolderIsDeleting($file->path('absolute')));
} else {
event(new FileIsDeleting($file->path('absolute')));
event(new ImageIsDeleting($file->path('absolute')));
}
File::deleteDirectory($file_to_delete);
if (!Storage::disk($this->helper->config('disk'))->exists($file->path('storage'))) {
abort(404);
}
return parent::$success_response;
$file_to_delete = $this->lfm->pretty($name_to_delete);
$file_path = $file_to_delete->path('absolute');
if (is_null($name_to_delete)) {
array_push($errors, parent::error('folder-name'));
continue;
}
if (! $this->lfm->setName($name_to_delete)->exists()) {
array_push($errors, parent::error('folder-not-found', ['folder' => $file_path]));
continue;
}
if ($this->lfm->setName($name_to_delete)->isDirectory()) {
if (! $this->lfm->setName($name_to_delete)->directoryIsEmpty()) {
array_push($errors, parent::error('delete-folder'));
continue;
}
$this->lfm->setName($name_to_delete)->delete();
event(new FolderWasDeleted($file_path));
} else {
if ($file_to_delete->isImage()) {
$this->lfm->setName($name_to_delete)->thumb()->delete();
}
$this->lfm->setName($name_to_delete)->delete();
event(new FileWasDeleted($file_path));
event(new ImageWasDeleted($file_path));
}
}
if (parent::fileIsImage($file_to_delete)) {
File::delete($thumb_to_delete);
if (count($errors) > 0) {
return $errors;
}
File::delete($file_to_delete);
event(new ImageWasDeleted($file_to_delete));
return parent::$success_response;
}
}

View File

@@ -2,14 +2,8 @@
namespace UniSharp\LaravelFilemanager\Controllers;
/**
* Class DemoController.
*/
class DemoController extends LfmController
{
/**
* @return mixed
*/
public function index()
{
return view('laravel-filemanager::demo');

View File

@@ -2,18 +2,18 @@
namespace UniSharp\LaravelFilemanager\Controllers;
/**
* Class DownloadController.
*/
use Illuminate\Support\Facades\Storage;
class DownloadController extends LfmController
{
/**
* Download a file.
*
* @return mixed
*/
public function getDownload()
{
return response()->download(parent::getCurrentPath(request('file')));
$file = $this->lfm->setName(request('file'));
if (!Storage::disk($this->helper->config('disk'))->exists($file->path('storage'))) {
abort(404);
}
return response()->download($file->path('absolute'));
}
}

View File

@@ -2,11 +2,9 @@
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Support\Facades\File;
use UniSharp\LaravelFilemanager\Events\FolderIsCreating;
use UniSharp\LaravelFilemanager\Events\FolderWasCreated;
/**
* Class FolderController.
*/
class FolderController extends LfmController
{
/**
@@ -16,35 +14,23 @@ class FolderController extends LfmController
*/
public function getFolders()
{
$folder_types = [];
$root_folders = [];
if (parent::allowMultiUser()) {
$folder_types['user'] = 'root';
}
if (parent::allowShareFolder()) {
$folder_types['share'] = 'shares';
}
foreach ($folder_types as $folder_type => $lang_key) {
$root_folder_path = parent::getRootFolderPath($folder_type);
$children = parent::getDirectories($root_folder_path);
usort($children, function ($a, $b) {
return strcmp($a->name, $b->name);
});
array_push($root_folders, (object) [
'name' => trans('laravel-filemanager::lfm.title-' . $lang_key),
'path' => parent::getInternalPath($root_folder_path),
'children' => $children,
'has_next' => ! ($lang_key == end($folder_types)),
]);
}
$folder_types = array_filter(['user', 'share'], function ($type) {
return $this->helper->allowFolderType($type);
});
return view('laravel-filemanager::tree')
->with(compact('root_folders'));
->with([
'root_folders' => array_map(function ($type) use ($folder_types) {
$path = $this->lfm->dir($this->helper->getRootFolder($type));
return (object) [
'name' => trans('laravel-filemanager::lfm.title-' . $type),
'url' => $path->path('working_dir'),
'children' => $path->folders(),
'has_next' => ! ($type == end($folder_types)),
];
}, $folder_types),
]);
}
/**
@@ -54,22 +40,28 @@ class FolderController extends LfmController
*/
public function getAddfolder()
{
$folder_name = parent::translateFromUtf8(trim(request('name')));
$path = parent::getCurrentPath($folder_name);
$folder_name = $this->helper->input('name');
if (empty($folder_name)) {
return parent::error('folder-name');
$new_path = $this->lfm->setName($folder_name)->path('absolute');
event(new FolderIsCreating($new_path));
try {
if ($folder_name === null || $folder_name == '') {
return $this->helper->error('folder-name');
} elseif ($this->lfm->setName($folder_name)->exists()) {
return $this->helper->error('folder-exist');
} elseif (config('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $folder_name)) {
return $this->helper->error('folder-alnum');
} else {
$this->lfm->setName($folder_name)->createFolder();
}
} catch (\Exception $e) {
return $e->getMessage();
}
if (File::exists($path)) {
return parent::error('folder-exist');
}
event(new FolderWasCreated($new_path));
if (config('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $folder_name)) {
return parent::error('folder-alnum');
}
parent::createFolderByPath($path);
return parent::$success_response;
}
}

View File

@@ -2,9 +2,12 @@
namespace UniSharp\LaravelFilemanager\Controllers;
/**
* Class ItemsController.
*/
use Illuminate\Support\Facades\Storage;
use UniSharp\LaravelFilemanager\Events\FileIsMoving;
use UniSharp\LaravelFilemanager\Events\FileWasMoving;
use UniSharp\LaravelFilemanager\Events\FolderIsMoving;
use UniSharp\LaravelFilemanager\Events\FolderWasMoving;
class ItemsController extends LfmController
{
/**
@@ -14,47 +17,90 @@ class ItemsController extends LfmController
*/
public function getItems()
{
$path = parent::getCurrentPath();
$sort_type = request('sort_type');
$currentPage = self::getCurrentPageFromRequest();
$files = parent::sortFilesAndDirectories(parent::getFilesWithInfo($path), $sort_type);
$directories = parent::sortFilesAndDirectories(parent::getDirectories($path), $sort_type);
$perPage = $this->helper->getPaginationPerPage();
$items = array_merge($this->lfm->folders(), $this->lfm->files());
return [
'html' => (string) view($this->getView())->with([
'files' => $files,
'directories' => $directories,
'items' => array_merge($directories, $files),
]),
'working_dir' => parent::getInternalPath($path),
'items' => array_map(function ($item) {
return $item->fill()->attributes;
}, array_slice($items, ($currentPage - 1) * $perPage, $perPage)),
'paginator' => [
'current_page' => $currentPage,
'total' => count($items),
'per_page' => $perPage,
],
'display' => $this->helper->getDisplayMode(),
'working_dir' => $this->lfm->path('working_dir'),
];
}
private function getView()
public function move()
{
$view_type = request('show_list');
$items = request('items');
$folder_types = array_filter(['user', 'share'], function ($type) {
return $this->helper->allowFolderType($type);
});
return view('laravel-filemanager::move')
->with([
'root_folders' => array_map(function ($type) use ($folder_types) {
$path = $this->lfm->dir($this->helper->getRootFolder($type));
if (null === $view_type) {
return $this->composeViewName($this->getStartupViewFromConfig());
}
$view_mapping = [
'0' => 'grid',
'1' => 'list'
];
return $this->composeViewName($view_mapping[$view_type]);
return (object) [
'name' => trans('laravel-filemanager::lfm.title-' . $type),
'url' => $path->path('working_dir'),
'children' => $path->folders(),
'has_next' => ! ($type == end($folder_types)),
];
}, $folder_types),
])
->with('items', $items);
}
private function composeViewName($view_type = 'grid')
public function domove()
{
return "laravel-filemanager::$view_type-view";
$target = $this->helper->input('goToFolder');
$items = $this->helper->input('items');
foreach ($items as $item) {
$old_file = $this->lfm->pretty($item);
$is_directory = $old_file->isDirectory();
$file = $this->lfm->setName($item);
if (!Storage::disk($this->helper->config('disk'))->exists($file->path('storage'))) {
abort(404);
}
$old_path = $old_file->path();
if ($old_file->hasThumb()) {
$new_file = $this->lfm->setName($item)->thumb()->dir($target);
if ($is_directory) {
event(new FolderIsMoving($old_file->path(), $new_file->path()));
} else {
event(new FileIsMoving($old_file->path(), $new_file->path()));
}
$this->lfm->setName($item)->thumb()->move($new_file);
}
$new_file = $this->lfm->setName($item)->dir($target);
$this->lfm->setName($item)->move($new_file);
if ($is_directory) {
event(new FolderWasMoving($old_path, $new_file->path()));
} else {
event(new FileWasMoving($old_path, $new_file->path()));
}
};
return parent::$success_response;
}
private function getStartupViewFromConfig($default = 'grid')
private static function getCurrentPageFromRequest()
{
$type_key = parent::currentLfmType();
$startup_view = config('lfm.' . $type_key . 's_startup_view', $default);
return $startup_view;
$currentPage = (int) request()->get('page', 1);
$currentPage = $currentPage < 1 ? 1 : $currentPage;
return $currentPage;
}
}

View File

@@ -2,15 +2,11 @@
namespace UniSharp\LaravelFilemanager\Controllers;
use UniSharp\LaravelFilemanager\Traits\LfmHelpers;
use UniSharp\LaravelFilemanager\Lfm;
use UniSharp\LaravelFilemanager\LfmPath;
/**
* Class LfmController.
*/
class LfmController extends Controller
{
use LfmHelpers;
protected static $success_response = 'OK';
public function __construct()
@@ -18,6 +14,20 @@ class LfmController extends Controller
$this->applyIniOverrides();
}
/**
* Set up needed functions.
*
* @return object|null
*/
public function __get($var_name)
{
if ($var_name === 'lfm') {
return app(LfmPath::class);
} elseif ($var_name === 'helper') {
return app(Lfm::class);
}
}
/**
* Show the filemanager.
*
@@ -25,9 +35,15 @@ class LfmController extends Controller
*/
public function show()
{
return view('laravel-filemanager::index');
return view('laravel-filemanager::index')
->withHelper($this->helper);
}
/**
* Check if any extension or config is missing.
*
* @return array
*/
public function getErrors()
{
$arr_errors = [];
@@ -36,14 +52,42 @@ class LfmController extends Controller
array_push($arr_errors, trans('laravel-filemanager::lfm.message-extension_not_found'));
}
$type_key = $this->currentLfmType();
$mine_config = 'lfm.valid_' . $type_key . '_mimetypes';
$config_error = null;
if (! extension_loaded('exif')) {
array_push($arr_errors, 'EXIF extension not found.');
}
if (! is_array(config($mine_config))) {
array_push($arr_errors, 'Config : ' . $mine_config . ' is not a valid array.');
if (! extension_loaded('fileinfo')) {
array_push($arr_errors, 'Fileinfo extension not found.');
}
$mine_config_key = 'lfm.folder_categories.'
. $this->helper->currentLfmType()
. '.valid_mime';
if (! is_array(config($mine_config_key))) {
array_push($arr_errors, 'Config : ' . $mine_config_key . ' is not a valid array.');
}
return $arr_errors;
}
/**
* Overrides settings in php.ini.
*
* @return null
*/
public function applyIniOverrides()
{
$overrides = config('lfm.php_ini_overrides', []);
if ($overrides && is_array($overrides) && count($overrides) === 0) {
return;
}
foreach ($overrides as $key => $value) {
if ($value && $value != 'false') {
ini_set($key, $value);
}
}
}
}

View File

@@ -2,64 +2,19 @@
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
/**
* Class RedirectController.
*/
class RedirectController extends LfmController
{
private $file_path;
public function __construct()
public function showFile($file_path)
{
$delimiter = config('lfm.url_prefix', config('lfm.prefix')). '/';
$url = urldecode(request()->url());
$external_path = substr($url, strpos($url, $delimiter) + strlen($delimiter));
$storage = Storage::disk($this->helper->config('disk'));
$this->file_path = base_path(config('lfm.base_directory', 'public') . '/' . $external_path);
}
/**
* Get image from custom directory by route.
*
* @param string $image_path
* @return string
*/
public function getImage($base_path, $image_name)
{
return $this->responseImageOrFile();
}
/**
* Get file from custom directory by route.
*
* @param string $file_name
* @return string
*/
public function getFile(Request $request, $base_path, $file_name)
{
$request->request->add(['type' => 'Files']);
return $this->responseImageOrFile();
}
private function responseImageOrFile()
{
$file_path = $this->file_path;
if (! File::exists($file_path)) {
if (! $storage->exists($file_path)) {
abort(404);
}
$file = File::get($file_path);
$type = parent::getFileType($file_path);
$response = Response::make($file);
$response->header('Content-Type', $type);
return $response;
return response($storage->get($file_path))
->header('Content-Type', $storage->mimeType($file_path));
}
}

View File

@@ -2,86 +2,79 @@
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Support\Facades\File;
use UniSharp\LaravelFilemanager\Events\ImageIsRenaming;
use UniSharp\LaravelFilemanager\Events\ImageWasRenamed;
use Illuminate\Support\Facades\Storage;
use UniSharp\LaravelFilemanager\Events\FolderIsRenaming;
use UniSharp\LaravelFilemanager\Events\FolderWasRenamed;
use UniSharp\LaravelFilemanager\Events\FileIsRenaming;
use UniSharp\LaravelFilemanager\Events\FileWasRenamed;
use UniSharp\LaravelFilemanager\Events\ImageIsRenaming;
use UniSharp\LaravelFilemanager\Events\ImageWasRenamed;
/**
* Class RenameController.
*/
class RenameController extends LfmController
{
/**
* @return string
*/
public function getRename()
{
$old_name = parent::translateFromUtf8(request('file'));
$new_name = parent::translateFromUtf8(trim(request('new_name')));
$old_name = $this->helper->input('file');
$new_name = $this->helper->input('new_name');
$old_file = parent::getCurrentPath($old_name);
if (File::isDirectory($old_file)) {
return $this->renameDirectory($old_name, $new_name);
} else {
return $this->renameFile($old_name, $new_name);
$file = $this->lfm->setName($old_name);
if (!Storage::disk($this->helper->config('disk'))->exists($file->path('storage'))) {
abort(404);
}
}
protected function renameDirectory($old_name, $new_name)
{
$old_file = $this->lfm->pretty($old_name);
$is_directory = $file->isDirectory();
if (empty($new_name)) {
return parent::error('folder-name');
if ($is_directory) {
return parent::error('folder-name');
} else {
return parent::error('file-name');
}
}
$old_file = parent::getCurrentPath($old_name);
$new_file = parent::getCurrentPath($new_name);
event(new FolderIsRenaming($old_file, $new_file));
if (config('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $new_name)) {
if ($is_directory && config('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $new_name)) {
return parent::error('folder-alnum');
}
if (File::exists($new_file)) {
return parent::error('rename');
}
File::move($old_file, $new_file);
event(new FolderWasRenamed($old_file, $new_file));
return parent::$success_response;
}
protected function renameFile($old_name, $new_name)
{
if (empty($new_name)) {
return parent::error('file-name');
}
$old_file = parent::getCurrentPath($old_name);
$extension = File::extension($old_file);
$new_file = parent::getCurrentPath(basename($new_name, ".$extension") . ".$extension");
if (config('lfm.alphanumeric_filename') && preg_match('/[^\w-.]/i', $new_name)) {
} elseif (config('lfm.alphanumeric_filename') && preg_match('/[^.\w-]/i', $new_name)) {
return parent::error('file-alnum');
}
// TODO Should be "FileIsRenaming"
event(new ImageIsRenaming($old_file, $new_file));
if (File::exists($new_file)) {
} elseif ($this->lfm->setName($new_name)->exists()) {
return parent::error('rename');
}
if (parent::fileIsImage($old_file) && File::exists(parent::getThumbPath($old_name))) {
File::move(parent::getThumbPath($old_name), parent::getThumbPath($new_name));
if (! $is_directory) {
$extension = $old_file->extension();
if ($extension) {
$new_name = str_replace('.' . $extension, '', $new_name) . '.' . $extension;
}
}
File::move($old_file, $new_file);
// TODO Should be "FileWasRenamed"
event(new ImageWasRenamed($old_file, $new_file));
$new_path = $this->lfm->setName($new_name)->path('absolute');
if ($is_directory) {
event(new FolderIsRenaming($old_file->path(), $new_path));
} else {
event(new FileIsRenaming($old_file->path(), $new_path));
event(new ImageIsRenaming($old_file->path(), $new_path));
}
$old_path = $old_file->path();
if ($old_file->hasThumb()) {
$this->lfm->setName($old_name)->thumb()
->move($this->lfm->setName($new_name)->thumb());
}
$this->lfm->setName($old_name)
->move($this->lfm->setName($new_name));
if ($is_directory) {
event(new FolderWasRenamed($old_path, $new_path));
} else {
event(new FileWasRenamed($old_path, $new_path));
event(new ImageWasRenamed($old_path, $new_path));
}
return parent::$success_response;
}

View File

@@ -6,9 +6,6 @@ use Intervention\Image\Facades\Image;
use UniSharp\LaravelFilemanager\Events\ImageIsResizing;
use UniSharp\LaravelFilemanager\Events\ImageWasResized;
/**
* Class ResizeController.
*/
class ResizeController extends LfmController
{
/**
@@ -21,7 +18,7 @@ class ResizeController extends LfmController
$ratio = 1.0;
$image = request('img');
$original_image = Image::make(parent::getCurrentPath($image));
$original_image = Image::make($this->lfm->setName($image)->path('absolute'));
$original_width = $original_image->width();
$original_height = $original_image->height();
@@ -46,7 +43,7 @@ class ResizeController extends LfmController
}
return view('laravel-filemanager::resize')
->with('img', parent::objectPresenter(parent::getCurrentPath($image)))
->with('img', $this->lfm->pretty($image))
->with('height', number_format($height, 0))
->with('width', $width)
->with('original_height', $original_height)
@@ -57,14 +54,10 @@ class ResizeController extends LfmController
public function performResize()
{
$dataX = request('dataX');
$dataY = request('dataY');
$height = request('dataHeight');
$width = request('dataWidth');
$image_path = parent::getCurrentPath(request('img'));
$image_path = $this->lfm->setName(request('img'))->path('absolute');
event(new ImageIsResizing($image_path));
Image::make($image_path)->resize($width, $height)->save();
Image::make($image_path)->resize(request('dataWidth'), request('dataHeight'))->save();
event(new ImageWasResized($image_path));
return parent::$success_response;

View File

@@ -2,16 +2,10 @@
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Support\Facades\File;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Log;
use Intervention\Image\Facades\Image;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use UniSharp\LaravelFilemanager\Events\ImageIsUploading;
use UniSharp\LaravelFilemanager\Events\ImageWasUploaded;
use UniSharp\LaravelFilemanager\Lfm;
/**
* Class UploadController.
*/
class UploadController extends LfmController
{
protected $errors;
@@ -26,211 +20,47 @@ class UploadController extends LfmController
* Upload files
*
* @param void
* @return string
*
* @return JsonResponse
*/
public function upload()
{
$files = request()->file('upload');
$uploaded_files = request()->file('upload');
$error_bag = [];
$new_filename = null;
// single file
if (!is_array($files)) {
$file = $files;
if (!$this->fileIsValid($file)) {
return $this->errors;
foreach (is_array($uploaded_files) ? $uploaded_files : [$uploaded_files] as $file) {
try {
$this->lfm->validateUploadedFile($file);
$new_filename = $this->lfm->upload($file);
} catch (\Exception $e) {
Log::error($e->getMessage(), [
'file' => $e->getFile(),
'line' => $e->getLine(),
'trace' => $e->getTraceAsString()
]);
array_push($error_bag, $e->getMessage());
}
$filename = $this->proceedSingleUpload($file);
if ($filename === false) {
return $this->errors;
}
// upload via ckeditor 'Upload' tab
return $this->useFile($filename);
}
// Multiple files
foreach ($files as $file) {
if (!$this->fileIsValid($file)) {
continue;
}
$this->proceedSingleUpload($file);
}
return count($this->errors) > 0 ? $this->errors : parent::$success_response;
}
private function proceedSingleUpload($file)
{
$new_filename = $this->getNewName($file);
$new_file_path = parent::getCurrentPath($new_filename);
event(new ImageIsUploading($new_file_path));
try {
if (parent::fileIsImage($file) && !in_array($file->getMimeType(), ['image/gif', 'image/svg+xml'])) {
// Handle image rotation
Image::make($file->getRealPath())
->orientate() //Apply orientation from exif data
->save($new_file_path);
// Generate a thumbnail
if (parent::imageShouldHaveThumb($file)) {
$this->makeThumb($new_filename);
}
if (is_array($uploaded_files)) {
$response = count($error_bag) > 0 ? $error_bag : parent::$success_response;
} else { // upload via ckeditor5 expects json responses
if (is_null($new_filename)) {
$response = [
'error' => [ 'message' => $error_bag[0] ]
];
} else {
// Create (move) the file
File::move($file->getRealPath(), $new_file_path);
}
if (config('lfm.should_change_file_mode', true)) {
chmod($new_file_path, config('lfm.create_file_mode', 0644));
}
} catch (\Exception $e) {
array_push($this->errors, parent::error('invalid'));
$url = $this->lfm->setName($new_filename)->url();
Log::error($e->getMessage(), [
'file' => $e->getFile(),
'line' => $e->getLine(),
'trace' => $e->getTraceAsString()
]);
return false;
}
// TODO should be "FileWasUploaded"
event(new ImageWasUploaded(realpath($new_file_path)));
return $new_filename;
}
private function fileIsValid($file)
{
if (empty($file)) {
array_push($this->errors, parent::error('file-empty'));
return false;
}
if (! $file instanceof UploadedFile) {
array_push($this->errors, parent::error('instance'));
return false;
}
if ($file->getError() == UPLOAD_ERR_INI_SIZE) {
$max_size = ini_get('upload_max_filesize');
array_push($this->errors, parent::error('file-size', ['max' => $max_size]));
return false;
}
if ($file->getError() != UPLOAD_ERR_OK) {
$msg = 'File failed to upload. Error code: ' . $file->getError();
array_push($this->errors, $msg);
return false;
}
$new_filename = $this->getNewName($file);
if (File::exists(parent::getCurrentPath($new_filename))) {
array_push($this->errors, parent::error('file-exist'));
return false;
}
$mimetype = $file->getMimeType();
// Bytes to KB
$file_size = $file->getSize() / 1024;
$type_key = parent::currentLfmType();
if (config('lfm.should_validate_mime', false)) {
$mine_config = 'lfm.valid_' . $type_key . '_mimetypes';
$valid_mimetypes = config($mine_config, []);
if (false === in_array($mimetype, $valid_mimetypes)) {
array_push($this->errors, parent::error('mime') . $mimetype);
return false;
$response = [
'url' => $url,
'uploaded' => $url
];
}
}
if (config('lfm.should_validate_size', false)) {
$max_size = config('lfm.max_' . $type_key . '_size', 0);
if ($file_size > $max_size) {
array_push($this->errors, parent::error('size'));
return false;
}
}
return true;
}
protected function replaceInsecureSuffix($name)
{
return preg_replace("/\.php$/i", '', $name);
}
private function getNewName($file)
{
$new_filename = parent::translateFromUtf8(trim($this->pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME)));
if (config('lfm.rename_file') === true) {
$new_filename = uniqid();
} elseif (config('lfm.alphanumeric_filename') === true) {
$new_filename = preg_replace('/[^A-Za-z0-9\-\']/', '_', $new_filename);
}
return $new_filename . $this->replaceInsecureSuffix('.' . $file->getClientOriginalExtension());
}
private function makeThumb($new_filename)
{
// create thumb folder
parent::createFolderByPath(parent::getThumbPath());
// create thumb image
Image::make(parent::getCurrentPath($new_filename))
->fit(config('lfm.thumb_img_width', 200), config('lfm.thumb_img_height', 200))
->save(parent::getThumbPath($new_filename));
}
private function useFile($new_filename)
{
$file = parent::getFileUrl($new_filename);
$responseType = request()->input('responseType');
if ($responseType && $responseType == 'json') {
return [
"uploaded" => 1,
"fileName" => $new_filename,
"url" => $file,
];
}
return "<script type='text/javascript'>
function getUrlParam(paramName) {
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i');
var match = window.location.search.match(reParam);
return ( match && match.length > 1 ) ? match[1] : null;
}
var funcNum = getUrlParam('CKEditorFuncNum');
var par = window.parent,
op = window.opener,
o = (par && par.CKEDITOR) ? par : ((op && op.CKEDITOR) ? op : false);
if (op) window.close();
if (o !== false) o.CKEDITOR.tools.callFunction(funcNum, '$file');
</script>";
}
private function pathinfo($path, $options = null)
{
$path = urlencode($path);
$parts = is_null($options) ? pathinfo($path) : pathinfo($path, $options);
if (is_array($parts)) {
foreach ($parts as $field => $value) {
$parts[$field] = urldecode($value);
}
} else {
$parts = urldecode($parts);
}
return $parts;
return response()->json($response);
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FileIsDeleting
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FileIsMoving
{
private $old_path;
private $new_path;
public function __construct($old_path, $new_path)
{
$this->old_path = $old_path;
$this->new_path = $new_path;
}
/**
* @return string
*/
public function oldPath()
{
return $this->old_path;
}
public function newPath()
{
return $this->new_path;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FileIsRenaming
{
private $old_path;
private $new_path;
public function __construct($old_path, $new_path)
{
$this->old_path = $old_path;
$this->new_path = $new_path;
}
/**
* @return string
*/
public function oldPath()
{
return $this->old_path;
}
public function newPath()
{
return $this->new_path;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FileIsUploading
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FileWasDeleted
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FileWasMoving
{
private $old_path;
private $new_path;
public function __construct($old_path, $new_path)
{
$this->old_path = $old_path;
$this->new_path = $new_path;
}
/**
* @return string
*/
public function oldPath()
{
return $this->old_path;
}
public function newPath()
{
return $this->new_path;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FileWasRenamed
{
private $old_path;
private $new_path;
public function __construct($old_path, $new_path)
{
$this->old_path = $old_path;
$this->new_path = $new_path;
}
/**
* @return string
*/
public function oldPath()
{
return $this->old_path;
}
public function newPath()
{
return $this->new_path;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FileWasUploaded
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FolderIsCreating
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FolderIsDeleting
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FolderIsMoving
{
private $old_path;
private $new_path;
public function __construct($old_path, $new_path)
{
$this->old_path = $old_path;
$this->new_path = $new_path;
}
/**
* @return string
*/
public function oldPath()
{
return $this->old_path;
}
public function newPath()
{
return $this->new_path;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FolderWasCreated
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FolderWasDeleted
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FolderWasMoving
{
private $old_path;
private $new_path;
public function __construct($old_path, $new_path)
{
$this->old_path = $old_path;
$this->new_path = $new_path;
}
/**
* @return string
*/
public function oldPath()
{
return $this->old_path;
}
public function newPath()
{
return $this->new_path;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace UniSharp\LaravelFilemanager\Exceptions;
class DuplicateFileNameException extends \Exception
{
public function __construct()
{
$this->message = trans('laravel-filemanager::lfm.error-file-exist');
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace UniSharp\LaravelFilemanager\Exceptions;
class EmptyFileException extends \Exception
{
public function __construct()
{
$this->message = trans('laravel-filemanager::lfm.error-file-empty');
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace UniSharp\LaravelFilemanager\Exceptions;
class ExcutableFileException extends \Exception
{
public function __construct()
{
$this->message = 'Invalid file detected';
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace UniSharp\LaravelFilemanager\Exceptions;
class FileFailedToUploadException extends \Exception
{
public function __construct($error_code)
{
$this->message = 'File failed to upload. Error code: ' . $error_code;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace UniSharp\LaravelFilemanager\Exceptions;
class FileSizeExceedConfigurationMaximumException extends \Exception
{
public function __construct($file_size)
{
$this->message = trans('laravel-filemanager::lfm.error-size') . $file_size;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace UniSharp\LaravelFilemanager\Exceptions;
class FileSizeExceedIniMaximumException extends \Exception
{
public function __construct()
{
$this->message = trans('laravel-filemanager::lfm.error-file-size', ['max' => ini_get('upload_max_filesize')]);
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace UniSharp\LaravelFilemanager\Exceptions;
class InvalidMimeTypeException extends \Exception
{
public function __construct($mimetype)
{
$this->message = trans('laravel-filemanager::lfm.error-mime') . $mimetype;
}
}

View File

@@ -6,6 +6,6 @@ class ConfigHandler
{
public function userField()
{
return auth()->user()->id;
return auth()->id();
}
}

View File

@@ -2,7 +2,7 @@
namespace UniSharp\LaravelFilemanager;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
/**
@@ -17,10 +17,6 @@ class LaravelFilemanagerServiceProvider extends ServiceProvider
*/
public function boot()
{
if (Config::get('lfm.use_package_routes')) {
include __DIR__ . '/routes.php';
}
$this->loadTranslationsFrom(__DIR__.'/lang', 'laravel-filemanager');
$this->loadViewsFrom(__DIR__.'/views', 'laravel-filemanager');
@@ -40,6 +36,12 @@ class LaravelFilemanagerServiceProvider extends ServiceProvider
$this->publishes([
__DIR__.'/Handlers/LfmConfigHandler.php' => base_path('app/Handlers/LfmConfigHandler.php'),
], 'lfm_handler');
if (config('lfm.use_package_routes')) {
Route::group(['prefix' => 'filemanager', 'middleware' => ['web', 'auth']], function () {
\UniSharp\LaravelFilemanager\Lfm::routes();
});
}
}
/**
@@ -49,6 +51,8 @@ class LaravelFilemanagerServiceProvider extends ServiceProvider
*/
public function register()
{
$this->mergeConfigFrom(__DIR__ . '/config/lfm.php', 'lfm-config');
$this->app->singleton('laravel-filemanager', function () {
return true;
});

View File

@@ -0,0 +1,384 @@
<?php
namespace UniSharp\LaravelFilemanager;
use Illuminate\Contracts\Config\Repository as Config;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use UniSharp\LaravelFilemanager\Middlewares\CreateDefaultFolder;
use UniSharp\LaravelFilemanager\Middlewares\MultiUser;
class Lfm
{
const PACKAGE_NAME = 'laravel-filemanager';
const DS = '/';
protected $config;
protected $request;
public function __construct(Config $config = null, Request $request = null)
{
$this->config = $config;
$this->request = $request;
}
public function getStorage($storage_path)
{
return new LfmStorageRepository($storage_path, $this);
}
public function input($key)
{
return $this->translateFromUtf8($this->request->input($key));
}
public function config($key)
{
return $this->config->get('lfm.' . $key);
}
/**
* Get only the file name.
*
* @param string $path Real path of a file.
* @return string
*/
public function getNameFromPath($path)
{
return $this->utf8Pathinfo($path, 'basename');
}
public function utf8Pathinfo($path, $part_name)
{
// XXX: all locale work-around for issue: utf8 file name got emptified
// if there's no '/', we're probably dealing with just a filename
// so just put an 'a' in front of it
if (strpos($path, '/') === false) {
$path_parts = pathinfo('a' . $path);
} else {
$path = str_replace('/', '/a', $path);
$path_parts = pathinfo($path);
}
return substr($path_parts[$part_name], 1);
}
public function allowFolderType($type)
{
if ($type == 'user') {
return $this->allowMultiUser();
} else {
return $this->allowShareFolder();
}
}
public function getCategoryName()
{
$type = $this->currentLfmType();
return $this->config->get('lfm.folder_categories.' . $type . '.folder_name', 'files');
}
/**
* Get current lfm type.
*
* @return string
*/
public function currentLfmType()
{
$lfm_type = 'file';
$request_type = lcfirst(Str::singular($this->input('type') ?: ''));
$available_types = array_keys($this->config->get('lfm.folder_categories') ?: []);
if (in_array($request_type, $available_types)) {
$lfm_type = $request_type;
}
return $lfm_type;
}
public function getDisplayMode()
{
$type_key = $this->currentLfmType();
$startup_view = $this->config->get('lfm.folder_categories.' . $type_key . '.startup_view');
$view_type = 'grid';
$target_display_type = $this->input('show_list') ?: $startup_view;
if (in_array($target_display_type, ['list', 'grid'])) {
$view_type = $target_display_type;
}
return $view_type;
}
public function getUserSlug()
{
$config = $this->config->get('lfm.private_folder_name');
if (is_callable($config)) {
return call_user_func($config);
}
if (class_exists($config)) {
return app()->make($config)->userField();
}
return empty(auth()->user()) ? '' : auth()->user()->$config;
}
public function getRootFolder($type = null)
{
if (is_null($type)) {
$type = 'share';
if ($this->allowFolderType('user')) {
$type = 'user';
}
}
if ($type === 'user') {
$folder = $this->getUserSlug();
} else {
$folder = $this->config->get('lfm.shared_folder_name');
}
// the slash is for url, dont replace it with directory seperator
return '/' . $folder;
}
public function getThumbFolderName()
{
return $this->config->get('lfm.thumb_folder_name');
}
public function getFileType($ext)
{
return $this->config->get("lfm.file_type_array.{$ext}", 'File');
}
public function availableMimeTypes()
{
return $this->config->get('lfm.folder_categories.' . $this->currentLfmType() . '.valid_mime');
}
public function shouldCreateCategoryThumb()
{
return $this->config->get('lfm.folder_categories.' . $this->currentLfmType() . '.thumb');
}
public function categoryThumbWidth()
{
return $this->config->get('lfm.folder_categories.' . $this->currentLfmType() . '.thumb_width');
}
public function categoryThumbHeight()
{
return $this->config->get('lfm.folder_categories.' . $this->currentLfmType() . '.thumb_height');
}
public function maxUploadSize()
{
return $this->config->get('lfm.folder_categories.' . $this->currentLfmType() . '.max_size');
}
public function getPaginationPerPage()
{
return $this->config->get("lfm.paginator.perPage", 30);
}
/**
* Check if users are allowed to use their private folders.
*
* @return bool
*/
public function allowMultiUser()
{
$type_key = $this->currentLfmType();
if ($this->config->has('lfm.folder_categories.' . $type_key . '.allow_private_folder')) {
return $this->config->get('lfm.folder_categories.' . $type_key . '.allow_private_folder') === true;
}
return $this->config->get('lfm.allow_private_folder') === true;
}
/**
* Check if users are allowed to use the shared folder.
* This can be disabled only when allowMultiUser() is true.
*
* @return bool
*/
public function allowShareFolder()
{
if (! $this->allowMultiUser()) {
return true;
}
$type_key = $this->currentLfmType();
if ($this->config->has('lfm.folder_categories.' . $type_key . '.allow_shared_folder')) {
return $this->config->get('lfm.folder_categories.' . $type_key . '.allow_shared_folder') === true;
}
return $this->config->get('lfm.allow_shared_folder') === true;
}
/**
* Translate file name to make it compatible on Windows.
*
* @param string $input Any string.
* @return string
*/
public function translateFromUtf8($input)
{
if ($this->isRunningOnWindows()) {
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
}
return $input;
}
/**
* Get directory seperator of current operating system.
*
* @return string
*/
public function ds()
{
$ds = Lfm::DS;
if ($this->isRunningOnWindows()) {
$ds = '\\';
}
return $ds;
}
/**
* Check current operating system is Windows or not.
*
* @return bool
*/
public function isRunningOnWindows()
{
return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
}
/**
* Shorter function of getting localized error message..
*
* @param mixed $error_type Key of message in lang file.
* @param mixed $variables Variables the message needs.
* @return string
*/
public function error($error_type, $variables = [])
{
throw new \Exception(trans(self::PACKAGE_NAME . '::lfm.error-' . $error_type, $variables));
}
/**
* Generates routes of this package.
*
* @return void
*/
public static function routes()
{
$middleware = [ CreateDefaultFolder::class, MultiUser::class ];
$as = 'unisharp.lfm.';
$namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\';
Route::group(compact('middleware', 'as', 'namespace'), function () {
// display main layout
Route::get('/', [
'uses' => 'LfmController@show',
'as' => 'show',
]);
// display integration error messages
Route::get('/errors', [
'uses' => 'LfmController@getErrors',
'as' => 'getErrors',
]);
// upload
Route::any('/upload', [
'uses' => 'UploadController@upload',
'as' => 'upload',
]);
// list images & files
Route::get('/jsonitems', [
'uses' => 'ItemsController@getItems',
'as' => 'getItems',
]);
Route::get('/move', [
'uses' => 'ItemsController@move',
'as' => 'move',
]);
Route::get('/domove', [
'uses' => 'ItemsController@domove',
'as' => 'domove'
]);
// folders
Route::get('/newfolder', [
'uses' => 'FolderController@getAddfolder',
'as' => 'getAddfolder',
]);
// list folders
Route::get('/folders', [
'uses' => 'FolderController@getFolders',
'as' => 'getFolders',
]);
// crop
Route::get('/crop', [
'uses' => 'CropController@getCrop',
'as' => 'getCrop',
]);
Route::get('/cropimage', [
'uses' => 'CropController@getCropimage',
'as' => 'getCropimage',
]);
Route::get('/cropnewimage', [
'uses' => 'CropController@getNewCropimage',
'as' => 'getCropnewimage',
]);
// rename
Route::get('/rename', [
'uses' => 'RenameController@getRename',
'as' => 'getRename',
]);
// scale/resize
Route::get('/resize', [
'uses' => 'ResizeController@getResize',
'as' => 'getResize',
]);
Route::get('/doresize', [
'uses' => 'ResizeController@performResize',
'as' => 'performResize',
]);
// download
Route::get('/download', [
'uses' => 'DownloadController@getDownload',
'as' => 'getDownload',
]);
// delete
Route::get('/delete', [
'uses' => 'DeleteController@getDelete',
'as' => 'getDelete',
]);
Route::get('/demo', 'DemoController@index');
});
}
}

View File

@@ -0,0 +1,204 @@
<?php
namespace UniSharp\LaravelFilemanager;
use Illuminate\Support\Str;
use Symfony\Component\HttpFoundation\File\UploadedFile;
class LfmItem
{
private $lfm;
private $helper;
private $isDirectory;
private $mimeType = null;
private $columns = [];
public $attributes = [];
public function __construct(LfmPath $lfm, Lfm $helper, $isDirectory = false)
{
$this->lfm = $lfm->thumb(false);
$this->helper = $helper;
$this->isDirectory = $isDirectory;
$this->columns = $helper->config('item_columns') ?:
['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'];
}
public function __get($var_name)
{
if (!array_key_exists($var_name, $this->attributes)) {
$function_name = Str::camel($var_name);
$this->attributes[$var_name] = $this->$function_name();
}
return $this->attributes[$var_name];
}
public function fill()
{
foreach ($this->columns as $column) {
$this->__get($column);
}
return $this;
}
public function name()
{
return $this->lfm->getName();
}
public function path($type = 'absolute')
{
return $this->lfm->path($type);
}
public function isDirectory()
{
return $this->isDirectory;
}
public function isFile()
{
return ! $this->isDirectory();
}
/**
* Check a file is image or not.
*
* @param mixed $file Real path of a file or instance of UploadedFile.
* @return bool
*/
public function isImage()
{
return $this->isFile() && Str::startsWith($this->mimeType(), 'image');
}
/**
* Get mime type of a file.
*
* @param mixed $file Real path of a file or instance of UploadedFile.
* @return string
*/
public function mimeType()
{
if (is_null($this->mimeType)) {
$this->mimeType = $this->lfm->mimeType();
}
return $this->mimeType;
}
public function extension()
{
return $this->lfm->extension();
}
public function url()
{
if ($this->isDirectory()) {
return $this->lfm->path('working_dir');
}
return $this->lfm->url();
}
public function size()
{
return $this->isFile() ? $this->humanFilesize($this->lfm->size()) : '';
}
public function time()
{
return $this->lfm->lastModified();
}
public function thumbUrl()
{
if ($this->isDirectory()) {
return asset('vendor/' . Lfm::PACKAGE_NAME . '/img/folder.png');
}
if ($this->isImage()) {
return $this->lfm->thumb($this->hasThumb())->url(true);
}
return null;
}
public function icon()
{
if ($this->isDirectory()) {
return 'fa-folder-o';
}
if ($this->isImage()) {
return 'fa-image';
}
return $this->extension();
}
public function type()
{
if ($this->isDirectory()) {
return trans(Lfm::PACKAGE_NAME . '::lfm.type-folder');
}
if ($this->isImage()) {
return $this->mimeType();
}
return $this->helper->getFileType($this->extension());
}
public function hasThumb()
{
if (!$this->isImage()) {
return false;
}
if (!$this->lfm->thumb()->exists()) {
return false;
}
return true;
}
public function shouldCreateThumb()
{
if (!$this->helper->config('should_create_thumbnails')) {
return false;
}
if (!$this->isImage()) {
return false;
}
if (in_array($this->mimeType(), ['image/gif', 'image/svg+xml'])) {
return false;
}
return true;
}
public function get()
{
return $this->lfm->get();
}
/**
* Make file size readable.
*
* @param int $bytes File size in bytes.
* @param int $decimals Decimals.
* @return string
*/
public function humanFilesize($bytes, $decimals = 2)
{
$size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[$factor]);
}
}

View File

@@ -0,0 +1,328 @@
<?php
namespace UniSharp\LaravelFilemanager;
use Illuminate\Container\Container;
use Intervention\Image\Facades\Image;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use UniSharp\LaravelFilemanager\Events\FileIsUploading;
use UniSharp\LaravelFilemanager\Events\FileWasUploaded;
use UniSharp\LaravelFilemanager\Events\ImageIsUploading;
use UniSharp\LaravelFilemanager\Events\ImageWasUploaded;
use UniSharp\LaravelFilemanager\LfmUploadValidator;
class LfmPath
{
private $working_dir;
private $item_name;
private $is_thumb = false;
private $helper;
public function __construct(Lfm $lfm = null)
{
$this->helper = $lfm;
}
public function __get($var_name)
{
if ($var_name == 'storage') {
return $this->helper->getStorage($this->path('url'));
}
}
public function __call($function_name, $arguments)
{
return $this->storage->$function_name(...$arguments);
}
public function dir($working_dir)
{
$this->working_dir = $working_dir;
return $this;
}
public function thumb($is_thumb = true)
{
$this->is_thumb = $is_thumb;
return $this;
}
public function setName($item_name)
{
$this->item_name = $item_name;
return $this;
}
public function getName()
{
return $this->item_name;
}
public function path($type = 'storage')
{
if ($type == 'working_dir') {
// working directory: /{user_slug}
return $this->translateToLfmPath($this->normalizeWorkingDir());
} elseif ($type == 'url') {
// storage: files/{user_slug}
// storage without folder: {user_slug}
return $this->helper->getCategoryName() === '.'
? ltrim($this->path('working_dir'), '/')
: $this->helper->getCategoryName() . $this->path('working_dir');
} elseif ($type == 'storage') {
// storage: files/{user_slug}
// storage on windows: files\{user_slug}
return str_replace(Lfm::DS, $this->helper->ds(), $this->path('url'));
} else {
// absolute: /var/www/html/project/storage/app/files/{user_slug}
// absolute on windows: C:\project\storage\app\files\{user_slug}
return $this->storage->rootPath() . $this->path('storage');
}
}
public function translateToLfmPath($path)
{
return str_replace($this->helper->ds(), Lfm::DS, $path);
}
public function url()
{
return $this->storage->url($this->path('url'));
}
public function folders()
{
$all_folders = array_map(function ($directory_path) {
return $this->pretty($directory_path, true);
}, $this->storage->directories());
$folders = array_filter($all_folders, function ($directory) {
return $directory->name !== $this->helper->getThumbFolderName();
});
return $this->sortByColumn($folders);
}
public function files()
{
$files = array_map(function ($file_path) {
return $this->pretty($file_path);
}, $this->storage->files());
return $this->sortByColumn($files);
}
public function pretty($item_path, $isDirectory = false)
{
return Container::getInstance()->makeWith(LfmItem::class, [
'lfm' => (clone $this)->setName($this->helper->getNameFromPath($item_path)),
'helper' => $this->helper,
'isDirectory' => $isDirectory
]);
}
public function delete()
{
if ($this->isDirectory()) {
return $this->storage->deleteDirectory();
} else {
return $this->storage->delete();
}
}
/**
* Create folder if not exist.
*
* @param string $path Real path of a directory.
* @return bool
*/
public function createFolder()
{
if ($this->storage->exists($this)) {
return false;
}
$this->storage->makeDirectory(0777, true, true);
}
public function isDirectory()
{
$working_dir = $this->path('working_dir');
$parent_dir = substr($working_dir, 0, strrpos($working_dir, '/'));
$parent_directories = array_map(function ($directory_path) {
return app(static::class)->translateToLfmPath($directory_path);
}, app(static::class)->dir($parent_dir)->directories());
return in_array($this->path('url'), $parent_directories);
}
/**
* Check a folder and its subfolders is empty or not.
*
* @param string $directory_path Real path of a directory.
* @return bool
*/
public function directoryIsEmpty()
{
return count($this->storage->allFiles()) == 0;
}
public function normalizeWorkingDir()
{
$path = $this->working_dir
?: $this->helper->input('working_dir')
?: $this->helper->getRootFolder();
if ($this->is_thumb) {
// Prevent if working dir is "/" normalizeWorkingDir will add double "//" that breaks S3 functionality
$path = rtrim($path, Lfm::DS) . Lfm::DS . $this->helper->getThumbFolderName();
}
if ($this->getName()) {
// Prevent if working dir is "/" normalizeWorkingDir will add double "//" that breaks S3 functionality
$path = rtrim($path, Lfm::DS) . Lfm::DS . $this->getName();
}
return $path;
}
/**
* Sort files and directories.
*
* @param mixed $arr_items Array of files or folders or both.
* @return array of object
*/
public function sortByColumn($arr_items)
{
$sort_by = $this->helper->input('sort_type');
if (in_array($sort_by, ['name', 'time'])) {
$key_to_sort = $sort_by;
} else {
$key_to_sort = 'name';
}
uasort($arr_items, function ($a, $b) use ($key_to_sort) {
return strcasecmp($a->{$key_to_sort}, $b->{$key_to_sort});
});
return $arr_items;
}
public function error($error_type, $variables = [])
{
throw new \Exception($this->helper->error($error_type, $variables));
}
// Upload section
public function upload($file)
{
$new_file_name = $this->getNewName($file);
$new_file_path = $this->setName($new_file_name)->path('absolute');
event(new FileIsUploading($new_file_path));
event(new ImageIsUploading($new_file_path));
try {
$this->setName($new_file_name)->storage->save($file);
$this->generateThumbnail($new_file_name);
} catch (\Exception $e) {
\Log::info($e);
return $this->error('invalid');
}
// TODO should be "FileWasUploaded"
event(new FileWasUploaded($new_file_path));
event(new ImageWasUploaded($new_file_path));
return $new_file_name;
}
public function validateUploadedFile($file)
{
$validator = new LfmUploadValidator($file);
$validator->sizeLowerThanIniMaximum();
$validator->uploadWasSuccessful();
if (!config('lfm.over_write_on_duplicate')) {
$validator->nameIsNotDuplicate($this->getNewName($file), $this);
}
$validator->isNotExcutable(config('lfm.disallowed_mimetypes', ['text/x-php', 'text/html', 'text/plain']));
if (config('lfm.should_validate_mime', false)) {
$validator->mimeTypeIsValid($this->helper->availableMimeTypes());
}
if (config('lfm.should_validate_size', false)) {
$validator->sizeIsLowerThanConfiguredMaximum($this->helper->maxUploadSize());
}
return true;
}
private function getNewName($file)
{
$new_file_name = $this->helper->translateFromUtf8(
trim($this->helper->utf8Pathinfo($file->getClientOriginalName(), "filename"))
);
$extension = $file->getClientOriginalExtension();
if (config('lfm.rename_file') === true) {
$new_file_name = uniqid();
} elseif (config('lfm.alphanumeric_filename') === true) {
$new_file_name = preg_replace('/[^A-Za-z0-9\-\']/', '_', $new_file_name);
}
if ($extension) {
$new_file_name_with_extention = $new_file_name . '.' . $extension;
}
if (config('lfm.rename_duplicates') === true) {
$counter = 1;
$file_name_without_extentions = $new_file_name;
while ($this->setName(($extension) ? $new_file_name_with_extention : $new_file_name)->exists()) {
if (config('lfm.alphanumeric_filename') === true) {
$suffix = '_'.$counter;
} else {
$suffix = " ({$counter})";
}
$new_file_name = $file_name_without_extentions.$suffix;
if ($extension) {
$new_file_name_with_extention = $new_file_name . '.' . $extension;
}
$counter++;
}
}
return ($extension) ? $new_file_name_with_extention : $new_file_name;
}
public function generateThumbnail($file_name)
{
$original_image = $this->pretty($file_name);
if (!$original_image->shouldCreateThumb()) {
return;
}
// create folder for thumbnails
$this->setName(null)->thumb(true)->createFolder();
// generate cropped image content
$this->setName($file_name)->thumb(true);
$thumbWidth = $this->helper->shouldCreateCategoryThumb() && $this->helper->categoryThumbWidth() ? $this->helper->categoryThumbWidth() : config('lfm.thumb_img_width', 200);
$thumbHeight = $this->helper->shouldCreateCategoryThumb() && $this->helper->categoryThumbHeight() ? $this->helper->categoryThumbHeight() : config('lfm.thumb_img_height', 200);
$image = Image::make($original_image->get())
->fit($thumbWidth, $thumbHeight);
$this->storage->put($image->stream()->detach(), 'public');
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace UniSharp\LaravelFilemanager;
use Illuminate\Support\Facades\Storage;
class LfmStorageRepository
{
private $disk;
private $path;
private $helper;
public function __construct($storage_path, $helper)
{
$this->helper = $helper;
$this->disk = Storage::disk($this->helper->config('disk'));
$this->path = $storage_path;
}
public function __call($function_name, $arguments)
{
// TODO: check function exists
return $this->disk->$function_name($this->path, ...$arguments);
}
public function rootPath()
{
return $this->disk->path('');
}
public function move($new_lfm_path)
{
return $this->disk->move($this->path, $new_lfm_path->path('storage'));
}
public function save($file)
{
$nameint = strripos($this->path, "/");
$nameclean = substr($this->path, $nameint + 1);
$pathclean = substr_replace($this->path, "", $nameint);
$this->disk->putFileAs($pathclean, $file, $nameclean);
}
public function url($path)
{
return $this->disk->url($path);
}
public function makeDirectory()
{
$this->disk->makeDirectory($this->path, ...func_get_args());
// some filesystems (e.g. Google Storage, S3?) don't let you set ACLs on directories (because they don't exist)
// https://cloud.google.com/storage/docs/naming#object-considerations
if ($this->disk->has($this->path)) {
$this->disk->setVisibility($this->path, 'public');
}
}
public function extension()
{
setlocale(LC_ALL, 'en_US.UTF-8');
return pathinfo($this->path, PATHINFO_EXTENSION);
}
}

View File

@@ -0,0 +1,97 @@
<?php
namespace UniSharp\LaravelFilemanager;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use UniSharp\LaravelFilemanager\Exceptions\DuplicateFileNameException;
use UniSharp\LaravelFilemanager\Exceptions\EmptyFileException;
use UniSharp\LaravelFilemanager\Exceptions\ExcutableFileException;
use UniSharp\LaravelFilemanager\Exceptions\FileFailedToUploadException;
use UniSharp\LaravelFilemanager\Exceptions\FileSizeExceedConfigurationMaximumException;
use UniSharp\LaravelFilemanager\Exceptions\FileSizeExceedIniMaximumException;
use UniSharp\LaravelFilemanager\Exceptions\InvalidMimeTypeException;
use UniSharp\LaravelFilemanager\LfmPath;
class LfmUploadValidator
{
private $file;
public function __construct(UploadedFile $file)
{
// if (! $file instanceof UploadedFile) {
// throw new \Exception(trans(self::PACKAGE_NAME . '::lfm.error-instance'));
// }
$this->file = $file;
}
// public function hasContent()
// {
// if (empty($this->file)) {
// throw new EmptyFileException();
// }
// return $this;
// }
public function sizeLowerThanIniMaximum()
{
if ($this->file->getError() == UPLOAD_ERR_INI_SIZE) {
throw new FileSizeExceedIniMaximumException();
}
return $this;
}
public function uploadWasSuccessful()
{
if ($this->file->getError() != UPLOAD_ERR_OK) {
throw new FileFailedToUploadException($this->file->getError());
}
return $this;
}
public function nameIsNotDuplicate($new_file_name, LfmPath $lfm_path)
{
if ($lfm_path->setName($new_file_name)->exists()) {
throw new DuplicateFileNameException();
}
return $this;
}
public function isNotExcutable($excutable_mimetypes)
{
$mimetype = $this->file->getMimeType();
if (in_array($mimetype, $excutable_mimetypes)) {
throw new ExcutableFileException();
}
return $this;
}
public function mimeTypeIsValid($available_mime_types)
{
$mimetype = $this->file->getMimeType();
if (false === in_array($mimetype, $available_mime_types)) {
throw new InvalidMimeTypeException($mimetype);
}
return $this;
}
public function sizeIsLowerThanConfiguredMaximum($max_size_in_kb)
{
// size to kb unit is needed
$file_size_in_kb = $this->file->getSize() / 1000;
if ($file_size_in_kb > $max_size_in_kb) {
throw new FileSizeExceedConfigurationMaximumException($file_size_in_kb);
}
return $this;
}
}

View File

@@ -3,11 +3,19 @@
namespace UniSharp\LaravelFilemanager\Middlewares;
use Closure;
use UniSharp\LaravelFilemanager\Traits\LfmHelpers;
use UniSharp\LaravelFilemanager\Lfm;
use UniSharp\LaravelFilemanager\LfmPath;
class CreateDefaultFolder
{
use LfmHelpers;
private $lfm;
private $helper;
public function __construct()
{
$this->lfm = app(LfmPath::class);
$this->helper = app(Lfm::class);
}
public function handle($request, Closure $next)
{
@@ -19,16 +27,10 @@ class CreateDefaultFolder
private function checkDefaultFolderExists($type = 'share')
{
if ($type === 'user' && ! $this->allowMultiUser()) {
if (! $this->helper->allowFolderType($type)) {
return;
}
if ($type === 'share' && ! $this->allowShareFolder()) {
return;
}
$path = $this->getRootFolderPath($type);
$this->createFolderByPath($path);
$this->lfm->dir($this->helper->getRootFolder($type))->createFolder();
}
}

View File

@@ -3,17 +3,23 @@
namespace UniSharp\LaravelFilemanager\Middlewares;
use Closure;
use UniSharp\LaravelFilemanager\Traits\LfmHelpers;
use Illuminate\Support\Str;
use UniSharp\LaravelFilemanager\Lfm;
class MultiUser
{
use LfmHelpers;
private $helper;
public function __construct()
{
$this->helper = app(Lfm::class);
}
public function handle($request, Closure $next)
{
if ($this->allowMultiUser()) {
if ($this->helper->allowFolderType('user')) {
$previous_dir = $request->input('working_dir');
$working_dir = $this->rootFolder('user');
$working_dir = $this->helper->getRootFolder('user');
if ($previous_dir == null) {
$request->merge(compact('working_dir'));
@@ -27,11 +33,11 @@ class MultiUser
private function validDir($previous_dir)
{
if (starts_with($previous_dir, $this->rootFolder('share'))) {
if (Str::startsWith($previous_dir, $this->helper->getRootFolder('share'))) {
return true;
}
if (starts_with($previous_dir, $this->rootFolder('user'))) {
if (Str::startsWith($previous_dir, $this->helper->getRootFolder('user'))) {
return true;
}

View File

@@ -1,645 +0,0 @@
<?php
namespace UniSharp\LaravelFilemanager\Traits;
use Illuminate\Support\Facades\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
trait LfmHelpers
{
/*****************************
*** Path / Url ***
*****************************/
/**
* Directory separator for url.
*
* @var string|null
*/
private $ds = '/';
/**
* Get real path of a thumbnail on the operating system.
*
* @param string|null $image_name File name of original image
* @return string|null
*/
public function getThumbPath($image_name = null)
{
return $this->getCurrentPath($image_name, 'thumb');
}
/**
* Get real path of a file, image, or current working directory on the operating system.
*
* @param string|null $file_name File name of image or file
* @return string|null
*/
public function getCurrentPath($file_name = null, $is_thumb = null)
{
$path = $this->composeSegments('dir', $is_thumb, $file_name);
$path = $this->translateToOsPath($path);
return base_path($path);
}
/**
* Get url of a thumbnail.
*
* @param string|null $image_name File name of original image
* @return string|null
*/
public function getThumbUrl($image_name = null)
{
return $this->getFileUrl($image_name, 'thumb');
}
/**
* Get url of a original image.
*
* @param string|null $image_name File name of original image
* @return string|null
*/
public function getFileUrl($image_name = null, $is_thumb = null)
{
return url($this->composeSegments('url', $is_thumb, $image_name));
}
/**
* Assemble needed config or input to form url or real path of a file, image, or current working directory.
*
* @param string $type Url or dir
* @param bollean $is_thumb Image is a thumbnail or not
* @param string|null $file_name File name of image or file
* @return string|null
*/
private function composeSegments($type, $is_thumb, $file_name)
{
$full_path = implode($this->ds, [
$this->getPathPrefix($type),
$this->getFormatedWorkingDir(),
$this->appendThumbFolderPath($is_thumb),
$file_name,
]);
$full_path = $this->removeDuplicateSlash($full_path);
$full_path = $this->translateToLfmPath($full_path);
return $this->removeLastSlash($full_path);
}
/**
* Assemble base_directory and route prefix config.
*
* @param string $type Url or dir
* @return string
*/
public function getPathPrefix($type)
{
$default_folder_name = 'files';
if ($this->isProcessingImages()) {
$default_folder_name = 'photos';
}
$prefix = config('lfm.' . $this->currentLfmType() . 's_folder_name', $default_folder_name);
$base_directory = config('lfm.base_directory', 'public');
if ($type === 'dir') {
$prefix = $base_directory . '/' . $prefix;
}
if ($type === 'url' && $base_directory !== 'public') {
$prefix = config('lfm.url_prefix', config('lfm.prefix', 'laravel-filemanager')) . '/' . $prefix;
}
return $prefix;
}
/**
* Get current or default working directory.
*
* @return string
*/
private function getFormatedWorkingDir()
{
$working_dir = request('working_dir');
if (empty($working_dir)) {
$default_folder_type = 'share';
if ($this->allowMultiUser()) {
$default_folder_type = 'user';
}
$working_dir = $this->rootFolder($default_folder_type);
}
return $this->removeFirstSlash($working_dir);
}
/**
* Get thumbnail folder name.
*
* @return string|null
*/
private function appendThumbFolderPath($is_thumb)
{
if (! $is_thumb) {
return;
}
$thumb_folder_name = config('lfm.thumb_folder_name');
// if user is inside thumbs folder, there is no need
// to add thumbs substring to the end of url
$in_thumb_folder = str_contains($this->getFormatedWorkingDir(), $this->ds . $thumb_folder_name);
if (! $in_thumb_folder) {
return $thumb_folder_name . $this->ds;
}
}
/**
* Get root working directory.
*
* @param string $type User or share.
* @return string
*/
public function rootFolder($type)
{
if ($type === 'user') {
$folder_name = $this->getUserSlug();
} else {
$folder_name = config('lfm.shared_folder_name');
}
return $this->ds . $folder_name;
}
/**
* Get real path of root working directory on the operating system.
*
* @param string|null $type User or share
* @return string|null
*/
public function getRootFolderPath($type)
{
return base_path($this->getPathPrefix('dir') . $this->rootFolder($type));
}
/**
* Get only the file name.
*
* @param string $file Real path of a file.
* @return string
*/
public function getName($file)
{
$lfm_file_path = $this->getInternalPath($file);
$arr_dir = explode($this->ds, $lfm_file_path);
$file_name = end($arr_dir);
return $file_name;
}
/**
* Get url with only working directory and file name.
*
* @param string $full_path Real path of a file.
* @return string
*/
public function getInternalPath($full_path)
{
$full_path = $this->translateToLfmPath($full_path);
$full_path = $this->translateToUtf8($full_path);
$lfm_dir_start = strpos($full_path, $this->getPathPrefix('dir'));
$working_dir_start = $lfm_dir_start + strlen($this->getPathPrefix('dir'));
$lfm_file_path = $this->ds . substr($full_path, $working_dir_start);
return $this->removeDuplicateSlash($lfm_file_path);
}
/**
* Change directiry separator, from url one to one on current operating system.
*
* @param string $path Url of a file.
* @return string
*/
private function translateToOsPath($path)
{
if ($this->isRunningOnWindows()) {
$path = str_replace($this->ds, '\\', $path);
}
return $path;
}
/**
* Change directiry separator, from one on current operating system to url one.
*
* @param string $path Real path of a file.
* @return string
*/
private function translateToLfmPath($path)
{
if ($this->isRunningOnWindows()) {
$path = str_replace('\\', $this->ds, $path);
}
return $path;
}
/**
* Strip duplicate slashes from url.
*
* @param string $path Any url.
* @return string
*/
private function removeDuplicateSlash($path)
{
return preg_replace('/\\'.$this->ds.'{2,}/', $this->ds, $path);
}
/**
* Strip first slash from url.
*
* @param string $path Any url.
* @return string
*/
private function removeFirstSlash($path)
{
if (starts_with($path, $this->ds)) {
$path = substr($path, 1);
}
return $path;
}
/**
* Strip last slash from url.
*
* @param string $path Any url.
* @return string
*/
private function removeLastSlash($path)
{
// remove last slash
if (ends_with($path, $this->ds)) {
$path = substr($path, 0, -1);
}
return $path;
}
/**
* Translate file name to make it compatible on Windows.
*
* @param string $input Any string.
* @return string
*/
public function translateFromUtf8($input)
{
if ($this->isRunningOnWindows()) {
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
}
return $input;
}
/**
* Translate file name from Windows.
*
* @param string $input Any string.
* @return string
*/
public function translateToUtf8($input)
{
if ($this->isRunningOnWindows()) {
$input = iconv(mb_detect_encoding($input), 'UTF-8', $input);
}
return $input;
}
/****************************
*** Config / Settings ***
****************************/
/**
* Check current lfm type is image or not.
*
* @return bool
*/
public function isProcessingImages()
{
return lcfirst(str_singular(request('type', '') ?: '')) === 'image';
}
/**
* Check current lfm type is file or not.
*
* @return bool
*/
public function isProcessingFiles()
{
return ! $this->isProcessingImages();
}
/**
* Get current lfm type..
*
* @return string
*/
public function currentLfmType()
{
$file_type = 'file';
if ($this->isProcessingImages()) {
$file_type = 'image';
}
return $file_type;
}
/**
* Check if users are allowed to use their private folders.
*
* @return bool
*/
public function allowMultiUser()
{
return config('lfm.allow_multi_user') === true;
}
/**
* Check if users are allowed to use the shared folder.
* This can be disabled only when allowMultiUser() is true.
*
* @return bool
*/
public function allowShareFolder()
{
if (! $this->allowMultiUser()) {
return true;
}
return config('lfm.allow_share_folder') === true;
}
/**
* Overrides settings in php.ini.
*
* @return null
*/
public function applyIniOverrides()
{
if (count(config('lfm.php_ini_overrides')) == 0) {
return;
}
foreach (config('lfm.php_ini_overrides') as $key => $value) {
if ($value && $value != 'false') {
ini_set($key, $value);
}
}
}
/****************************
*** File System ***
****************************/
/**
* Get folders by the given directory.
*
* @param string $path Real path of a directory.
* @return array of objects
*/
public function getDirectories($path)
{
return array_map(function ($directory) {
return $this->objectPresenter($directory);
}, array_filter(File::directories($path), function ($directory) {
return $this->getName($directory) !== config('lfm.thumb_folder_name');
}));
}
/**
* Get files by the given directory.
*
* @param string $path Real path of a directory.
* @return array of objects
*/
public function getFilesWithInfo($path)
{
return array_map(function ($file) {
return $this->objectPresenter($file);
}, File::files($path));
}
/**
* Format a file or folder to object.
*
* @param string $item Real path of a file or directory.
* @return object
*/
public function objectPresenter($item)
{
$item_name = $this->getName($item);
$is_file = is_file($item);
if (! $is_file) {
$file_type = trans('laravel-filemanager::lfm.type-folder');
$icon = 'fa-folder-o';
$thumb_url = asset('vendor/laravel-filemanager/img/folder.png');
} elseif ($this->fileIsImage($item)) {
$file_type = $this->getFileType($item);
$icon = 'fa-image';
$thumb_path = $this->getThumbPath($item_name);
$file_path = $this->getCurrentPath($item_name);
if (! $this->imageShouldHaveThumb($file_path)) {
$thumb_url = $this->getFileUrl($item_name) . '?timestamp=' . filemtime($file_path);
} elseif (File::exists($thumb_path)) {
$thumb_url = $this->getThumbUrl($item_name) . '?timestamp=' . filemtime($thumb_path);
} else {
$thumb_url = $this->getFileUrl($item_name) . '?timestamp=' . filemtime($file_path);
}
} else {
$extension = strtolower(File::extension($item_name));
$file_type = config('lfm.file_type_array.' . $extension) ?: 'File';
$icon = config('lfm.file_icon_array.' . $extension) ?: 'fa-file';
$thumb_url = null;
}
return (object) [
'name' => $item_name,
'url' => $is_file ? $this->getFileUrl($item_name) : '',
'size' => $is_file ? $this->humanFilesize(File::size($item)) : '',
'updated' => filemtime($item),
'path' => $is_file ? '' : $this->getInternalPath($item),
'time' => date('Y-m-d h:i', filemtime($item)),
'type' => $file_type,
'icon' => $icon,
'thumb' => $thumb_url,
'is_file' => $is_file,
];
}
/**
* Create folder if not exist.
*
* @param string $path Real path of a directory.
* @return null
*/
public function createFolderByPath($path)
{
if (! File::exists($path)) {
File::makeDirectory($path, config('lfm.create_folder_mode', 0755), true, true);
}
}
/**
* Check a folder and its subfolders is empty or not.
*
* @param string $directory_path Real path of a directory.
* @return bool
*/
public function directoryIsEmpty($directory_path)
{
return count(File::allFiles($directory_path)) == 0;
}
/**
* Check a file is image or not.
*
* @param mixed $file Real path of a file or instance of UploadedFile.
* @return bool
*/
public function fileIsImage($file)
{
$mime_type = $this->getFileType($file);
return starts_with($mime_type, 'image');
}
/**
* Check thumbnail should be created when the file is uploading.
*
* @param mixed $file Real path of a file or instance of UploadedFile.
* @return bool
*/
public function imageShouldHaveThumb($file)
{
if (! config('lfm.should_create_thumbnails', true)) {
return false;
}
$mime_type = $this->getFileType($file);
return in_array(
$mime_type,
config('lfm.raster_mimetypes', ['image/jpeg', 'image/pjpeg', 'image/png'])
);
}
/**
* Get mime type of a file.
*
* @param mixed $file Real path of a file or instance of UploadedFile.
* @return string
*/
public function getFileType($file)
{
if ($file instanceof UploadedFile) {
$mime_type = $file->getMimeType();
} else {
$mime_type = File::mimeType($file);
}
return $mime_type;
}
/**
* Sort files and directories.
*
* @param mixed $arr_items Array of files or folders or both.
* @param mixed $sort_type Alphabetic or time.
* @return array of object
*/
public function sortFilesAndDirectories($arr_items, $sort_type)
{
if ($sort_type == 'time') {
$key_to_sort = 'updated';
} elseif ($sort_type == 'alphabetic') {
$key_to_sort = 'name';
} else {
$key_to_sort = 'updated';
}
uasort($arr_items, function ($a, $b) use ($key_to_sort) {
return strcmp($a->{$key_to_sort}, $b->{$key_to_sort});
});
return $arr_items;
}
/****************************
*** Miscellaneouses ***
****************************/
/**
* Get the name of private folder of current user.
*
* @return string
*/
public function getUserSlug()
{
if (is_callable(config('lfm.user_field'))) {
$slug_of_user = call_user_func(config('lfm.user_field'));
} elseif (class_exists(config('lfm.user_field'))) {
$config_handler = config('lfm.user_field');
$slug_of_user = app()->make($config_handler)->userField();
} else {
$old_slug_of_user = config('lfm.user_field');
$slug_of_user = empty(auth()->user()) ? '' : auth()->user()->$old_slug_of_user;
}
return $slug_of_user;
}
/**
* Shorter function of getting localized error message..
*
* @param mixed $error_type Key of message in lang file.
* @param mixed $variables Variables the message needs.
* @return string
*/
public function error($error_type, $variables = [])
{
return trans('laravel-filemanager::lfm.error-' . $error_type, $variables);
}
/**
* Make file size readable.
*
* @param int $bytes File size in bytes.
* @param int $decimals Decimals.
* @return string
*/
public function humanFilesize($bytes, $decimals = 2)
{
$size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . ' ' . @$size[$factor];
}
/**
* Check current operating system is Windows or not.
*
* @return bool
*/
public function isRunningOnWindows()
{
return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
}
}

View File

@@ -1,147 +1,153 @@
<?php
/*
|--------------------------------------------------------------------------
| Documentation for this config :
|--------------------------------------------------------------------------
| online => http://unisharp.github.io/laravel-filemanager/config
| offline => vendor/unisharp/laravel-filemanager/docs/config.md
*/
return [
/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/
*/
// Include to pre-defined routes from package or not. Middlewares
'use_package_routes' => true,
// Middlewares which should be applied to all package routes.
// For laravel 5.1 and before, remove 'web' from the array.
'middlewares' => ['web', 'auth'],
// The url to this package. Change it if necessary.
'url_prefix' => 'laravel-filemanager',
'use_package_routes' => true,
/*
|--------------------------------------------------------------------------
| Multi-User Mode
| Shared folder / Private folder
|--------------------------------------------------------------------------
*/
|
| If both options are set to false, then shared folder will be activated.
|
*/
// If true, private folders will be created for each signed-in user.
'allow_multi_user' => true,
// If true, share folder will be created when allow_multi_user is true.
'allow_share_folder' => true,
'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\ConfigHander class
// And set 'user_field' to App\Handler\ConfigHander::class
// 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_field' => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,
'private_folder_name' => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,
'allow_shared_folder' => true,
'shared_folder_name' => 'shares',
/*
|--------------------------------------------------------------------------
| Working Directory
| Folder Names
|--------------------------------------------------------------------------
*/
*/
// Which folder to store files in project, fill in 'public', 'resources', 'storage' and so on.
// You should create routes to serve images if it is not set to public.
'base_directory' => 'public',
'images_folder_name' => 'photos',
'files_folder_name' => 'files',
'shared_folder_name' => 'shares',
'thumb_folder_name' => 'thumbs',
'folder_categories' => [
'file' => [
'folder_name' => 'files',
'startup_view' => 'list',
'max_size' => 50000, // size in KB
'thumb' => true,
'thumb_width' => 80,
'thumb_height' => 80,
'valid_mime' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'application/pdf',
'text/plain',
],
],
'image' => [
'folder_name' => 'photos',
'startup_view' => 'grid',
'max_size' => 50000, // size in KB
'thumb' => true,
'thumb_width' => 80,
'thumb_height' => 80,
'valid_mime' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
],
],
],
/*
|--------------------------------------------------------------------------
| Startup Views
| Pagination
|--------------------------------------------------------------------------
*/
*/
// The default display type for items.
// Supported: "grid", "list"
'images_startup_view' => 'grid',
'files_startup_view' => 'list',
'paginator' => [
'perPage' => 30,
],
/*
|--------------------------------------------------------------------------
| Upload / Validation
|--------------------------------------------------------------------------
*/
*/
// If true, the uploaded file will be renamed to uniqid() + file extension.
'rename_file' => false,
'disk' => 'public',
// If rename_file set to false and this set to true, then non-alphanumeric characters in filename will be replaced.
'alphanumeric_filename' => false,
'rename_file' => false,
// If true, non-alphanumeric folder name will be rejected.
'alphanumeric_directory' => false,
'rename_duplicates' => false,
// If true, the uploading file's size will be verified for over than max_image_size/max_file_size.
'should_validate_size' => false,
'alphanumeric_filename' => false,
'max_image_size' => 50000,
'max_file_size' => 50000,
'alphanumeric_directory' => false,
// If true, the uploading file's mime type will be valid in valid_image_mimetypes/valid_file_mimetypes.
'should_validate_mime' => false,
'should_validate_size' => false,
// available since v1.3.0
'valid_image_mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
],
'should_validate_mime' => 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
'over_write_on_duplicate' => false,
// mimetypes of executables to prevent from uploading
'disallowed_mimetypes' => ['text/x-php', 'text/html', 'text/plain'],
// Item Columns
'item_columns' => ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'],
/*
|--------------------------------------------------------------------------
| Thumbnail
|--------------------------------------------------------------------------
*/
// 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' => [
'raster_mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
],
// permissions to be set when create a new folder or when it creates automatically with thumbnails
'create_folder_mode' => 0755,
'thumb_img_width' => 200, // px
// 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,
// available since v1.3.0
// only when '/laravel-filemanager?type=Files'
'valid_file_mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
'application/pdf',
'text/plain',
],
/*
|--------------------------------------------------------------------------
| Image / Folder Setting
|--------------------------------------------------------------------------
*/
'thumb_img_width' => 200,
'thumb_img_height' => 200,
'thumb_img_height' => 200, // px
/*
|--------------------------------------------------------------------------
| File Extension Information
|--------------------------------------------------------------------------
*/
*/
'file_type_array' => [
'file_type_array' => [
'pdf' => 'Adobe Acrobat',
'doc' => 'Microsoft Word',
'docx' => 'Microsoft Word',
@@ -156,21 +162,6 @@ return [
'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
@@ -181,9 +172,8 @@ return [
|
| Please note that the 'upload_max_filesize' & 'post_max_size'
| directives are not supported.
*/
'php_ini_overrides' => [
'memory_limit' => '256M',
*/
'php_ini_overrides' => [
'memory_limit' => '256M',
],
];

View File

@@ -18,8 +18,8 @@ return [
'title-panel' => 'مدير الملفات',
'title-upload' => 'رفع ملف',
'title-view' => 'عرض الملف',
'title-root' => 'الملفات',
'title-shares' => 'الملفات المشتركة',
'title-user' => 'الملفات',
'title-share' => 'الملفات المشتركة',
'title-item' => 'ملف',
'title-size' => 'الحجم',
'title-type' => 'النوع',

View File

@@ -0,0 +1,83 @@
<?php
return [
'nav-back' => 'Geri',
'nav-new' => 'Yeni qovluq',
'nav-upload' => 'Yüklə',
'nav-thumbnails' => 'Kiçik formatda (thumb)',
'nav-list' => 'Siyahı',
'nav-sort' => 'Sırala',
'nav-sort-alphabetic'=> 'A-Z Sırala',
'nav-sort-time' => 'Zamana Görə Sırala',
'menu-rename' => 'Ad dəyişmək',
'menu-delete' => 'Sil',
'menu-view' => 'Görüntülə',
'menu-download' => 'Endir',
'menu-resize' => 'Ölçüləndir',
'menu-crop' => 'Kəsmək',
'menu-move' => 'Yerini dəyiş',
'menu-multiple' => 'Multi-seçim',
'title-page' => 'Fayl menecer',
'title-panel' => 'Fayl menecer',
'title-upload' => 'Fayl yülə',
'title-view' => 'Fayla bax',
'title-root' => 'Fayllarım',
'title-shares' => 'Paylaşılan Fayllar',
'title-item' => 'Faylalr',
'title-size' => 'Böyütmək',
'title-type' => 'Tip',
'title-modified' => 'Dəyişmək',
'title-action' => 'Funksiyalar',
'title-user' => 'Fayllar',
'title-share' => 'Paylaşılmış fayllar',
'type-folder' => 'Qovluq',
'message-empty' => 'Qovluq boşdur',
'message-choose' => 'Fayl seç',
'message-delete' => 'Bu faylı silmək istədiyinizə əminsiniz?',
'message-name' => 'Qovluq adı:',
'message-rename' => 'Yeni ad:',
'message-extension_not_found' => 'Xahiş olunur , Şəkilləri kəsmək və ya yenidən ölçü vermək istəyirsinizsə gd və ya imagick genişlənmələriniz serverinizdə aktiov edin.',
'message-drop' => 'və ya yükləmək üçün faylları bura atın',
'error-rename' => 'Fayl adı artıq istifadə olunur!',
'error-file-name' => 'Dosya adı boş bırakılamaz!',
'error-file-empty' => 'Fayl adı boş ola bilməz!',
'error-file-exist' => 'Bu adda bir fayl artıq var!',
'error-file-size' => 'Fayl ölçüsü limiti keçir! (maximum ölçü: :max)',
'error-delete-folder'=> 'Qovluq boş olmadığından silmək mümkün olmadı!',
'error-folder-name' => 'Qovluq adı boş ola bilməz!',
'error-folder-exist'=> 'Bu adda qovluq artıq var!',
'error-folder-alnum'=> 'Yalnız hərf və rəqəmdən ibarət adlara icazə verilir',
'error-folder-not-found'=> 'Qovluq tapılmadı! (:folder)',
'error-mime' => 'İcazə verilməyən fayl tipi: ',
'error-size' => 'Həcm limiti keçir:',
'error-instance' => 'Yüklənən fayl, UploadedFile nümunəsi kimi olmalıdır',
'error-invalid' => 'Yükləmə istəyi doğru deyil',
'error-other' => 'Xəta bax verdi: ',
'error-too-large' => 'Yüklənmə sayı limiti keçir!',
'btn-upload' => 'Yüklə',
'btn-uploading' => 'Yüklenir...',
'btn-close' => 'Bağla',
'btn-crop' => 'Kəs',
'btn-copy-crop' => 'Kopyala & Kəs',
'btn-cancel' => 'İmtina',
'btn-resize' => 'Ölçünü dəyiş',
'btn-crop-free' => 'Sərbəst',
'btn-confirm' => 'Təsdiq et',
'btn-open' => 'Qovluğu aç',
'resize-ratio' => 'Nisbət:',
'resize-scaled' => 'Böyüdüldü:',
'resize-true' => 'Bəli',
'resize-old-height' => 'Original Hündürlür:',
'resize-old-width' => 'Original En:',
'resize-new-height' => 'Hündürlük:',
'resize-new-width' => 'En:',
'locale-bootbox' => 'az',
];

View File

@@ -18,8 +18,8 @@ return [
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Качи файл',
'title-view' => 'Виж файл',
'title-root' => 'Файлове',
'title-shares' => 'Споделени Файлове',
'title-user' => 'Файлове',
'title-share' => 'Споделени Файлове',
'title-item' => 'Елемент',
'title-size' => 'Размер',
'title-type' => 'Тип',

View File

@@ -0,0 +1,79 @@
<?php
return [
'nav-back' => 'Zpět',
'nav-new' => 'Nová složka',
'nav-upload' => 'Nahrát',
'nav-thumbnails' => 'Zmenšeniny',
'nav-list' => 'Seznam',
'nav-sort' => 'Seřadit',
'nav-sort-alphabetic'=> 'Seřadit podle abecedy',
'nav-sort-time' => 'Seřadit podle času',
'menu-rename' => 'Přejmenovat',
'menu-delete' => 'Smazat',
'menu-view' => 'Zobrazit',
'menu-download' => 'Stáhnout',
'menu-resize' => 'Zmenšit',
'menu-crop' => 'Oříznout',
'menu-move' => 'Přesunout',
'menu-multiple' => 'Vybrat více souborů',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Nahrát soubor(y)',
'title-view' => 'Zobrazit soubor',
'title-user' => 'Soubory',
'title-share' => 'Sdílené soubory',
'title-item' => 'Položka',
'title-size' => 'Velikost',
'title-type' => 'Typ',
'title-modified' => 'Modifikované',
'title-action' => 'Akce',
'type-folder' => 'Složka',
'message-empty' => 'Složka je prázdna.',
'message-choose' => 'Vyberte soubor (y)',
'message-delete' => 'Opravdu chcete smazat tuto položku?',
'message-name' => 'Název složky:',
'message-rename' => 'Přejmenovat na:',
'message-extension_not_found' => 'Prosíme nainstalujte gd nebo Imagick rozšíření pro ořezávání, zmenšování nebo vytváření zmenšenin obrázků.',
'message-drop' => 'Nebo přetáhněte soubory pro nahrání.',
'error-rename' => 'Tento název souboru již existuje!',
'error-file-name' => 'Název souboru nemůže být prázdný!',
'error-file-empty' => 'Vyberte soubor!',
'error-file-exist' => 'Soubor s tímto názvem již existuje!',
'error-file-size' => 'Velikost souboru překročila limit serveru! (Mazimálna velikost je: :max)',
'error-delete-folder'=> 'Složku není možné vymazat, protože není prázdná!',
'error-folder-name' => 'Název složky nesmí být prázdný!',
'error-folder-exist'=> 'Složka s timto názvem již existuje!',
'error-folder-alnum'=> 'Jen písmena a číslice su povolené v názvu složky!',
'error-folder-not-found'=> 'Složka nebyla nalezena! (:folder)',
'error-mime' => 'Nepovolený typ souboru:',
'error-size' => 'Soubor přesahuje povolenou velikost:',
'error-instance' => 'Nahraný soubor by měl být instance UploadedFile',
'error-invalid' => 'Chybný požadavek',
'error-other' => 'Nečekaná chyba:',
'error-too-large' => 'Request entity too large!',
'btn-upload' => 'Nahrajte soubor (y)',
'btn-uploading' => 'Nahráváme...',
'btn-close' => 'Zrušit',
'btn-crop' => 'Oříznout',
'btn-copy-crop' => 'Zkopírovat a oříznout',
'btn-crop-free' => 'Volné',
'btn-cancel' => 'Zrušit',
'btn-confirm' => 'Povrdiť',
'btn-resize' => 'Zmenšit',
'btn-open' => 'Otevřít složku',
'resize-ratio' => 'Ratio:',
'resize-scaled' => 'Obrázek zmenšený:',
'resize-true' => 'Ano',
'resize-old-height' => 'Původní výška:',
'resize-old-width' => 'Původní šířka:',
'resize-new-height' => 'Výška:',
'resize-new-width' => 'Šířka:',
];

View File

@@ -1,72 +1,84 @@
<?php
return [
'nav-back' => 'Zurück',
'nav-new' => 'Neuer Ordner',
'nav-upload' => 'Hochladen',
'nav-thumbnails' => 'Thumbnails',
'nav-list' => 'List',
'nav-back' => 'Zurück',
'nav-new' => 'Neuer Ordner',
'nav-upload' => 'Hochladen',
'nav-thumbnails' => 'Thumbnails',
'nav-list' => 'Liste',
'nav-sort' => 'Sortierung',
'nav-sort-alphabetic' => 'Alphabetisch',
'nav-sort-time' => 'Datum',
'menu-rename' => 'Umbenennen',
'menu-delete' => 'Löschen',
'menu-view' => 'Ansehen',
'menu-download' => 'Download',
'menu-resize' => 'Größe Ändern',
'menu-crop' => 'Zuschneiden',
'menu-rename' => 'Umbenennen',
'menu-delete' => 'Löschen',
'menu-view' => 'Ansehen',
'menu-download' => 'Download',
'menu-resize' => 'Größe Ändern',
'menu-crop' => 'Zuschneiden',
'menu-move' => 'Verschieben',
'menu-multiple' => 'Mehrfachauswahl',
'title-page' => 'File Manager',
'title-panel' => 'FileManager',
'title-upload' => 'Datei hochladen',
'title-view' => 'Datei ansehen',
'title-root' => 'Dateien',
'title-shares' => 'Gemeinsame Dateien',
'title-item' => 'Item',
'title-size' => 'Größe',
'title-type' => 'Typ',
'title-modified' => 'Geändert',
'title-action' => 'Aktion',
'title-page' => 'File Manager',
'title-panel' => 'FileManager',
'title-upload' => 'Datei hochladen',
'title-view' => 'Datei ansehen',
'title-user' => 'Dateien',
'title-share' => 'Gemeinsame Dateien',
'title-item' => 'Item',
'title-size' => 'Größe',
'title-type' => 'Typ',
'title-modified' => 'Geändert',
'title-action' => 'Aktion',
'type-folder' => 'Ordner',
'type-folder' => 'Ordner',
'message-empty' => 'Ordner ist leer.',
'message-choose' => 'Datei wählen',
'message-delete' => 'Sind Sie sicher, dass Sie dieses Einzelteil löschen möchten?',
'message-name' => 'Ordnernamen:',
'message-rename' => 'Umbenennen in:',
'message-empty' => 'Ordner ist leer.',
'message-choose' => 'Datei wählen',
'message-delete' => 'Sind Sie sicher, dass Sie dieses Einzelteil löschen möchten?',
'message-name' => 'Ordnernamen:',
'message-rename' => 'Umbenennen in:',
'message-extension_not_found' => 'Installieren Sie gd oder imagick Erweiterung um Bilder zuzuschneiden, Größe ändern und Thumbnails zu erstellen.',
'message-drop' => 'Oder legen Sie hier Dateien zum Hochladen ab',
'error-rename' => 'Dateiname wird bereits verwendet!',
'error-file-empty' => 'Sie müssen eine Datei auswählen!',
'error-file-exist' => 'Eine Datei mit diesem Namen existiert bereits!',
'error-file-size' => 'Dateigröße überschreitet das Serverlimit! (Maximale Größe: :max)',
'error-delete-folder' => 'Sie können diesen Ordner nicht löschen, da er nicht leer ist!',
'error-folder-name' => 'Der Ordnername darf nicht leer sein!',
'error-folder-exist' => 'Ein Ordner mit diesem Namen ist bereits vorhanden!',
'error-folder-alnum' => 'Nur alphanumerische Ordnernamen sind erlaubt!',
'error-mime' => 'Unerwarteter Mimetyp:',
'error-instance' => 'Die hochgeladene Datei sollte eine Instanz von UploadedFile sein',
'error-invalid' => 'Ungültige Upload-Anfrage',
'error-other' => 'Ein Fehler ist aufgetreten: ',
'error-too-large' => 'Angeforderter Wert zu groß!',
'error-cannotupload' => 'Sie sind nicht berechtigt, die Datei hochzuladen.',
'error-cannotdelete' => 'Sie sind nicht berechtigt, neue Ordner / Dateien zu löschen',
'error-cannotnewdirectory' => 'Sie sind nicht berechtigt, neue Ordner zu erstellen',
'error-cannotrename' => 'Sie sind nicht berechtigt, Ordner / Dateien umzubenennen',
'error-cannotresize' => 'Sie sind nicht berechtigt, die Dateigröße zu ändern',
'error-rename' => 'Dateiname wird bereits verwendet!',
'error-file-name' => 'Dateiname darf nicht leer sein!',
'error-file-empty' => 'Sie müssen eine Datei auswählen!',
'error-file-exist' => 'Eine Datei mit diesem Namen existiert bereits!',
'error-file-size' => 'Dateigröße überschreitet das Serverlimit! (Maximale Größe: :max)',
'error-delete-folder' => 'Sie können diesen Ordner nicht löschen, da er nicht leer ist!',
'error-folder-name' => 'Der Ordnername darf nicht leer sein!',
'error-folder-exist' => 'Ein Ordner mit diesem Namen ist bereits vorhanden!',
'error-folder-alnum' => 'Nur alphanumerische Ordnernamen sind erlaubt!',
'error-folder-not-found' => 'Order nicht gefunden! (:folder)',
'error-mime' => 'Unerwarteter Mimetyp:',
'error-size' => 'Dateigröße überschritten:',
'error-instance' => 'Die hochgeladene Datei sollte eine Instanz von UploadedFile sein',
'error-invalid' => 'Ungültige Upload-Anfrage',
'error-other' => 'Ein Fehler ist aufgetreten: ',
'error-too-large' => 'Angeforderter Wert zu groß!',
'error-cannotupload' => 'Sie sind nicht berechtigt, die Datei hochzuladen.',
'error-cannotdelete' => 'Sie sind nicht berechtigt, neue Ordner / Dateien zu löschen',
'error-cannotnewdirectory' => 'Sie sind nicht berechtigt, neue Ordner zu erstellen',
'error-cannotrename' => 'Sie sind nicht berechtigt, Ordner / Dateien umzubenennen',
'error-cannotresize' => 'Sie sind nicht berechtigt, die Dateigröße zu ändern',
'btn-upload' => 'Datei hochladen',
'btn-uploading' => 'Hochladen...',
'btn-close' => 'Schließen',
'btn-crop' => 'Zuschneiden',
'btn-cancel' => 'Stornieren',
'btn-resize' => 'Größe ändern',
'btn-upload' => 'Datei hochladen',
'btn-uploading' => 'Hochladen...',
'btn-close' => 'Schließen',
'btn-crop' => 'Zuschneiden',
'btn-copy-crop' => 'Kopieren & Zuschneiden',
'btn-crop-free' => 'Frei',
'btn-cancel' => 'Abbrechen',
'btn-confirm' => 'Bestätigen',
'btn-resize' => 'Größe ändern',
'btn-open' => 'Ordner öffnen',
'resize-ratio' => 'Verhältnis:',
'resize-scaled' => 'Bild skaliert:',
'resize-true' => 'Ja',
'resize-old-height' => 'Original Höhe:',
'resize-old-width' => 'Original Breite:',
'resize-new-height' => 'Höhe:',
'resize-new-width' => 'Breite:',
'locale-bootbox' => 'de',
'resize-ratio' => 'Verhältnis:',
'resize-scaled' => 'Bild skaliert:',
'resize-true' => 'Ja',
'resize-old-height' => 'Original Höhe:',
'resize-old-width' => 'Original Breite:',
'resize-new-height' => 'Höhe:',
'resize-new-width' => 'Breite:',
'locale-bootbox' => 'de',
];

View File

@@ -18,8 +18,8 @@ return [
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Ανέβασμα αρχείου',
'title-view' => 'Επισκόπηση αρχείου',
'title-root' => 'Αρχεία',
'title-shares' => 'Κοινόχρηστα αρχεία',
'title-user' => 'Αρχεία',
'title-share' => 'Κοινόχρηστα αρχεία',
'title-item' => 'Αντικείμενο',
'title-size' => 'Μέγεθος',
'title-type' => 'Τύπος',

View File

@@ -16,13 +16,15 @@ return [
'menu-download' => 'Download',
'menu-resize' => 'Resize',
'menu-crop' => 'Crop',
'menu-move' => 'Move',
'menu-multiple' => 'Multi-selection',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Upload File(s)',
'title-view' => 'View File',
'title-root' => 'Files',
'title-shares' => 'Shared Files',
'title-user' => 'Files',
'title-share' => 'Shared Files',
'title-item' => 'Item',
'title-size' => 'Size',
'title-type' => 'Type',
@@ -37,6 +39,7 @@ return [
'message-name' => 'Folder name:',
'message-rename' => 'Rename to:',
'message-extension_not_found' => 'Please install gd or imagick extension to crop, resize, and make thumbnails of images.',
'message-drop' => 'Or drop files here to upload',
'error-rename' => 'File name already in use!',
'error-file-name' => 'File name cannot be empty!',
@@ -60,8 +63,11 @@ return [
'btn-close' => 'Close',
'btn-crop' => 'Crop',
'btn-copy-crop' => 'Copy & Crop',
'btn-crop-free' => 'Free',
'btn-cancel' => 'Cancel',
'btn-confirm' => 'Confirm',
'btn-resize' => 'Resize',
'btn-open' => 'Open Folder',
'resize-ratio' => 'Ratio:',
'resize-scaled' => 'Image scaled:',
@@ -70,6 +76,4 @@ return [
'resize-old-width' => 'Original Width:',
'resize-new-height' => 'Height:',
'resize-new-width' => 'Width:',
'locale-bootbox' => 'en',
];

View File

@@ -6,11 +6,14 @@ return [
'nav-upload' => 'Subir',
'nav-thumbnails' => 'Miniaturas',
'nav-list' => 'Listado',
'nav-sort' => 'Ordenar',
'nav-sort-alphabetic'=> 'Ordenar Alfabéticamente',
'nav-sort-time' => 'Ordenar por Fecha',
'menu-rename' => 'Cambiar Nombre',
'menu-delete' => 'Eliminar',
'menu-view' => 'Ver',
'menu-download' => 'Bajar',
'menu-download' => 'Descargar',
'menu-resize' => 'Redimensionar',
'menu-crop' => 'Recortar',
@@ -18,8 +21,8 @@ return [
'title-panel' => 'Administrador de Archivos',
'title-upload' => 'Subir Archivo',
'title-view' => 'Ver Archivo',
'title-root' => 'Archivos',
'title-shares' => 'Archivos Compartidos',
'title-user' => 'Archivos',
'title-share' => 'Archivos Compartidos',
'title-item' => 'Item',
'title-size' => 'Tamaño',
'title-type' => 'Tipo',
@@ -29,25 +32,34 @@ return [
'type-folder' => 'Carpeta',
'message-empty' => 'Carpeta está vacía.',
'message-choose' => 'Sleccione Archivo',
'message-choose' => 'Seleccione Archivo',
'message-delete' => '¿Está seguro que desea eliminar este item?',
'message-name' => 'Nombre de Carpeta:',
'message-rename' => 'Renombrar a:',
'message-extension_not_found' => '(translation wanted)',
'message-extension_not_found' => 'Por favor instale la extensión gd o imagick para recortar, redimensionar y hacer miniaturas de imágenes.',
'error-rename' => Nombre de Archivo ya existe!',
'error-rename' => El nombre del archivo ya existe!',
'error-file-name' => '¡El nombre del archivo no puede estar vacío!',
'error-file-empty' => '¡Debes escoger un archivo!',
'error-file-exist' => '¡Ya existe un archivo con este nombre!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',
'error-file-size' => '¡El tamaño del archivo supera el límite del servidor! (tamaño máx.: :max)',
'error-delete-folder'=> '¡No puedes eliminar esta carpeta porque no está vacía!',
'error-folder-name' => Nombre de carpeta no puede ser vacío!',
'error-folder-name' => El nombre de carpeta no puede ser vacío!',
'error-folder-exist'=> '¡Ya existe una carpeta con este nombre!',
'error-folder-alnum'=> '¡Únicamente son soportados nombres de carpetas alfanuméricos!',
'error-folder-not-found'=> '¡La carpeta no ha sido encontrada! (:folder)',
'error-mime' => 'MimeType inesperado: ',
'error-size' => 'Supera el tamaño máximo:',
'error-instance' => 'El archivo subido debe ser una instancia de UploadedFile',
'error-invalid' => 'Petición de subida inválida',
'error-other' => 'Se ha producido un error: ',
'error-too-large' => '¡Entidad de petición demasiado grande!',
'btn-upload' => 'Subir Archivo',
'btn-close' => 'Cerrar',
'btn-uploading' => 'Subiendo...',
'btn-close' => 'Cerrar',
'btn-crop' => 'Recortar',
'btn-copy-crop' => 'Copiar y recortar',
'btn-cancel' => 'Cancelar',
'btn-resize' => 'Redimensionar',
@@ -59,6 +71,6 @@ return [
'resize-new-height' => 'Alto:',
'resize-new-width' => 'Ancho:',
'locale-bootbox' => 'en',
'locale-bootbox' => 'es',
];

View File

@@ -16,13 +16,15 @@ return [
'menu-download' => 'دانلود',
'menu-resize' => 'تغییر اندازه',
'menu-crop' => 'برش',
'menu-move' => 'انتقال',
'menu-multiple' => 'انتخاب چندتایی',
'title-page' => 'مدیریت فایل',
'title-panel' => 'مدیریت فایل لاراول',
'title-upload' => 'آپلود کردن فایل',
'title-upload' => 'آپلود فایل',
'title-view' => 'مشاهده فایل',
'title-root' => 'فایل ها',
'title-shares' => 'فایل های اشتراکی',
'title-user' => 'فایل ها',
'title-share' => 'فایل های اشتراکی',
'title-item' => 'آیتم',
'title-size' => 'اندازه',
'title-type' => 'نوع',
@@ -33,19 +35,20 @@ return [
'message-empty' => 'پوشه خالی است.',
'message-choose' => 'انتخاب فایل',
'message-delete' => 'آیا برای حذف این آیتم مطمئن هستید؟',
'message-delete' => 'آیا از حذف این آیتم مطمئن هستید؟',
'message-name' => 'نام پوشه:',
'message-rename' => 'تغییر نام به:',
'message-extension_not_found' => '(translation wanted)',
'message-extension_not_found' => 'لطفا gd یا imagick را برای برش، تغییر اندازه و ایجاد تصویرک نصب کنید.',
'message-drop' => 'یا فایل ها را برای آپلود اینجا رها کنید',
'error-rename' => 'این نام قبلا استفاده شده!',
'error-file-name' => 'نام فایل نباید خالی باشد!',
'error-file-empty' => 'شما باید یک فایل را انتخاب کنید!',
'error-file-exist' => 'یک فایل دیگر با این نام قبلا ایجاد شده است!',
'error-file-empty' => 'باید یک فایل انتخاب کنید!',
'error-file-exist' => 'فایلی با این نام از قبل وجود دارد!',
'error-file-size' => 'محدودیت حجم فایل سرور! (حداکثر حجم: :max)',
'error-delete-folder'=> 'به دلیل خالی نبودن پوشه امکان حذف آن وجود ندارد!',
'error-folder-name' => 'نام پوشه نمی تواند خالی باشد!',
'error-folder-exist'=> 'یک پوشه با این نام قبلا ایجاد شده است!',
'error-folder-exist'=> 'پوشه ای با این نام از قبل وجود دارد!',
'error-folder-alnum'=> 'فقط اسامی الفبایی برای پوشه مجاز است!',
'error-folder-not-found'=> 'پوشه‌ای یافت نشد! (:folder)',
'error-mime' => 'پسوند غیرمجاز: ',
@@ -59,16 +62,20 @@ return [
'btn-uploading' => 'در حال آپلود',
'btn-close' => 'بستن',
'btn-crop' => 'برش',
'btn-copy-crop' => 'برش و ذخیره در فایل جدید',
'btn-crop-free' => 'برش آزاد',
'btn-cancel' => 'انصراف',
'btn-confirm' => 'تایید',
'btn-resize' => 'تغییر اندازه',
'btn-open' => 'باز کردن پوشه',
'resize-ratio' => 'نسبت:',
'resize-scaled' => 'تصویر مفیاس شده:',
'resize-scaled' => 'تصویر مقیاس شده:',
'resize-true' => 'بله',
'resize-old-height' => 'ارتفاع اصلی:',
'resize-old-width' => 'پهنای اصلی:',
'resize-old-width' => 'عرض اصلی:',
'resize-new-height' => 'ارتفاع:',
'resize-new-width' => 'پهنا:',
'resize-new-width' => 'عرض:',
'locale-bootbox' => 'fa',
];

View File

@@ -0,0 +1,79 @@
<?php
return [
'nav-back' => 'Takaisin',
'nav-new' => 'Uusi kansio',
'nav-upload' => 'Lähetä',
'nav-thumbnails' => 'Esikatselukuva',
'nav-list' => 'Lista',
'nav-sort' => 'Järjestä',
'nav-sort-alphabetic' => 'Lajittele aakkosten mukaan',
'nav-sort-time' => 'Lajittele ajan mukaan ',
'menu-rename' => 'Nimeä uudestaan',
'menu-delete' => 'Poista',
'menu-view' => 'Esikatsele',
'menu-download' => 'Lataa',
'menu-resize' => 'Muuta kokoa',
'menu-crop' => 'Rajaa',
'menu-move' => 'Siirrä',
'menu-multiple' => 'Monivalinta',
'title-page' => 'Tiedostonhallinta',
'title-panel' => 'Laravel tiedostonhallinta',
'title-upload' => 'Lähetä tiedosto(ja)',
'title-view' => 'Näytä tiedosto',
'title-user' => 'Tiedostot',
'title-share' => 'Yhteiset tiedostot',
'title-item' => 'Kohde',
'title-size' => 'Koko',
'title-type' => 'Tyyppi',
'title-modified' => 'Muokattu',
'title-action' => 'Toiminto',
'type-folder' => 'Kansio',
'message-empty' => 'Kansio on tyhjä.',
'message-choose' => 'Valitse tiedosto(t)',
'message-delete' => 'Oletko varma että haluat poistaa tämän kohteen?',
'message-name' => 'Kansion nimi:',
'message-rename' => 'Uusi nimi:',
'message-extension_not_found' => 'Asenna gd tai imagick -laajennos rajausta, koon muuttamista ja esikatselukuvien luomiseen.',
'message-drop' => 'Tai pudota tiedostot tähän lähettääksesi',
'error-rename' => 'Tiedostoniumi on jo käytössä!',
'error-file-name' => 'Tiedostonimi ei voi olla tyhjä!',
'error-file-empty' => 'Sinun täytyy valita tiedosto!',
'error-file-exist' => 'Samanniminen tiedosto on jo olemassa!',
'error-file-size' => 'Tiedoston koko on suurempi kuin palvelimella määritelty maksimi: :max',
'error-delete-folder' => 'Et voi poistaa tätä kansiota. Se ei ole tyhjä!',
'error-folder-name' => 'Kansion nimi ei voi olla tyhjä!',
'error-folder-exist' => 'Samanniminen kansio on jo olemassa!',
'error-folder-alnum' => 'Vain kirjaimet sekä numerot ovat sallittuja kansion nimissä!',
'error-folder-not-found' => 'Kansiota :folder ei löytynyt',
'error-mime' => 'Odottamaton Mime -typpi: ',
'error-size' => 'Koko on yli rajan, koko:',
'error-instance' => 'Lähetetyn tiedoston pitäisi olla UploadedFile -instanssi',
'error-invalid' => 'Väärä latauspyyntö',
'error-other' => 'Tapahtui virhe: ',
'error-too-large' => 'Pyynnön koko on liian suuri!',
'btn-upload' => 'Lähetä tiedosto(ja)',
'btn-uploading' => 'Lähetetään...',
'btn-close' => 'Sulje',
'btn-crop' => 'Rajaa',
'btn-copy-crop' => 'Kopioi & rajaa',
'btn-crop-free' => 'Vapaa',
'btn-cancel' => 'Peruuta',
'btn-confirm' => 'Varmista',
'btn-resize' => 'Muuta kokoa',
'btn-open' => 'Avaa kansio',
'resize-ratio' => 'Suhde:',
'resize-scaled' => 'Kuva skaalattu:',
'resize-true' => 'Kyllä',
'resize-old-height' => 'Alkuperäinen korkeus:',
'resize-old-width' => 'Alkuperäinen leveys:',
'resize-new-height' => 'Korkeus:',
'resize-new-width' => 'Leveys:',
];

View File

@@ -16,13 +16,15 @@ return [
'menu-download' => 'Télécharger',
'menu-resize' => 'Redimensionner',
'menu-crop' => 'Rogner',
'menu-move' => 'Déplacer',
'menu-multiple' => 'Multi-selection',
'title-page' => 'Gestionnaire de fichiers',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Envoyer un/des fichier(s)',
'title-view' => 'Voir le fichier',
'title-root' => 'Fichiers',
'title-shares' => 'Fichiers partagés',
'title-user' => 'Fichiers',
'title-share' => 'Fichiers partagés',
'title-item' => 'Élement',
'title-size' => 'Taille du fichier',
'title-type' => 'Type de fichier',
@@ -37,8 +39,10 @@ return [
'message-name' => 'Nom du dossier :',
'message-rename' => 'Renommer le dossier :',
'message-extension_not_found' => 'Extension inconnue',
'message-drop' => 'Ou déposez des fichiers ici pour les uploader',
'error-rename' => 'Nom déjà utilisé',
'error-file-name' => 'Nom doit être renseigné !',
'error-file-empty' => 'Veuillez choisir un fichier',
'error-file-exist' => 'Un fichier avec ce nom existe déjà',
'error-file-size' => 'Le fichier dépasse la taille maximale autorisée de :max',
@@ -46,24 +50,32 @@ return [
'error-folder-name' => 'Le nom du dossier ne peut pas être vide',
'error-folder-exist'=> 'Un dossier avec ce nom existe déjà',
'error-folder-alnum'=> 'Seuls les caractéres alphanumériques sont autorisés',
'error-mime' => 'Type de fichier MIME non autorisé: ',
'error-folder-not-found'=> 'Le dossier n\'a pas été trouvé ! (:folder)',
'error-mime' => 'Type de fichier MIME non autorisé : ',
'error-size' => 'Poids supérieur à la limite :',
'error-instance' => 'Le fichier doit être une instance de UploadedFile',
'error-invalid' => "Requête d'upload invalide",
'error-other' => 'Une erreur est survenue : ',
'error-too-large' => 'Request entity too large!',
'btn-upload' => 'Envoyer le/les fichier(s)',
'btn-uploading' => 'Envoi...',
'btn-close' => 'Fermer',
'btn-crop' => 'Rogner',
'btn-copy-crop' => 'Copier & Rogner',
'btn-crop-free' => 'Libre',
'btn-cancel' => 'Annuler',
'btn-confirm' => 'Confirm',
'btn-resize' => 'Redimensionner',
'btn-open' => 'Ouvrir le répertoire',
'resize-ratio' => 'Ratio:',
'resize-scaled' => "Image à l'échelle:",
'resize-true' => 'Oui',
'resize-old-height' => 'Hauteur originale:',
'resize-old-width' => 'Largeur originale:',
'resize-new-height' => 'Hauteur',
'resize-new-width' => 'Largeur',
'resize-old-height' => 'Hauteur originale :',
'resize-old-width' => 'Largeur originale :',
'resize-new-height' => 'Hauteur :',
'resize-new-width' => 'Largeur :',
'locale-bootbox' => 'fr',
];

View File

@@ -18,8 +18,8 @@ return [
'title-panel' => 'מנהל קבצים',
'title-upload' => 'העלאת קובץ',
'title-view' => 'צפייה בקובץ',
'title-root' => 'קבצים',
'title-shares' => 'קבצים משותפים',
'title-user' => 'קבצים',
'title-share' => 'קבצים משותפים',
'title-item' => 'פריט',
'title-size' => 'גודל',
'title-type' => 'סוג',

View File

@@ -16,13 +16,15 @@ return [
'menu-download' => 'Letöltés',
'menu-resize' => 'Átméretezés',
'menu-crop' => 'Vágás',
'menu-move' => 'Mozgatás',
'menu-multiple' => 'Több-kiválasztás',
'title-page' => 'Fájlkezelő',
'title-panel' => 'Fájlkezelő',
'title-upload' => 'Fájl feltöltés',
'title-view' => 'Fájl megtekintés',
'title-root' => 'Fájlok',
'title-shares' => 'Megosztott fájlok',
'title-user' => 'Fájlok',
'title-share' => 'Megosztott fájlok',
'title-item' => 'Elem',
'title-size' => 'Méret',
'title-type' => 'Típus',
@@ -34,9 +36,10 @@ return [
'message-empty' => 'A mappa üres.',
'message-choose' => 'Fájl kiválasztása',
'message-delete' => 'Biztos vagy benne, hogy törölni akarod az elemet?',
'message-name' => 'Mappa név:',
'message-name' => 'Mappa neve:',
'message-rename' => 'Átnevezés erre:',
'message-extension_not_found' => 'Kérlek telepítsd a gd vagy az imagick kiterjesztést a vágáshoz, átméretezéshez, és a képek miniatűr elemeinek elkészítéséhez.',
'message-drop' => 'Vagy húzd ide a fájlt',
'error-rename' => 'A fájl neve használatban!',
'error-file-name' => 'A fájlnév nem lehet üres!',
@@ -55,16 +58,19 @@ return [
'error-other' => 'Hiba történt: ',
'error-too-large' => 'Túl nagyméretű a fájl!',
'btn-upload' => 'Fájl feltöltés',
'btn-upload' => 'Fájl feltöltése',
'btn-uploading' => 'Feltöltés folyamatban...',
'btn-close' => 'Bezárás',
'btn-crop' => 'Vágás',
'btn-copy-crop' => 'Másolás és vágás',
'btn-cancel' => 'Mégse',
'btn-crop-free' => 'Szabad',
'btn-cancel' => 'Mégsem',
'btn-confirm' => 'Elfogad',
'btn-resize' => 'Átméretezés',
'btn-open' => 'Mappa megnyitása',
'resize-ratio' => 'Arány:',
'resize-scaled' => 'Kép méretarány:',
'resize-scaled' => 'Méretarány:',
'resize-true' => 'Igen',
'resize-old-height' => 'Eredeti magasság:',
'resize-old-width' => 'Eredeti szélesség:',

View File

@@ -0,0 +1,79 @@
<?php
return [
'nav-back' => 'Kembali',
'nav-new' => 'Buat Direktori',
'nav-upload' => 'Unggah',
'nav-thumbnails' => 'Thumbnail',
'nav-list' => 'Daftar',
'nav-sort' => 'Urutkan',
'nav-sort-alphabetic'=> 'Urutkan Abjad',
'nav-sort-time' => 'Urutkan Waktu',
'menu-rename' => 'Ganti Nama',
'menu-delete' => 'Hapus',
'menu-view' => 'Pratinjau',
'menu-download' => 'Unduh',
'menu-resize' => 'Ubah Ukuran',
'menu-crop' => 'Potong',
'menu-move' => 'Pindah',
'menu-multiple' => 'Pilih Banyak',
'title-page' => 'Manajemen Berkas',
'title-panel' => 'Manajemen Berkas Laravel',
'title-upload' => 'Unggah Berkas',
'title-view' => 'Lihat Berkas',
'title-user' => 'Berkas',
'title-share' => 'Berkas yang Dibagikan',
'title-item' => 'Item',
'title-size' => 'Ukuran',
'title-type' => 'Tipe',
'title-modified' => 'Diubah',
'title-action' => 'Aksi',
'type-folder' => 'Direktori',
'message-empty' => 'Direktori kosong.',
'message-choose' => 'Pilih berkas',
'message-delete' => 'Anda yakin ingin menghapus item ini?',
'message-name' => 'Nama Direktori:',
'message-rename' => 'Ubah Menjadi:',
'message-extension_not_found' => 'Silakan instal ekstensi gd atau imagick untuk memotong, mengubah ukuran, dan membuat thumbnail gambar.',
'message-drop' => 'Atau letakkan berkas di sini untuk mengunggah',
'error-rename' => 'Nama berkas sudah digunakan!',
'error-file-name' => 'Nama berkas tidak boleh kosong!',
'error-file-empty' => 'Anda harus memilih berkas!',
'error-file-exist' => 'Berkas dengan nama ini sudah ada!',
'error-file-size' => 'Ukuran berkas melebihi batas peladen! (ukuran maksimum size: :max)',
'error-delete-folder'=> 'Anda tidak dapat menghapus direktori ini karena tidak kosong!',
'error-folder-name' => 'Nama direktori tidak boleh kosong!',
'error-folder-exist'=> 'Direktori dengan nama ini sudah ada!',
'error-folder-alnum'=> 'Hanya nama direktori alfanumerik yang diizinkan!',
'error-folder-not-found'=> 'Direktori tidak ditemukan! (:folder)',
'error-mime' => 'Kesalahan MimeType: ',
'error-size' => 'Ukuran melebihi batas:',
'error-instance' => 'Berkas yang diunggah harus merupakan instance dari UploadedFile',
'error-invalid' => 'Unggahan tidak valid',
'error-other' => 'Sebuah kesalahan telah terjadi: ',
'error-too-large' => 'Permintaan entitas terlalu besar!',
'btn-upload' => 'Unggah Berkas',
'btn-uploading' => 'Mengunggah...',
'btn-close' => 'Tutup',
'btn-crop' => 'Potong',
'btn-copy-crop' => 'Salin & Potong',
'btn-crop-free' => 'Bebas',
'btn-cancel' => 'Batal',
'btn-confirm' => 'Konfirmasi',
'btn-resize' => 'Ubah Ukuran',
'btn-open' => 'Buka Direktori',
'resize-ratio' => 'Rasio:',
'resize-scaled' => 'Gambar diskalakan:',
'resize-true' => 'Ya',
'resize-old-height' => 'Tinggi Asli:',
'resize-old-width' => 'Lebar Asli:',
'resize-new-height' => 'Tinggi:',
'resize-new-width' => 'Lebar:',
];

View File

@@ -0,0 +1,76 @@
<?php
// Translator: Buonsito.it - Silvia Ghignone
return [
'nav-back' => 'Indietro',
'nav-new' => 'Nuova Cartella',
'nav-upload' => 'Carica',
'nav-thumbnails' => 'Anteprima',
'nav-list' => 'Elencare',
'nav-sort' => 'Ordinare',
'nav-sort-alphabetic'=> 'Ordine Alfabetico',
'nav-sort-time' => 'Ordine Temporale',
'menu-rename' => 'Rinomina',
'menu-delete' => 'Elimina',
'menu-view' => 'Anteprima',
'menu-download' => 'Scarica',
'menu-resize' => 'Ridimensiona',
'menu-crop' => 'Taglia',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Carica File(s)',
'title-view' => 'Vedi File',
'title-user' => 'Files',
'title-share' => 'Files Condivisi',
'title-item' => 'Voce',
'title-size' => 'Dimensione',
'title-type' => 'Tipo',
'title-modified' => 'Modificato',
'title-action' => 'Azione',
'type-folder' => 'Cartella',
'message-empty' => 'La cartella è vuota.',
'message-choose' => 'Scegli i File(s)',
'message-delete' => 'Sei sicuro di voler cancellare questa voce?',
'message-name' => 'Nome Cartella:',
'message-rename' => 'Rinomina:',
'message-extension_not_found' => 'Per favore installa gd oppure la estensione di imagick per tagliare, ridimensionare e creare anteprime delle immagini.',
'error-rename' => 'Il nome del file è già in uso!',
'error-file-name' => 'Il nome del file non può essere vuoto!',
'error-file-empty' => 'Devi scegliere un file!',
'error-file-exist' => 'Esiste già un file con questo nome!',
'error-file-size' => 'La dimensione del file eccede il limite del server! (dimensione massima: :max)',
'error-delete-folder'=> 'Non puoi cancellare questa cartella perchè non è vuota!',
'error-folder-name' => 'Il nome della cartella non può essere vuoto!',
'error-folder-exist'=> 'Esiste già una cartella con questo nome!',
'error-folder-alnum'=> 'Si può nominare una cartella solo con caratteri alfanumerici!',
'error-folder-not-found'=> 'Cartella non trovata! (:folder)',
'error-mime' => 'Unexpected MimeType: ',
'error-size' => 'Superato il limite di dimensione:',
'error-instance' => 'Il file caricato deve essere una istanza di UploadedFile',
'error-invalid' => 'Richiesta di caricamento non valida',
'error-other' => 'Si è veriifcato un errore: ',
'error-too-large' => 'Richiesta di entità troppo grande!',
'btn-upload' => 'Carica File(s)',
'btn-uploading' => 'Sto Caricando...',
'btn-close' => 'Chiudi',
'btn-crop' => 'Taglia',
'btn-copy-crop' => 'Copia & Taglia',
'btn-cancel' => 'Cancella',
'btn-resize' => 'Ridimensiona',
'resize-ratio' => 'Proporzione:',
'resize-scaled' => 'Immagine scalata:',
'resize-true' => 'Sì',
'resize-old-height' => 'Altezza Originale:',
'resize-old-width' => 'Larghezza Originale:',
'resize-new-height' => 'Altezza:',
'resize-new-width' => 'Larghezza:',
'locale-bootbox' => 'it',
];

View File

@@ -16,13 +16,15 @@ return [
'menu-download' => 'Download',
'menu-resize' => 'Formaat aanpassen',
'menu-crop' => 'Bijsnijden',
'menu-move' => 'Verplaatsen',
'menu-multiple' => 'Multi-selectie',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Bestand uploaden',
'title-view' => 'Bestand bekijken',
'title-root' => 'Bestanden',
'title-shares' => 'Openbare map',
'title-user' => 'Bestanden',
'title-share' => 'Openbare map',
'title-item' => 'Item',
'title-size' => 'Grootte',
'title-type' => 'Type',
@@ -37,6 +39,7 @@ return [
'message-name' => 'Mapnaam:',
'message-rename' => 'Hernoemen naar:',
'message-extension_not_found' => 'Installeer de GD of Imagick extensie om afbeeldingen te kunnen bewerken.',
'message-drop' => 'Of sleep bestanden naar hier om te uploaden',
'error-rename' => 'Bestandsnaam is al in gebruik!',
'error-file-empty' => 'U dient een bestand te kiezen!',
@@ -58,8 +61,11 @@ return [
'btn-close' => 'Sluiten',
'btn-crop' => 'Bijsnijden',
'btn-copy-crop' => 'Kopiëren & Bijsnijden',
'btn-crop-free' => 'Vrij',
'btn-cancel' => 'Annuleren',
'btn-confirm' => 'Bevestigen',
'btn-resize' => 'Formaat aanpassen',
'btn-open' => 'Map openen',
'resize-ratio' => 'Ratio:',
'resize-scaled' => 'Afbeelding geschaald:',

View File

@@ -6,6 +6,9 @@ return [
'nav-upload' => 'Wgraj plik',
'nav-thumbnails' => 'Miniaturki',
'nav-list' => 'Lista',
'nav-sort' => 'Sortuj',
'nav-sort-alphabetic'=> 'Sortuj alfabetycznie',
'nav-sort-time' => 'Sortuj według czasu',
'menu-rename' => 'Zmień nazwę',
'menu-delete' => 'Usuń',
@@ -13,13 +16,15 @@ return [
'menu-download' => 'Pobierz',
'menu-resize' => 'Zmień rozmiar',
'menu-crop' => 'Przytnij',
'menu-move' => 'Przenieś',
'menu-multiple' => 'Zaznacz wiele',
'title-page' => 'Menedżer plików',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Wgraj plik',
'title-view' => 'Podgląd',
'title-root' => 'Pliki',
'title-shares' => 'Udostępnione pliki',
'title-user' => 'Pliki',
'title-share' => 'Udostępnione pliki',
'title-item' => 'Nazwa',
'title-size' => 'Rozmiar',
'title-type' => 'Typ',
@@ -34,6 +39,7 @@ return [
'message-name' => 'Nazwa folderu:',
'message-rename' => 'Zmień nazwę:',
'message-extension_not_found' => 'Niestety, nie znaleziono wymaganych rozszerzeń. Zainstaluj gd lub imagick aby manipulować grafiką',
'message-drop' => 'lub upuść pliki tutaj, aby je przesłać',
'error-rename' => 'Niestety, istnieje już plik o takiej nazwie!',
'error-file-empty' => 'You must choose a file!',
@@ -43,7 +49,9 @@ return [
'error-folder-name' => 'Nazwa folderu nie może być pusta!',
'error-folder-exist'=> 'Folder o tej nazwie już istnieje!',
'error-folder-alnum'=> 'Dozwolone są jedynie nazwy alfanumeryczne!',
'error-folder-not-found'=> 'Nie znaleziono folderu! (:folder)',
'error-mime' => 'Nierozpoznawany MimeType: ',
'error-size' => 'Przekroczono limit rozmiaru:',
'error-instance' => 'Wgrywany obiekt powinien być instanją UploadedFile',
'error-invalid' => 'Nieprawidłowe zapytanie',
'error-other' => 'Napotkano następujący błąd: ',
@@ -55,6 +63,10 @@ return [
'btn-crop' => 'Przytnij',
'btn-cancel' => 'Anuluj',
'btn-resize' => 'Zmień rozmiar',
'btn-confirm' => 'Zatwierdź',
'btn-copy-crop' => 'Kopiuj przycięte',
'btn-crop-free' => 'Skaluj',
'btn-open' => 'Otwórz',
'resize-ratio' => 'Stosunek:',
'resize-scaled' => 'Zmieniono rozmiar:',

View File

@@ -6,6 +6,9 @@ return [
'nav-upload' => 'Enviar',
'nav-thumbnails' => 'Miniatura',
'nav-list' => 'Lista',
'nav-sort' => 'Ordenar',
'nav-sort-alphabetic'=> 'Ordenar alfabeticamente',
'nav-sort-time' => 'Ordenar por data',
'menu-rename' => 'Renomear',
'menu-delete' => 'Deletar',
@@ -13,13 +16,15 @@ return [
'menu-download' => 'Download',
'menu-resize' => 'Redimensionar',
'menu-crop' => 'Cortar',
'menu-move' => 'Mover',
'menu-multiple' => 'Selecionar vários',
'title-page' => 'Gerenciador de Arquivos',
'title-panel' => 'Gerenciador de Arquivos',
'title-upload' => 'Envio de Arquivo',
'title-view' => 'Ver Arquivo',
'title-root' => 'Arquivos',
'title-shares' => 'Arquivos Compartilhados',
'title-user' => 'Arquivos',
'title-share' => 'Arquivos Compartilhados',
'title-item' => 'Item',
'title-size' => 'Tamanho',
'title-type' => 'Tipo',
@@ -34,8 +39,10 @@ return [
'message-name' => 'Nome da pasta:',
'message-rename' => 'Renomear para:',
'message-extension_not_found' => 'Por favor instale a extenção gd ou imagick para recortar, redimensionar e criar miniaturas das imagens.',
'message-drop' => 'Solte seus arquivos aqui',
'error-rename' => 'Nome de arquivo já está em uso!',
'error-file-name' => 'O nome do arquivo não pode estar vazio!',
'error-file-empty' => 'Você deve escolher um arquivo!',
'error-file-exist' => 'Um arquivo com este nome já existe!',
'error-file-size' => 'Tamanho do arquivo excedeu o limite permitido pelo servidor! (Tamanho máximo: :max)',
@@ -43,16 +50,24 @@ return [
'error-folder-name' => 'Nome da pasta não pode ser vazio!',
'error-folder-exist'=> 'Uma pasta com este nome já existe!',
'error-folder-alnum'=> 'Permitido somente caracteres alfanuméricos para nomes de pastas!',
'error-folder-not-found'=> 'A pasta não foi encontrada! (:folder)',
'error-mime' => 'MimeType inesperado: ',
'error-instance' => 'The uploaded file should be an instance of UploadedFile',
'error-invalid' => 'Invalid upload request',
'error-size' => 'Excede o tamanho máximo:',
'error-instance' => 'O arquivo enviado deve ser uma instância de UploadedFile',
'error-invalid' => 'Pedido de upload inválido',
'error-other' => 'Ocorreu um erro: ',
'error-too-large' => 'Solicitar entidade muito grande!',
'btn-upload' => 'Enviar Arquivo',
'btn-uploading' => 'Enviando...',
'btn-close' => 'Fechar',
'btn-crop' => 'Cortar',
'btn-copy-crop' => 'Copie e corte',
'btn-crop-free' => 'Livre',
'btn-cancel' => 'Cancelar',
'btn-confirm' => 'Confirmar',
'btn-resize' => 'Redimensionar',
'btn-open' => 'Abrir Pasta',
'resize-ratio' => 'Proporção:',
'resize-scaled' => 'Imagem dimensionada:',

View File

@@ -3,9 +3,12 @@
return [
'nav-back' => 'Voltar',
'nav-new' => 'Nova Pasta',
'nav-upload' => 'Upload',
'nav-upload' => 'Enviar',
'nav-thumbnails' => 'Miniatura',
'nav-list' => 'Lista',
'nav-sort' => 'Ordenar',
'nav-sort-alphabetic'=> 'Ordenar alfabeticamente',
'nav-sort-time' => 'Ordenar por data',
'menu-rename' => 'Renomear',
'menu-delete' => 'Apagar',
@@ -18,8 +21,8 @@ return [
'title-panel' => 'Gestor de Arquivos',
'title-upload' => 'Envio de Arquivo',
'title-view' => 'Ver Arquivo',
'title-root' => 'Arquivos',
'title-shares' => 'Arquivos Partilhados',
'title-user' => 'Arquivos',
'title-share' => 'Arquivos Compartilhados',
'title-item' => 'Item',
'title-size' => 'Tamanho',
'title-type' => 'Tipo',
@@ -30,27 +33,33 @@ return [
'message-empty' => 'A pasta está vazia.',
'message-choose' => 'Escolha um arquivo',
'message-delete' => 'Tem a certeza que quer pagar este arquivo?',
'message-delete' => 'Tem a certeza que deseja apagar este arquivo?',
'message-name' => 'Nome da pasta:',
'message-rename' => 'Renomear para:',
'message-extension_not_found' => '(translation wanted)',
'message-extension_not_found' => 'Por favor instale a extenção gd ou imagick para recortar, redimensionar e criar miniaturas das imagens.',
'error-rename' => 'Nome de arquivo já está em uso!',
'error-rename' => 'O nome do arquivo já está em uso!',
'error-file-name' => 'O nome do arquivo não pode ser vazio!',
'error-file-empty' => 'Deve escolher um arquivo!',
'error-file-exist' => 'Um arquivo com este nome já existe!',
'error-file-size' => 'O tamanho do ficheiro excede o limite permitido! (tamanho máximo: :max)',
'error-delete' => 'Não pode apagar esta pasta, não está vazia!',
'error-folder-name' => 'Nome da pasta não pode ser vazio!',
'error-folder-exist'=> 'Uma pasta com este nome já existe!',
'error-file-exist' => 'Já existe um arquivo com este nome!',
'error-file-size' => 'O tamanho do arquivo excedeu o limite permitido pelo servidor! (Tamanho máximo: :max)',
'error-delete-folder'=> 'Não pode apagar esta pasta. A mesma não se encontra vazia!',
'error-folder-name' => 'O nome da pasta não pode ser vazio!',
'error-folder-exist'=> 'Já existe uma pasta com este nome!',
'error-folder-alnum'=> 'Apenas valores alfanuméricos são permitidos para o nome da pasta!',
'error-folder-not-found'=> 'A pasta não foi encontrada! (:folder)',
'error-mime' => 'Tipo de ficheiro não suportado: ',
'error-instance' => 'O ficheiro carregado deve ser uma instância de UploadedFile',
'error-size' => 'O ficheiro excede o tamanho máximo:',
'error-instance' => 'O arquivo enviado deve ser uma instância de UploadedFile',
'error-invalid' => 'Pedido de upload inválido',
'error-other' => 'Ocorreu um erro: ',
'error-too-large' => 'Solicitação muito grande!',
'btn-upload' => 'Enviar Arquivo',
'btn-uploading' => 'A enviar...',
'btn-close' => 'Fechar',
'btn-crop' => 'Cortar',
'btn-copy-crop' => 'Copie e corte',
'btn-cancel' => 'Cancelar',
'btn-resize' => 'Redimensionar',

View File

@@ -6,6 +6,9 @@ return [
'nav-upload' => 'Încarcă',
'nav-thumbnails' => 'Miniatură',
'nav-list' => 'Listă',
'nav-sort' => 'Sortează',
'nav-sort-alphabetic'=> 'După Alfabet',
'nav-sort-time' => 'După timp',
'menu-rename' => 'Redenumește',
'menu-delete' => 'Șterge',
@@ -13,13 +16,15 @@ return [
'menu-download' => 'Descarcă',
'menu-resize' => 'Redimensionează',
'menu-crop' => 'Taie',
'menu-move' => 'Mută',
'menu-multiple' => 'Selectare multiplă',
'title-page' => 'Manager fișiere',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Încarcă fișier(e)',
'title-view' => 'Vezi fișier',
'title-root' => 'Fișiere',
'title-shares' => 'Fișiere distribuite',
'title-user' => 'Fișiere',
'title-share' => 'Fișiere distribuite',
'title-item' => 'Element',
'title-size' => 'Dimensiune',
'title-type' => 'Tip',
@@ -34,6 +39,7 @@ return [
'message-name' => 'Nume folder:',
'message-rename' => 'Redenumește în:',
'message-extension_not_found' => 'Te rog instalează extensia gd sau imagick ca să poți tăia, redimensiona sau genera miniaturi ale imaginilor.',
'message-drop' => 'Sau trageți fișierele aici pentru încărcare',
'error-rename' => 'Nume fișier este deja folosit!',
'error-file-name' => 'Numele fișierului nu poate fi gol!',
@@ -45,7 +51,7 @@ return [
'error-folder-exist'=> 'Există deja un folder cu acest nume!',
'error-folder-alnum'=> 'Sunt permise doar nume alfanumerice pentru foldere!',
'error-folder-not-found'=> 'Folderul nu a fost gasit! (:folder)',
'error-mime' => 'Unexpected MimeType: ',
'error-mime' => 'MimeType necunoscut: ',
'error-size' => 'Dimensiune peste limită:',
'error-instance' => 'Fișierul încărcat trebuie să fie o instanță a UploadedFile',
'error-invalid' => 'Cerere invalidă de upload',
@@ -56,8 +62,12 @@ return [
'btn-uploading' => 'Încarcare...',
'btn-close' => 'Închide',
'btn-crop' => 'Taie',
'btn-copy-crop' => 'Copiază și Taie',
'btn-crop-free' => 'Tăiere liberă',
'btn-cancel' => 'Anulează',
'btn-confirm' => 'Confirmă',
'btn-resize' => 'Redimensionează',
'btn-open' => 'Deschide folder',
'resize-ratio' => 'Rație:',
'resize-scaled' => 'Imagine scalată:',

View File

@@ -0,0 +1,79 @@
<?php
return [
'nav-back' => 'Nazad',
'nav-new' => 'Nova fascikla',
'nav-upload' => 'Otpremiti',
'nav-thumbnails' => 'Sličice',
'nav-list' => 'Lista',
'nav-sort' => 'Poredaj',
'nav-sort-alphabetic' => 'Poredaj po abecedi',
'nav-sort-time' => 'Poredaj po vremenu',
'menu-rename' => 'Preimenuj',
'menu-delete' => 'Izbriši',
'menu-view' => 'Pregled',
'menu-download' => 'Preuzimanje',
'menu-resize' => 'Promenite veličinu',
'menu-crop' => 'Odreži',
'menu-move' => 'Premesti',
'menu-multiple' => 'Višestruki izbor',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Dodaj fajl(ove)',
'title-view' => 'Pogledaj Fajl',
'title-user' => 'Fajlovi',
'title-share' => 'Deljeni fajlovi',
'title-item' => 'Predmet',
'title-size' => 'Veličina',
'title-type' => 'Tip',
'title-modified' => 'Izmenjen',
'title-action' => 'Akcija',
'type-folder' => 'Fascikla',
'message-empty' => 'Mapa je prazna.',
'message-choose' => 'Odaberite datoteke',
'message-delete' => 'Da li ste sigurni da želite da izbrišete ovu stavku?',
'message-name' => 'Ime fascikle:',
'message-rename' => 'Preimenuj u:',
'message-extension_not_found' => 'Instalirajte dodatak gd ili imagick da biste odrezali, promenili veličinu i napravili sličice slika.',
'message-drop' => 'Ili ovde spustite datoteke da biste ih otpremili',
'error-rename' => 'Naziv datoteke se već koristi!',
'error-file-name' => 'Ime datoteke ne može biti prazno!',
'error-file-empty' => 'Morate odabrati datoteku!',
'error-file-exist' => 'Datoteka sa ovim imenom već postoji!',
'error-file-size' => 'Veličina datoteke premašuje ograničenje servera! (maksimalna veličina: :max)',
'error-delete-folder' => 'Ne možete izbrisati ovu fasciklu jer nije prazna!',
'error-folder-name' => 'Ime mape ne može biti prazno!',
'error-folder-exist' => 'Fascikla sa ovim imenom već postoji!',
'error-folder-alnum' => 'Dozvoljena su samo alfanumerička imena mapa!',
'error-folder-not-found' => 'Direktorijum nije pronađen! (:folder)',
'error-mime' => 'Neočekivani MimeTipe: ',
'error-size' => 'Prekoračena veličina:',
'error-instance' => 'Otpremljena datoteka treba da bude instanca UploadedFile',
'error-invalid' => 'Nevažeći zahtev za otpremanje',
'error-other' => 'Došlo do greške: ',
'error-too-large' => 'Entitet zahteva je prevelik!',
'btn-upload' => 'Dodaj fajl(ove)',
'btn-uploading' => 'Otpremanje ...',
'btn-close' => 'Zatvori',
'btn-crop' => 'Odreži',
'btn-copy-crop' => 'Kopiraj i Odreži',
'btn-crop-free' => 'besplatno',
'btn-cancel' => 'Poništiti, otkazati',
'btn-confirm' => 'Potvrdi',
'btn-resize' => 'Promenite veličinu',
'btn-open' => 'Otvori folder',
'resize-ratio' => 'Odnos:',
'resize-scaled' => 'Slika umanjena:',
'resize-true' => 'Da',
'resize-old-height' => 'Originalna visina:',
'resize-old-width' => 'Originalna širina:',
'resize-new-height' => 'Visina:',
'resize-new-width' => 'Širina:',
];

View File

@@ -6,6 +6,9 @@ return [
'nav-upload' => 'Загрузить',
'nav-thumbnails' => 'Миниатюры',
'nav-list' => 'Список',
'nav-sort' => 'Сортировать',
'nav-sort-alphabetic'=> 'Сортировать по алфавиту',
'nav-sort-time' => 'Сортировать по времени',
'menu-rename' => 'Переименовать',
'menu-delete' => 'Удалить',
@@ -13,13 +16,15 @@ return [
'menu-download' => 'Загрузить',
'menu-resize' => 'Изменить размер',
'menu-crop' => 'Обрезать',
'menu-move' => 'Переместить',
'menu-multiple' => 'Multi-выбор',
'title-page' => 'Менеджер файлов',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Загрузка файла',
'title-view' => 'Просмотр файла',
'title-root' => 'Файлы',
'title-shares' => 'Общие файлы',
'title-user' => 'Файлы',
'title-share' => 'Общие файлы',
'title-item' => 'Номер',
'title-size' => 'Размер',
'title-type' => 'Тип',
@@ -30,11 +35,14 @@ return [
'message-empty' => 'Папка пуста.',
'message-choose' => 'Выберите файл',
'message-delete' => 'Вы уверен что хотите данный пункт?',
'message-delete' => 'Вы уверены что хотите это удалить?',
'message-name' => 'Название папки:',
'message-rename' => 'Переименовать в:',
'message-extension_not_found' => 'Требуется установка GD или Imagick расширения для обрезания, масштабирования и создания миниатюр изображений.',
'message-drop' => 'Или переместите сюда файлы для загрузки',
'error-rename' => 'Имя файла уже используется!',
'error-file-name' => 'Имя файла не может быть пустым!',
'error-file-empty' => 'Вы должны выбрать файл!',
'error-file-exist' => 'Файл с этим именем уже существует!',
'error-file-size' => 'Размер файла превышает разрешенный сервером размер! (максимальный размер: :max)',
@@ -42,19 +50,27 @@ return [
'error-folder-name' => 'Имя папки не может быть пустым!',
'error-folder-exist'=> 'Папка с таким названием уже существует!',
'error-folder-alnum'=> 'Название папки должно содержать только цифры и латинские буквы!',
'error-folder-not-found'=> 'Папка не найдена! (:folder)',
'error-mime' => 'Неподдерживаемый MimeType: ',
'error-size' => 'Размер превышает разрешенный:',
'error-instance' => 'Загруженный файл должен быть экземпляром UploadedFile',
'error-invalid' => 'Неверный запрос загрузки',
'error-other' => 'Произошла ошибка: ',
'error-too-large' => 'Размер загружаемого файла слишком велик!',
'btn-upload' => 'Загрузить файл',
'btn-uploading' => 'Загрузка...',
'btn-close' => 'Закрыть',
'btn-crop' => 'Обрезать',
'btn-copy-crop' => 'Скопировать & Обрезать',
'btn-crop-free' => 'Освободить',
'btn-cancel' => 'Отмена',
'btn-confirm' => 'Подтвердить',
'btn-resize' => 'Изменить размер',
'btn-open' => 'Открыть папку',
'resize-ratio' => 'Соотношение:',
'resize-scaled' => 'Масштабировать зображение:',
'resize-scaled' => 'Масштабировать изображение:',
'resize-true' => 'Да',
'resize-old-height' => 'Оригинальная высота:',
'resize-old-width' => 'Оригинальная ширина:',

View File

@@ -0,0 +1,79 @@
<?php
return [
'nav-back' => 'Späť',
'nav-new' => 'Nový priečinok',
'nav-upload' => 'Nahrať',
'nav-thumbnails' => 'Zmenšeniny',
'nav-list' => 'Zoznam',
'nav-sort' => 'Zoradiť',
'nav-sort-alphabetic'=> 'Zoradiť podľa abecedy',
'nav-sort-time' => 'Zoradiť podľa času',
'menu-rename' => 'Premenovať',
'menu-delete' => 'Zmazať',
'menu-view' => 'Zobraziť',
'menu-download' => 'Stiahnuť',
'menu-resize' => 'Zmenšiť',
'menu-crop' => 'Orezať',
'menu-move' => 'Presunúť',
'menu-multiple' => 'Vybrať viacero súborov',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Nahrať súbor(y)',
'title-view' => 'Zobraziť súbor',
'title-user' => 'Moje súbory',
'title-share' => 'Zdieľané súbory',
'title-item' => 'Položka',
'title-size' => 'Veľkosť',
'title-type' => 'Typ',
'title-modified' => 'Modifikované',
'title-action' => 'Akcia',
'type-folder' => 'Priečinok',
'message-empty' => 'Priečinok je prázdny.',
'message-choose' => 'Vyberte súbor(y)',
'message-delete' => 'Naozaj chcete zmazať túto položku?',
'message-name' => 'Názov priečinku:',
'message-rename' => 'Premenovať na:',
'message-extension_not_found' => 'Prosíme nainštalujte gd alebo imagick rozšírenie pre orezávanie, zmenšovanie, alebo vytváranie zmenšenín obrázkov.',
'message-drop' => 'Alebo pretiahnite súbory pre nahratie.',
'error-rename' => 'Tento názov súboru už existuje!',
'error-file-name' => 'Názov súboru nemôže byť prázdny!',
'error-file-empty' => 'Vyberte súbor!',
'error-file-exist' => 'Súbor s tymto názvom už existuje!',
'error-file-size' => 'Veľkosť súboru prekročila limit servera! (Mazimálna veľkosť je: :max)',
'error-delete-folder'=> 'Tento priečinok nie je možné vymazať, kedže nie je prázdny!',
'error-folder-name' => 'Názov priečinku nesmie byť prázdny!',
'error-folder-exist'=> 'Priečinok s tymto názvom už existuje!',
'error-folder-alnum'=> 'Len písmena a čísline su povolené v názve priečinku!',
'error-folder-not-found'=> 'Priečinok nebol nájdeny! (:folder)',
'error-mime' => 'Nepovolený typ súbory: ',
'error-size' => 'Súbor presahuje povolenú veľkosť:',
'error-instance' => 'Nahraný súbor by mal byť inštancie UploadedFile',
'error-invalid' => 'Chybná požiadavka',
'error-other' => 'Nečakaná chyba: ',
'error-too-large' => 'Request entity too large!',
'btn-upload' => 'Nahrajte súbor(y)',
'btn-uploading' => 'Nahrávame...',
'btn-close' => 'Zrušiť',
'btn-crop' => 'Orezať',
'btn-copy-crop' => 'Skopírovať a orezať',
'btn-crop-free' => 'Voľné',
'btn-cancel' => 'Zrušiť',
'btn-confirm' => 'Povrdiť',
'btn-resize' => 'Zmenšiť',
'btn-open' => 'Otvoriť priečinok',
'resize-ratio' => 'Ratio:',
'resize-scaled' => 'Obrázok zmenšený:',
'resize-true' => 'Áno',
'resize-old-height' => 'Pôvodna výška:',
'resize-old-width' => 'Pôvodna šírka:',
'resize-new-height' => 'Výška:',
'resize-new-width' => 'Šírka:',
];

View File

@@ -0,0 +1,75 @@
<?php
return [
'nav-back' => 'Tillbaka',
'nav-new' => 'Ny mapp',
'nav-upload' => 'Ladda up',
'nav-thumbnails' => 'Miniatyrer',
'nav-list' => 'Lista',
'nav-sort' => 'Sortera',
'nav-sort-alphabetic'=> 'Sortera efter alfabetet',
'nav-sort-time' => 'Sortera efter tid',
'menu-rename' => 'Byt namn',
'menu-delete' => 'Ta bort',
'menu-view' => 'Förhandsgranska',
'menu-download' => 'Ladda ner',
'menu-resize' => 'Ändra storlek',
'menu-crop' => 'Beskär',
'title-page' => 'Filhanterare',
'title-panel' => 'Laravel Filhanterare',
'title-upload' => 'Ladda upp fil(er)',
'title-view' => 'Visa fil',
'title-user' => 'Filer',
'title-share' => 'Delade filer',
'title-item' => 'Objekt',
'title-size' => 'Storlek',
'title-type' => 'Typ',
'title-modified' => 'Ändrat',
'title-action' => 'Hantera',
'type-folder' => 'Map',
'message-empty' => 'Mappen är tom',
'message-choose' => 'Välj fil(er)',
'message-delete' => 'Är du säker på att du vill radera det här objektet?',
'message-name' => 'Mappnamn:',
'message-rename' => 'Byt namn till:',
'message-extension_not_found' => 'Vänligen installera gd- eller imagick-tillägget för att beskära, ändra storlek och göra miniatyrer av bilder.',
'error-rename' => 'Filnamnet finns redan!',
'error-file-name' => 'Filnamnet kan inte vara tomt!',
'error-file-empty' => 'Du måste välja en fil!',
'error-file-exist' => 'En fil med detta namn finns redan!',
'error-file-size' => 'Filstorleken överstiger servergränsen! (maximal storlek:: max) ',
'error-delete-folder'=> 'Du kan inte radera den här mappen eftersom den inte är tom!',
'error-folder-name' => 'Mappnamnet kan inte vara tomt!',
'error-folder-exist'=> 'En mapp med detta namn finns redan!',
'error-folder-alnum'=> 'Endast alfanumeriska mappnamn är tillåtna!',
'error-folder-not-found'=> 'Mappen hittades inte! (:folder)',
'error-mime' => 'Oväntad MimeType: ',
'error-size' => 'Över storleksgräns:',
'error-instance' => 'Den uppladdade filen måste vara en typ UploadedFile',
'error-invalid' => 'Ogiltig uppladdningsförfrågan',
'error-other' => 'Ett fel har uppstått:',
'error-too-large' => 'Objektet i begäran är för stor!',
'btn-upload' => 'Ladda upp fil(er)',
'btn-uploading' => 'Laddar upp...',
'btn-close' => 'Stäng',
'btn-crop' => 'Beskär',
'btn-copy-crop' => 'Kopiera & Beskär',
'btn-cancel' => 'Avbryt',
'btn-resize' => 'Ändra stolek',
'resize-ratio' => 'Förhållande:',
'resize-scaled' => 'Bildskala:',
'resize-true' => 'Ja',
'resize-old-height' => 'Original höjd:',
'resize-old-width' => 'Original bredd:',
'resize-new-height' => 'Höjd:',
'resize-new-width' => 'Bredd:',
'locale-bootbox' => 'sv',
];

View File

@@ -16,13 +16,15 @@ return [
'menu-download' => 'İndir',
'menu-resize' => 'Boyutlandır',
'menu-crop' => 'Kırp',
'menu-move' => 'Taşı',
'menu-multiple' => 'Çoklu Seçim',
'title-page' => 'Dosya Kütüphanesi',
'title-panel' => 'Laravel Dosya Kütüphanesi',
'title-upload' => 'Dosya Yükle',
'title-view' => 'Dosya Gör',
'title-root' => 'Dosyalarım',
'title-shares' => 'Paylaşılan Dosyalar',
'title-user' => 'Dosyalarım',
'title-share' => 'Paylaşılan Dosyalar',
'title-item' => 'Dosya',
'title-size' => 'Boyut',
'title-type' => 'Tür',
@@ -37,6 +39,7 @@ return [
'message-name' => 'Klasör adı:',
'message-rename' => 'Yeni ad:',
'message-extension_not_found' => 'Lütfen resimleri kesmek, yeniden boyutlandırmak ve küçük resimler oluşturmak için gd veya imagick eklentisini yükleyin',
'message-drop' => 'Veya buraya dosyaları sürükle bırak',
'error-rename' => 'Dosya adı kullanımda!',
'error-file-name' => 'Dosya adı boş bırakılamaz!',
@@ -60,8 +63,11 @@ return [
'btn-close' => 'Kapat',
'btn-crop' => 'Kırp',
'btn-copy-crop' => 'Kopyala & Kes',
'btn-crop-free' => 'Serbest',
'btn-cancel' => 'İptal',
'btn-confirm' => 'Onayla',
'btn-resize' => 'Boyutlandır',
'btn-open' => 'Klasörü Aç',
'resize-ratio' => 'Oran:',
'resize-scaled' => 'Boyutlandırıldı:',

View File

@@ -6,6 +6,9 @@ return [
'nav-upload' => 'Завантажити',
'nav-thumbnails' => 'Мініатюри',
'nav-list' => 'Список',
'nav-sort' => 'Сортувати',
'nav-sort-alphabetic'=> 'Сортувати за алфавітом',
'nav-sort-time' => 'Сортувати за часом',
'menu-rename' => 'Перейменувати',
'menu-delete' => 'Вилучити',
@@ -13,13 +16,15 @@ return [
'menu-download' => 'Завантажити',
'menu-resize' => 'Змінити розмір',
'menu-crop' => 'Обрізати',
'menu-move' => 'Перемістити',
'menu-multiple' => 'Multi-виділення',
'title-page' => 'Менеджер файлів',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Завантаження файлу',
'title-view' => 'Перегляд файлу',
'title-root' => 'Файли',
'title-shares' => 'Спільні файли',
'title-user' => 'Файли',
'title-share' => 'Спільні файли',
'title-item' => 'Номер',
'title-size' => 'Розмір',
'title-type' => 'Тип',
@@ -34,6 +39,7 @@ return [
'message-name' => 'Назва папки:',
'message-rename' => 'Перейменувати в:',
'message-extension_not_found' => 'Інсталюйте, будь ласка, розширення GD чи ImageMagick щоб мати можливість кадрувати, змінювати розміри чи створювати ескізи зображень.',
'message-drop' => 'Або перетягніть файли сюди для завантаження',
'error-rename' => 'Ім\'я файлу вже використовується!',
'error-file-name' => 'Ім\'я файлу не може бути порожнім!',
@@ -56,8 +62,12 @@ return [
'btn-uploading' => 'Завантаження...',
'btn-close' => 'Закрити',
'btn-crop' => 'Обрізати',
'btn-copy-crop' => 'Скопіювати & Обрізати',
'btn-crop-free' => 'Звільнити',
'btn-cancel' => 'Скасувати',
'btn-confirm' => 'Підтвердити',
'btn-resize' => 'Змінити розмір',
'btn-open' => 'Відкрити папку',
'resize-ratio' => 'Співвідношення:',
'resize-scaled' => 'Масштабоване зображення:',

View File

@@ -1,67 +1,73 @@
<?php
return [
'nav-back' => 'Quay lại',
'nav-new' => 'Tạo thư mục mới',
'nav-back' => 'Trở lại',
'nav-new' => 'Thư mục mới',
'nav-upload' => 'Tải lên',
'nav-thumbnails' => 'nh đại diện',
'nav-thumbnails' => 'nh thu nhỏ',
'nav-list' => 'Danh sách',
'nav-sort' => 'Sắp xếp',
'nav-sort-alphabetic'=> 'Sắp xếp theo thứ tự Alphabet',
'nav-sort-alphabetic'=> 'Sắp xếp theo bảng chữ cái',
'nav-sort-time' => 'Sắp xếp theo thời gian',
'menu-rename' => 'Đổi tên',
'menu-delete' => 'X',
'menu-delete' => 'Xóa bỏ',
'menu-view' => 'Xem trước',
'menu-download' => 'Tải xuống',
'menu-download' => 'Tải về',
'menu-resize' => 'Thay đổi kích thước',
'menu-crop' => 'Cắt hình',
'menu-crop' => 'Cắt',
'menu-move' => 'Di chuyển',
'menu-multiple' => 'Chọn nhiều',
'title-page' => 'Trình quản lý tập tin',
'title-page' => 'Quản lý tập tin',
'title-panel' => 'Trình quản lý tập tin Laravel',
'title-upload' => 'Tải lên',
'title-view' => 'Xem tập tin',
'title-root' => 'Các tập tin',
'title-shares' => 'Các tập tin được chia s',
'title-upload' => 'Tải lên tập tin',
'title-view' => 'Xem tài liệu',
'title-user' => 'Các tập tin',
'title-share' => 'Thư mục chia s',
'title-item' => 'Mục',
'title-size' => 'Kích thước',
'title-type' => 'Loại',
'title-modified' => 'Đã chỉnh sửa',
'title-action' => 'Hành động',
'title-type' => 'Kiểu',
'title-modified' => 'Sửa đổi',
'title-action' => 'Hoạt động',
'type-folder' => 'Thư mục',
'message-empty' => 'Thư mục trống.',
'message-empty' => 'Thư mục rỗng.',
'message-choose' => 'Chọn tập tin',
'message-delete' => 'Bạn có chắc chắn muốn x mục này?',
'message-delete' => 'Bạn có chắc bạn muốn xóa mục này?',
'message-name' => 'Tên thư mục:',
'message-rename' => 'Đổi tên thành:',
'message-extension_not_found' => 'Vui lòng cài đặt gói mở rộng gd hoặc imagick để cắt, thay đổi kích thước và tạo nh đại điện cho các hình ảnh.',
'message-extension_not_found' => 'Vui lòng cài đặt gd hoặc extension imagick để cắt, thay đổi kích thước và tạo nh thu nhỏ của hình ảnh.',
'message-drop' => 'Hoặc thả tập tin vào đây để tải lên',
'error-rename' => 'Tên tập tin đã được chọn!',
'error-file-name' => 'Tên tập tin không được trống!',
'error-file-empty' => 'Bạn phải lựa chọn 1 tập tin!',
'error-file-exist' => 'Cùng tên với tập tin khác!',
'error-file-size' => 'Kích thước tp tin đạt tối đa! (kích thước tối đa: :max)',
'error-delete-folder'=> 'Bạn không thể x thư mục này bởi vì nó không trống!',
'error-folder-name' => 'Tên thư mục không được trống!',
'error-folder-exist'=> 'Tên thư mục đã được sử dụng!',
'error-folder-alnum'=> 'Tên thư mục chỉ được sử dụng chữ hoặc số!',
'error-rename' => 'Tên tệp đã được sử dụng!',
'error-file-name' => 'Tên tệp không thể để trống!',
'error-file-empty' => 'Bạn phải chọn một tập tin!',
'error-file-exist' => 'Một tập tin với tên này đã tn tại!',
'error-file-size' => 'Kích thước tp vượt quá giới hạn máy chủ! (Kích thước tối đa: :max)',
'error-delete-folder'=> 'Bạn không thể xóa thư mục này vì nó không trống!',
'error-folder-name' => 'Tên thư mục không được để trống!',
'error-folder-exist'=> 'Một thư mục có tên này đã tồn tại!',
'error-folder-alnum'=> 'Chỉ cho phép tên thư mục chữ và số!',
'error-folder-not-found'=> 'Không tìm thấy thư mục! (:folder)',
'error-mime' => 'Không hỗ trợ MimeType: ',
'error-size' => 'Kích thước quá lớn:',
'error-instance' => 'Tp tin được tải lên phải là một kiểu UploadedFile',
'error-mime' => 'Unexpected MimeType: ',
'error-size' => 'Kích thước quá giới hạn:',
'error-instance' => 'Tp đã tải lên phải là một phiên bản của UploadedFile',
'error-invalid' => 'Yêu cầu tải lên không hợp lệ',
'error-other' => ' lỗi xảy ra: ',
'error-too-large' => 'Kích thước yêu cầu quá lơn!',
'error-other' => 'Một lỗi đã xảy ra: ',
'error-too-large' => 'Yêu cầu thực thể quá ln!',
'btn-upload' => 'Tải tập tin',
'btn-upload' => 'Tải lên tập tin',
'btn-uploading' => 'Đang tải lên...',
'btn-close' => 'Đóng',
'btn-crop' => 'Cắt',
'btn-copy-crop' => 'Sao chép và Cắt',
'btn-cancel' => 'Huỷ bỏ',
'btn-crop-free' => 'Free',
'btn-cancel' => 'Hủy bỏ',
'btn-confirm' => 'Xác nhận',
'btn-resize' => 'Thay đổi kích thước',
'btn-open' => 'Mở thư mục',
'resize-ratio' => 'Tỷ lệ:',
'resize-scaled' => 'Hình ảnh thu nhỏ:',

View File

@@ -21,8 +21,8 @@ return [
'title-panel' => '档案管理',
'title-upload' => '上传档案',
'title-view' => '预览档案',
'title-root' => '我的档案',
'title-shares' => '共享的文件',
'title-user' => '我的档案',
'title-share' => '共享的文件',
'title-item' => '项目名称',
'title-size' => '档案大小',
'title-type' => '档案类型',

View File

@@ -16,13 +16,15 @@ return [
'menu-download' => '下載',
'menu-resize' => '縮放',
'menu-crop' => '裁剪',
'menu-move' => '搬移',
'menu-multiple' => '多選',
'title-page' => '檔案管理',
'title-panel' => '檔案管理',
'title-upload' => '上傳檔案',
'title-view' => '預覽檔案',
'title-root' => '我的檔案',
'title-shares' => '共享的檔案',
'title-user' => '我的檔案',
'title-share' => '共享的檔案',
'title-item' => '項目名稱',
'title-size' => '檔案大小',
'title-type' => '檔案類型',
@@ -37,6 +39,7 @@ return [
'message-name' => '資料夾名稱:',
'message-rename' => '重新命名為:',
'message-extension_not_found' => '請安裝 gd 或 imagick 以使用縮放、裁剪、及縮圖功能',
'message-drop' => '或將檔案拖拉到此處',
'error-rename' => '名稱重複,請重新輸入!',
'error-file-name' => '請輸入檔案名稱!',
@@ -58,8 +61,12 @@ return [
'btn-uploading' => '上傳中...',
'btn-close' => '關閉',
'btn-crop' => '裁剪',
'btn-copy-crop' => '裁剪為新的檔案',
'btn-crop-free' => '不限比例',
'btn-cancel' => '取消',
'btn-confirm' => '確認',
'btn-resize' => '縮放',
'btn-open' => '開啟資料夾',
'resize-ratio' => '比例:',
'resize-scaled' => '是否已縮放:',

View File

@@ -1,105 +0,0 @@
<?php
$middleware = array_merge(\Config::get('lfm.middlewares'), [
'\UniSharp\LaravelFilemanager\Middlewares\MultiUser',
'\UniSharp\LaravelFilemanager\Middlewares\CreateDefaultFolder',
]);
$prefix = \Config::get('lfm.url_prefix', \Config::get('lfm.prefix', 'laravel-filemanager'));
$as = 'unisharp.lfm.';
$namespace = '\UniSharp\LaravelFilemanager\Controllers';
// make sure authenticated
Route::group(compact('middleware', 'prefix', 'as', 'namespace'), function () {
// Show LFM
Route::get('/', [
'uses' => 'LfmController@show',
'as' => 'show',
]);
// Show integration error messages
Route::get('/errors', [
'uses' => 'LfmController@getErrors',
'as' => 'getErrors',
]);
// upload
Route::any('/upload', [
'uses' => 'UploadController@upload',
'as' => 'upload',
]);
// list images & files
Route::get('/jsonitems', [
'uses' => 'ItemsController@getItems',
'as' => 'getItems',
]);
// folders
Route::get('/newfolder', [
'uses' => 'FolderController@getAddfolder',
'as' => 'getAddfolder',
]);
Route::get('/deletefolder', [
'uses' => 'FolderController@getDeletefolder',
'as' => 'getDeletefolder',
]);
Route::get('/folders', [
'uses' => 'FolderController@getFolders',
'as' => 'getFolders',
]);
// crop
Route::get('/crop', [
'uses' => 'CropController@getCrop',
'as' => 'getCrop',
]);
Route::get('/cropimage', [
'uses' => 'CropController@getCropimage',
'as' => 'getCropimage',
]);
Route::get('/cropnewimage', [
'uses' => 'CropController@getNewCropimage',
'as' => 'getCropimage',
]);
// rename
Route::get('/rename', [
'uses' => 'RenameController@getRename',
'as' => 'getRename',
]);
// scale/resize
Route::get('/resize', [
'uses' => 'ResizeController@getResize',
'as' => 'getResize',
]);
Route::get('/doresize', [
'uses' => 'ResizeController@performResize',
'as' => 'performResize',
]);
// download
Route::get('/download', [
'uses' => 'DownloadController@getDownload',
'as' => 'getDownload',
]);
// delete
Route::get('/delete', [
'uses' => 'DeleteController@getDelete',
'as' => 'getDelete',
]);
// Route::get('/demo', 'DemoController@index');
});
Route::group(compact('prefix', 'as', 'namespace'), function () {
// Get file when base_directory isn't public
$images_url = '/' . \Config::get('lfm.images_folder_name') . '/{base_path}/{image_name}';
$files_url = '/' . \Config::get('lfm.files_folder_name') . '/{base_path}/{file_name}';
Route::get($images_url, 'RedirectController@getImage')
->where('image_name', '.*');
Route::get($files_url, 'RedirectController@getFile')
->where('file_name', '.*');
});

View File

@@ -1,38 +1,37 @@
<div class="row">
<div class="col-md-8">
<div class="row no-gutters">
<div class="col-xl-8">
<div class="crop-container">
<img src="{{ $img->url . '?timestamp=' . $img->updated }}" class="img img-responsive">
<img src="{{ $img->url . '?timestamp=' . $img->time }}" class="img img-responsive">
</div>
</div>
<div class="col-md-4">
<div class="col-xl-4">
<div class="text-center">
<div class="img-preview center-block"></div>
<br>
<div class="btn-group clearfix">
<label class="btn btn-primary btn-aspectRatio active" onclick="changeAspectRatio(this, 16 / 9)">
<label class="btn btn-info btn-aspectRatio active" onclick="changeAspectRatio(this, 16 / 9)">
16:9
</label>
<label class="btn btn-primary btn-aspectRatio" onclick="changeAspectRatio(this, 4 / 3)">
<label class="btn btn-info btn-aspectRatio" onclick="changeAspectRatio(this, 4 / 3)">
4:3
</label>
<label class="btn btn-primary btn-aspectRatio" onclick="changeAspectRatio(this, 1)">
<label class="btn btn-info btn-aspectRatio" onclick="changeAspectRatio(this, 1)">
1:1
</label>
<label class="btn btn-primary btn-aspectRatio" onclick="changeAspectRatio(this, 2 / 3)">
<label class="btn btn-info btn-aspectRatio" onclick="changeAspectRatio(this, 2 / 3)">
2:3
</label>
{{--<label class="btn btn-primary" onclick="changeAspectRatio(this, null)">
Free
</label>--}}
<label class="btn btn-info btn-aspectRatio" onclick="changeAspectRatio(this, null)">
{{ trans('laravel-filemanager::lfm.btn-crop-free') }}
</label>
</div>
<br>
<br>
<button class="btn btn-primary" onclick="performCrop()">{{ trans('laravel-filemanager::lfm.btn-crop') }}</button>
<button class="btn btn-primary" onclick="performCropNew()">{{ trans('laravel-filemanager::lfm.btn-copy-crop') }}</button>
<button class="btn btn-info" onclick="loadItems()">{{ trans('laravel-filemanager::lfm.btn-cancel') }}</button>
<div class="btn-group clearfix">
<button class="btn btn-secondary" onclick="loadItems()">{{ trans('laravel-filemanager::lfm.btn-cancel') }}</button>
<button class="btn btn-warning" onclick="performCropNew()">{{ trans('laravel-filemanager::lfm.btn-copy-crop') }}</button>
<button class="btn btn-primary" onclick="performCrop()">{{ trans('laravel-filemanager::lfm.btn-crop') }}</button>
</div>
<form id='cropForm'>
<input type="hidden" id="img" name="img" value="{{ $img->name }}">
<input type="hidden" id="working_dir" name="working_dir" value="{{ $working_dir }}">
@@ -44,7 +43,6 @@
</form>
</div>
</div>
</div>
<script>

View File

@@ -2,9 +2,10 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Laravel Filemanager</title>
<link rel="shortcut icon" type="image/png" href="{{ asset('vendor/laravel-filemanager/img/folder.png') }}">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="shortcut icon" type="image/png" href="{{ asset('vendor/laravel-filemanager/img/72px color.png') }}">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
<body>
@@ -12,54 +13,55 @@
<h1 class="page-header">Integration Demo Page</h1>
<div class="row">
<div class="col-md-6">
<h2>CKEditor</h2>
<h2 class="mt-4">CKEditor</h2>
<textarea name="ce" class="form-control"></textarea>
</div>
<div class="col-md-6">
<h2>TinyMCE</h2>
<h2 class="mt-4">TinyMCE</h2>
<textarea name="tm" class="form-control"></textarea>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h2>Summernote</h2>
<h2 class="mt-4">Summernote</h2>
<textarea id="summernote-editor" name="content"></textarea>
</div>
<div class="col-md-6">
<h2>Standalone Image Button</h2>
<h2 class="mt-4">Standalone Image Button</h2>
<div class="input-group">
<span class="input-group-btn">
<a id="lfm" data-input="thumbnail" data-preview="holder" class="btn btn-primary">
<a id="lfm" data-input="thumbnail" data-preview="holder" class="btn btn-primary text-white">
<i class="fa fa-picture-o"></i> Choose
</a>
</span>
<input id="thumbnail" class="form-control" type="text" name="filepath">
</div>
<img id="holder" style="margin-top:15px;max-height:100px;">
<h2>Standalone File Button</h2>
<div id="holder" style="margin-top:15px;max-height:100px;"></div>
<h2 class="mt-4">Standalone File Button</h2>
<div class="input-group">
<span class="input-group-btn">
<a id="lfm2" data-input="thumbnail2" data-preview="holder2" class="btn btn-primary">
<a id="lfm2" data-input="thumbnail2" data-preview="holder2" class="btn btn-primary text-white">
<i class="fa fa-picture-o"></i> Choose
</a>
</span>
<input id="thumbnail2" class="form-control" type="text" name="filepath">
</div>
<img id="holder2" style="margin-top:15px;max-height:100px;">
<div id="holder2" style="margin-top:15px;max-height:100px;"></div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Embed file manager</h2>
<iframe src="/laravel-filemanager" style="width: 100%; height: 500px; overflow: hidden; border: none;"></iframe>
<h2 class="mt-4">Embed file manager</h2>
<iframe src="/filemanager" style="width: 100%; height: 500px; overflow: hidden; border: none;"></iframe>
</div>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script>
<script>
var route_prefix = "{{ url(config('lfm.url_prefix', config('lfm.prefix'))) }}";
var route_prefix = "/filemanager";
</script>
<!-- CKEditor init -->
@@ -112,56 +114,98 @@
</script>
<script>
{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/js/lfm.js')) !!}
{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/js/stand-alone-button.js')) !!}
</script>
<script>
$('#lfm').filemanager('image', {prefix: route_prefix});
$('#lfm2').filemanager('file', {prefix: route_prefix});
// $('#lfm').filemanager('file', {prefix: route_prefix});
</script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.4/summernote.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.4/summernote.js"></script>
<script>
$(document).ready(function() {
$('#summernote').summernote();
});
var lfm = function(id, type, options) {
let button = document.getElementById(id);
button.addEventListener('click', function () {
var route_prefix = (options && options.prefix) ? options.prefix : '/filemanager';
var target_input = document.getElementById(button.getAttribute('data-input'));
var target_preview = document.getElementById(button.getAttribute('data-preview'));
window.open(route_prefix + '?type=' + options.type || 'file', 'FileManager', 'width=900,height=600');
window.SetUrl = function (items) {
var file_path = items.map(function (item) {
return item.url;
}).join(',');
// set the value of the desired input to image url
target_input.value = file_path;
target_input.dispatchEvent(new Event('change'));
// clear previous preview
target_preview.innerHtml = '';
// set or change the preview image src
items.forEach(function (item) {
let img = document.createElement('img')
img.setAttribute('style', 'height: 5rem')
img.setAttribute('src', item.thumb_url)
target_preview.appendChild(img);
});
// trigger change event
target_preview.dispatchEvent(new Event('change'));
};
});
};
lfm('lfm2', 'file', {prefix: route_prefix});
</script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.8/summernote.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.8/summernote.js"></script>
<style>
.popover {
top: auto;
left: auto;
}
</style>
<script>
$(document).ready(function(){
// Define function to open filemanager window
var lfm = function(options, cb) {
var route_prefix = (options && options.prefix) ? options.prefix : '/laravel-filemanager';
window.open(route_prefix + '?type=' + options.type || 'file', 'FileManager', 'width=900,height=600');
window.SetUrl = cb;
var route_prefix = (options && options.prefix) ? options.prefix : '/filemanager';
window.open(route_prefix + '?type=' + options.type || 'file', 'FileManager', 'width=900,height=600');
window.SetUrl = cb;
};
// Define LFM summernote button
var LFMButton = function(context) {
var ui = $.summernote.ui;
var button = ui.button({
contents: '<i class="note-icon-picture"></i> ',
tooltip: 'Insert image with filemanager',
click: function() {
var ui = $.summernote.ui;
var button = ui.button({
contents: '<i class="note-icon-picture"></i> ',
tooltip: 'Insert image with filemanager',
click: function() {
lfm({type: 'image', prefix: '/laravel-filemanager'}, function(url, path) {
context.invoke('insertImage', url);
});
lfm({type: 'image', prefix: '/filemanager'}, function(lfmItems, path) {
lfmItems.forEach(function (lfmItem) {
context.invoke('insertImage', lfmItem.url);
});
});
}
});
return button.render();
}
});
return button.render();
};
// Initialize summernote with LFM button in the popover button group
// Please note that you can add this button to any other button group you'd like
$('#summernote-editor').summernote({
toolbar: [
['popovers', ['lfm']],
],
buttons: {
lfm: LFMButton
}
toolbar: [
['popovers', ['lfm']],
],
buttons: {
lfm: LFMButton
}
})
});
</script>

View File

@@ -1,57 +0,0 @@
@if((sizeof($files) > 0) || (sizeof($directories) > 0))
<div class="row">
@foreach($items as $item)
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2 img-row">
<?php $item_name = $item->name; ?>
<?php $thumb_src = $item->thumb; ?>
<?php $item_path = $item->is_file ? $item->url : $item->path; ?>
<div class="square clickable {{ $item->is_file ? '' : 'folder-item' }}" data-id="{{ $item_path }}"
@if($item->is_file && $thumb_src) onclick="useFile('{{ $item_path }}', '{{ $item->updated }}')"
@elseif($item->is_file) onclick="download('{{ $item_name }}')" @endif >
@if($thumb_src)
<img src="{{ $thumb_src }}">
@else
<i class="fa {{ $item->icon }} fa-5x"></i>
@endif
</div>
<div class="caption text-center">
<div class="btn-group">
<button type="button" data-id="{{ $item_path }}"
class="item_name btn btn-default btn-xs {{ $item->is_file ? '' : 'folder-item'}}"
@if($item->is_file && $thumb_src) onclick="useFile('{{ $item_path }}', '{{ $item->updated }}')"
@elseif($item->is_file) onclick="download('{{ $item_name }}')" @endif >
{{ $item_name }}
</button>
<button type="button" class="btn btn-default dropdown-toggle btn-xs" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="javascript:rename('{{ $item_name }}')"><i class="fa fa-edit fa-fw"></i> {{ Lang::get('laravel-filemanager::lfm.menu-rename') }}</a></li>
@if($item->is_file)
<li><a href="javascript:download('{{ $item_name }}')"><i class="fa fa-download fa-fw"></i> {{ Lang::get('laravel-filemanager::lfm.menu-download') }}</a></li>
<li class="divider"></li>
@if($thumb_src)
<li><a href="javascript:fileView('{{ $item_path }}', '{{ $item->updated }}')"><i class="fa fa-image fa-fw"></i> {{ Lang::get('laravel-filemanager::lfm.menu-view') }}</a></li>
<li><a href="javascript:resizeImage('{{ $item_name }}')"><i class="fa fa-arrows fa-fw"></i> {{ Lang::get('laravel-filemanager::lfm.menu-resize') }}</a></li>
<li><a href="javascript:cropImage('{{ $item_name }}')"><i class="fa fa-crop fa-fw"></i> {{ Lang::get('laravel-filemanager::lfm.menu-crop') }}</a></li>
<li class="divider"></li>
@endif
@endif
<li><a href="javascript:trash('{{ $item_name }}')"><i class="fa fa-trash fa-fw"></i> {{ Lang::get('laravel-filemanager::lfm.menu-delete') }}</a></li>
</ul>
</div>
</div>
</div>
@endforeach
</div>
@else
<p>{{ Lang::get('laravel-filemanager::lfm.message-empty') }}</p>
@endif

View File

@@ -6,126 +6,120 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#75C7C3">
<meta name="theme-color" content="#333844">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#75C7C3">
<meta name="msapplication-navbutton-color" content="#333844">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#75C7C3">
<meta name="apple-mobile-web-app-status-bar-style" content="#333844">
<title>{{ trans('laravel-filemanager::lfm.title-page') }}</title>
<link rel="shortcut icon" type="image/png" href="{{ asset('vendor/laravel-filemanager/img/folder.png') }}">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="shortcut icon" type="image/png" href="{{ asset('vendor/laravel-filemanager/img/72px color.png') }}">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.5.0/css/all.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-ui-dist@1.12.1/jquery-ui.min.css">
<link rel="stylesheet" href="{{ asset('vendor/laravel-filemanager/css/cropper.min.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/laravel-filemanager/css/dropzone.min.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/laravel-filemanager/css/mime-icons.min.css') }}">
<style>{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/css/lfm.css')) !!}</style>
{{-- Use the line below instead of the above if you need to cache the css. --}}
{{-- <link rel="stylesheet" href="{{ asset('/vendor/laravel-filemanager/css/lfm.css') }}"> --}}
<link rel="stylesheet" href="{{ asset('vendor/laravel-filemanager/css/mfb.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/laravel-filemanager/css/dropzone.min.css') }}">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.css">
</head>
<body>
<div class="container-fluid" id="wrapper">
<div class="panel panel-primary hidden-xs">
<div class="panel-heading">
<h1 class="panel-title">{{ trans('laravel-filemanager::lfm.title-panel') }}</h1>
</div>
<nav class="navbar sticky-top navbar-expand-lg navbar-dark" id="nav">
<a class="navbar-brand invisible-lg d-none d-lg-inline" id="to-previous">
<i class="fas fa-arrow-left fa-fw"></i>
<span class="d-none d-lg-inline">{{ trans('laravel-filemanager::lfm.nav-back') }}</span>
</a>
<a class="navbar-brand d-block d-lg-none" id="show_tree">
<i class="fas fa-bars fa-fw"></i>
</a>
<a class="navbar-brand d-block d-lg-none" id="current_folder"></a>
<a id="loading" class="navbar-brand"><i class="fas fa-spinner fa-spin"></i></a>
<div class="ml-auto px-2">
<a class="navbar-link d-none" id="multi_selection_toggle">
<i class="fa fa-check-double fa-fw"></i>
<span class="d-none d-lg-inline">{{ trans('laravel-filemanager::lfm.menu-multiple') }}</span>
</a>
</div>
<div class="row">
<div class="col-sm-2 hidden-xs">
<div id="tree"></div>
</div>
<div class="col-sm-10 col-xs-12" id="main">
<nav class="navbar navbar-default" id="nav">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-buttons">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand clickable hide" id="to-previous">
<i class="fa fa-arrow-left"></i>
<span class="hidden-xs">{{ trans('laravel-filemanager::lfm.nav-back') }}</span>
</a>
<a class="navbar-brand visible-xs" href="#">{{ trans('laravel-filemanager::lfm.title-panel') }}</a>
</div>
<div class="collapse navbar-collapse" id="nav-buttons">
<ul class="nav navbar-nav navbar-right">
<li>
<a class="clickable" id="thumbnail-display">
<i class="fa fa-th-large"></i>
<span>{{ trans('laravel-filemanager::lfm.nav-thumbnails') }}</span>
</a>
</li>
<li>
<a class="clickable" id="list-display">
<i class="fa fa-list"></i>
<span>{{ trans('laravel-filemanager::lfm.nav-list') }}</span>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
{{ trans('laravel-filemanager::lfm.nav-sort') }} <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="#" id="list-sort-alphabetic">
<i class="fa fa-sort-alpha-asc"></i> {{ trans('laravel-filemanager::lfm.nav-sort-alphabetic') }}
</a>
</li>
<li>
<a href="#" id="list-sort-time">
<i class="fa fa-sort-amount-asc"></i> {{ trans('laravel-filemanager::lfm.nav-sort-time') }}
</a>
</li>
</ul>
</li>
</ul>
</div>
</nav>
<div class="visible-xs" id="current_dir" style="padding: 5px 15px;background-color: #f8f8f8;color: #5e5e5e;"></div>
<div id="alerts"></div>
<div id="content"></div>
</div>
<ul id="fab">
<li>
<a href="#"></a>
<ul class="hide">
<li>
<a href="#" id="add-folder" data-mfb-label="{{ trans('laravel-filemanager::lfm.nav-new') }}">
<i class="fa fa-folder"></i>
</a>
</li>
<li>
<a href="#" id="upload" data-mfb-label="{{ trans('laravel-filemanager::lfm.nav-upload') }}">
<i class="fa fa-upload"></i>
</a>
</li>
</ul>
<a class="navbar-toggler collapsed border-0 px-1 py-2 m-0" data-toggle="collapse" data-target="#nav-buttons">
<i class="fas fa-cog fa-fw"></i>
</a>
<div class="collapse navbar-collapse flex-grow-0" id="nav-buttons">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-display="grid">
<i class="fas fa-th-large fa-fw"></i>
<span>{{ trans('laravel-filemanager::lfm.nav-thumbnails') }}</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-display="list">
<i class="fas fa-list-ul fa-fw"></i>
<span>{{ trans('laravel-filemanager::lfm.nav-list') }}</span>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-sort fa-fw"></i>{{ trans('laravel-filemanager::lfm.nav-sort') }}
</a>
<div class="dropdown-menu dropdown-menu-right border-0"></div>
</li>
</ul>
</div>
</nav>
<nav class="bg-light fixed-bottom border-top d-none" id="actions">
<a data-action="open" data-multiple="false"><i class="fas fa-folder-open"></i>{{ trans('laravel-filemanager::lfm.btn-open') }}</a>
<a data-action="preview" data-multiple="true"><i class="fas fa-images"></i>{{ trans('laravel-filemanager::lfm.menu-view') }}</a>
<a data-action="use" data-multiple="true"><i class="fas fa-check"></i>{{ trans('laravel-filemanager::lfm.btn-confirm') }}</a>
</nav>
<div class="d-flex flex-row">
<div id="tree"></div>
<div id="main">
<div id="alerts"></div>
<nav aria-label="breadcrumb" class="d-none d-lg-block" id="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item invisible">Home</li>
</ol>
</nav>
<div id="empty" class="d-none">
<i class="far fa-folder-open"></i>
{{ trans('laravel-filemanager::lfm.message-empty') }}
</div>
<div id="content"></div>
<div id="pagination"></div>
<a id="item-template" class="d-none">
<div class="square"></div>
<div class="info">
<div class="item_name text-truncate"></div>
<time class="text-muted font-weight-light text-truncate"></time>
</div>
</a>
</div>
<div id="fab"></div>
</div>
<div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aia-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{ trans('laravel-filemanager::lfm.title-upload') }}</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aia-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<form action="{{ route('unisharp.lfm.upload') }}" role='form' id='uploadForm' name='uploadForm' method='post' enctype='multipart/form-data' class="dropzone">
<div class="form-group" id="attachment">
<div class="controls text-center">
<div class="input-group" style="width: 100%">
<a class="btn btn-primary" id="upload-button">{{ trans('laravel-filemanager::lfm.message-choose') }}</a>
<div class="input-group w-100">
<a class="btn btn-primary w-100 text-white" id="upload-button">{{ trans('laravel-filemanager::lfm.message-choose') }}</a>
</div>
</div>
</div>
@@ -135,79 +129,163 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-close') }}</button>
<button type="button" class="btn btn-secondary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-close') }}</button>
</div>
</div>
</div>
</div>
<div id="lfm-loader">
<img src="{{asset('vendor/laravel-filemanager/img/loader.svg')}}">
<div class="modal fade" id="notify" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-close') }}</button>
<button type="button" class="btn btn-primary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-confirm') }}</button>
</div>
</div>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.4.0/bootbox.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<div class="modal fade" id="dialog" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"></h4>
</div>
<div class="modal-body">
<input type="text" class="form-control">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-close') }}</button>
<button type="button" class="btn btn-primary w-100" data-dismiss="modal">{{ trans('laravel-filemanager::lfm.btn-confirm') }}</button>
</div>
</div>
</div>
</div>
<div id="carouselTemplate" class="d-none carousel slide bg-light" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#previewCarousel" data-slide-to="0" class="active"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<a class="carousel-label"></a>
<div class="carousel-image"></div>
</div>
</div>
<a class="carousel-control-prev" href="#previewCarousel" role="button" data-slide="prev">
<div class="carousel-control-background" aria-hidden="true">
<i class="fas fa-chevron-left"></i>
</div>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#previewCarousel" role="button" data-slide="next">
<div class="carousel-control-background" aria-hidden="true">
<i class="fas fa-chevron-right"></i>
</div>
<span class="sr-only">Next</span>
</a>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.3/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.0/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-ui-dist@1.12.1/jquery-ui.min.js"></script>
<script src="{{ asset('vendor/laravel-filemanager/js/cropper.min.js') }}"></script>
<script src="{{ asset('vendor/laravel-filemanager/js/jquery.form.min.js') }}"></script>
<script src="{{ asset('vendor/laravel-filemanager/js/dropzone.min.js') }}"></script>
<script>
var route_prefix = "{{ url('/') }}";
var lfm_route = "{{ url(config('lfm.url_prefix', config('lfm.prefix'))) }}";
var lang = {!! json_encode(trans('laravel-filemanager::lfm')) !!};
var actions = [
// {
// name: 'use',
// icon: 'check',
// label: 'Confirm',
// multiple: true
// },
{
name: 'rename',
icon: 'edit',
label: lang['menu-rename'],
multiple: false
},
{
name: 'download',
icon: 'download',
label: lang['menu-download'],
multiple: true
},
// {
// name: 'preview',
// icon: 'image',
// label: lang['menu-view'],
// multiple: true
// },
{
name: 'move',
icon: 'paste',
label: lang['menu-move'],
multiple: true
},
{
name: 'resize',
icon: 'arrows-alt',
label: lang['menu-resize'],
multiple: false
},
{
name: 'crop',
icon: 'crop',
label: lang['menu-crop'],
multiple: false
},
{
name: 'trash',
icon: 'trash',
label: lang['menu-delete'],
multiple: true
},
];
var sortings = [
{
by: 'alphabetic',
icon: 'sort-alpha-down',
label: lang['nav-sort-alphabetic']
},
{
by: 'time',
icon: 'sort-numeric-down',
label: lang['nav-sort-time']
}
];
</script>
<script>{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/js/script.js')) !!}</script>
{{-- Use the line below instead of the above if you need to cache the script. --}}
{{-- <script src="{{ asset('vendor/laravel-filemanager/js/script.js') }}"></script> --}}
<script>
$.fn.fab = function () {
var menu = this;
menu.addClass('mfb-component--br mfb-zoomin').attr('data-mfb-toggle', 'hover');
var wrapper = menu.children('li');
wrapper.addClass('mfb-component__wrap');
var parent_button = wrapper.children('a');
parent_button.addClass('mfb-component__button--main')
.append($('<i>').addClass('mfb-component__main-icon--resting fa fa-plus'))
.append($('<i>').addClass('mfb-component__main-icon--active fa fa-times'));
var children_list = wrapper.children('ul');
children_list.find('a').addClass('mfb-component__button--child');
children_list.find('i').addClass('mfb-component__child-icon');
children_list.addClass('mfb-component__list').removeClass('hide');
};
$('#fab').fab({
buttons: [
{
icon: 'fa fa-folder',
label: "{{ trans('laravel-filemanager::lfm.nav-new') }}",
attrs: {id: 'add-folder'}
},
{
icon: 'fa fa-upload',
label: "{{ trans('laravel-filemanager::lfm.nav-upload') }}",
attrs: {id: 'upload'}
}
]
});
Dropzone.options.uploadForm = {
paramName: "upload[]", // The name that will be used to transfer the file
uploadMultiple: false,
parallelUploads: 5,
timeout:0,
clickable: '#upload-button',
dictDefaultMessage: 'Or drop files here to upload',
dictDefaultMessage: lang['message-drop'],
init: function() {
var _this = this; // For the closure
this.on('success', function(file, response) {
if (response == 'OK') {
refreshFoldersAndItems('OK');
loadFolders();
} else {
this.defaultOptions.error(file, response.join('\n'));
}
});
});
},
acceptedFiles: "{{ lcfirst(str_singular(request('type') ?: '')) == 'image' ? implode(',', config('lfm.valid_image_mimetypes')) : implode(',', config('lfm.valid_file_mimetypes')) }}",
maxFilesize: ({{ lcfirst(str_singular(request('type') ?: '')) == 'image' ? config('lfm.max_image_size') : config('lfm.max_file_size') }} / 1000)
headers: {
'Authorization': 'Bearer ' + getUrlParam('token')
},
acceptedFiles: "{{ implode(',', $helper->availableMimeTypes()) }}",
maxFilesize: ({{ $helper->maxUploadSize() }} / 1000)
}
</script>
</body>

View File

@@ -1,89 +0,0 @@
@if((sizeof($files) > 0) || (sizeof($directories) > 0))
<table class="table table-responsive table-condensed table-striped hidden-xs table-list-view">
<thead>
<th style='width:50%;'>{{ Lang::get('laravel-filemanager::lfm.title-item') }}</th>
<th>{{ Lang::get('laravel-filemanager::lfm.title-size') }}</th>
<th>{{ Lang::get('laravel-filemanager::lfm.title-type') }}</th>
<th>{{ Lang::get('laravel-filemanager::lfm.title-modified') }}</th>
<th>{{ Lang::get('laravel-filemanager::lfm.title-action') }}</th>
</thead>
<tbody>
@foreach($items as $item)
<tr>
<td>
<i class="fa {{ $item->icon }}"></i>
<a class="{{ $item->is_file ? 'file' : 'folder'}}-item clickable" data-id="{{ $item->is_file ? $item->url : $item->path }}" title="{{$item->name}}">
{{ str_limit($item->name, $limit = 40, $end = '...') }}
</a>
</td>
<td>{{ $item->size }}</td>
<td>{{ $item->type }}</td>
<td>{{ $item->time }}</td>
<td class="actions">
@if($item->is_file)
<a href="javascript:download('{{ $item->name }}')" title="{{ Lang::get('laravel-filemanager::lfm.menu-download') }}">
<i class="fa fa-download fa-fw"></i>
</a>
@if($item->thumb)
<a href="javascript:fileView('{{ $item->url }}', '{{ $item->updated }}')" title="{{ Lang::get('laravel-filemanager::lfm.menu-view') }}">
<i class="fa fa-image fa-fw"></i>
</a>
<a href="javascript:cropImage('{{ $item->name }}')" title="{{ Lang::get('laravel-filemanager::lfm.menu-crop') }}">
<i class="fa fa-crop fa-fw"></i>
</a>
<a href="javascript:resizeImage('{{ $item->name }}')" title="{{ Lang::get('laravel-filemanager::lfm.menu-resize') }}">
<i class="fa fa-arrows fa-fw"></i>
</a>
@endif
@endif
<a href="javascript:rename('{{ $item->name }}')" title="{{ Lang::get('laravel-filemanager::lfm.menu-rename') }}">
<i class="fa fa-edit fa-fw"></i>
</a>
<a href="javascript:trash('{{ $item->name }}')" title="{{ Lang::get('laravel-filemanager::lfm.menu-delete') }}">
<i class="fa fa-trash fa-fw"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
<table class="table visible-xs">
<tbody>
@foreach($items as $item)
<tr>
<td>
<div class="media" style="height: 70px;">
<div class="media-left">
<div class="square {{ $item->is_file ? 'file' : 'folder'}}-item clickable" data-id="{{ $item->is_file ? $item->url : $item->path }}">
@if($item->thumb)
<img src="{{ $item->thumb }}">
@else
<i class="fa {{ $item->icon }} fa-5x"></i>
@endif
</div>
</div>
<div class="media-body" style="padding-top: 10px;">
<div class="media-heading">
<p>
<a class="{{ $item->is_file ? 'file' : 'folder'}}-item clickable" data-id="{{ $item->is_file ? $item->url : $item->path }}">
{{ str_limit($item->name, $limit = 20, $end = '...') }}
</a>
&nbsp;&nbsp;
{{-- <a href="javascript:rename('{{ $item->name }}')">
<i class="fa fa-edit"></i>
</a> --}}
</p>
</div>
<p style="color: #aaa;font-weight: 400">{{ $item->time }}</p>
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<p>{{ trans('laravel-filemanager::lfm.message-empty') }}</p>
@endif

View File

@@ -0,0 +1,40 @@
<ul class="nav nav-pills flex-column">
@foreach($root_folders as $root_folder)
<li class="nav-item">
<a class="nav-link" href="#" data-type="0" onclick="moveToNewFolder(`{{$root_folder->url}}`)">
<i class="fa fa-folder fa-fw"></i> {{ $root_folder->name }}
<input type="hidden" id="goToFolder" name="goToFolder" value="{{ $root_folder->url }}">
<div id="items">
@foreach($items as $i)
<input type="hidden" id="{{ $i }}" name="items[]" value="{{ $i }}">
@endforeach
</div>
</a>
</li>
@foreach($root_folder->children as $directory)
<li class="nav-item sub-item">
<a class="nav-link" href="#" data-type="0" onclick="moveToNewFolder(`{{$directory->url}}`)">
<i class="fa fa-folder fa-fw"></i> {{ $directory->name }}
<input type="hidden" id="goToFolder" name="goToFolder" value="{{ $directory->url }}">
<div id="items">
@foreach($items as $i)
<input type="hidden" id="{{ $i }}" name="items[]" value="{{ $i }}">
@endforeach
</div>
</a>
</li>
@endforeach
@endforeach
</ul>
<script>
function moveToNewFolder($folder) {
$("#notify").modal('hide');
var items =[];
$("#items").find("input").each(function() {items.push(this.id)});
performLfmRequest('domove', {
items: items,
goToFolder: $folder
}).done(refreshFoldersAndItems);
}
</script>

View File

@@ -1,80 +1,121 @@
<div class="row">
<div class="col-md-8" id="containment">
<img id="resize" src="{{ $img->url . '?timestamp=' . $img->updated }}" height="{{ $height }}" width="{{ $width }}">
</div>
<div class="col-md-4">
<style>
#work_space {
padding: 30px;
height: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
<table class="table table-compact table-striped">
<thead></thead>
<tbody>
@if ($scaled)
<tr>
<td>{{ trans('laravel-filemanager::lfm.resize-ratio') }}</td>
<td>{{ number_format($ratio, 2) }}</td>
</tr>
<tr>
<td>{{ trans('laravel-filemanager::lfm.resize-scaled') }}</td>
<td>
{{ trans('laravel-filemanager::lfm.resize-true') }}
</td>
</tr>
@endif
<tr>
<td>{{ trans('laravel-filemanager::lfm.resize-old-height') }}</td>
<td>{{ $original_height }}px</td>
</tr>
<tr>
<td>{{ trans('laravel-filemanager::lfm.resize-old-width') }}</td>
<td>{{ $original_width }}px</td>
</tr>
<tr>
<td>{{ trans('laravel-filemanager::lfm.resize-new-height') }}</td>
<td><span id="height_display"></span></td>
</tr>
<tr>
<td>{{ trans('laravel-filemanager::lfm.resize-new-width') }}</td>
<td><span id="width_display"></span></td>
</tr>
</tbody>
</table>
@media screen and (min-width: 768px) {
#work_space {
width: unset;
height: unset;
}
}
</style>
<button class="btn btn-primary" onclick="doResize()">{{ trans('laravel-filemanager::lfm.btn-resize') }}</button>
<button class="btn btn-info" onclick="loadItems()">{{ trans('laravel-filemanager::lfm.btn-cancel') }}</button>
<input type="hidden" id="img" name="img" value="{{ $img->name }}">
<input type="hidden" name="ratio" value="{{ $ratio }}"><br>
<input type="hidden" name="scaled" value="{{ $scaled }}"><br>
<input type="hidden" id="original_height" name="original_height" value="{{ $original_height }}"><br>
<input type="hidden" id="original_width" name="original_width" value="{{ $original_width }}"><br>
<input type="hidden" id="height" name="height" value="{{ $height }}"><br>
<input type="hidden" id="width" name="width" value="{{ $width }}">
<div class="container">
<div class="row">
<div class="col-md-8 bg-light" id="work_space">
<div id="containment" class="d-none d-md-inline">
<img id="resize" src="{{ $img->url . '?timestamp=' . $img->time }}" height="{{ $height }}" width="{{ $width }}">
</div>
<div id="resize_mobile" style="background-image: url({{ $img->url . '?timestamp=' . $img->time }})" class="d-block d-md-none"></div>
</div>
<div class="col-md-4 pt-3">
<table class="table table-compact table-striped">
<thead></thead>
<tbody>
@if ($scaled)
<tr>
<td class="text-nowrap">{{ trans('laravel-filemanager::lfm.resize-ratio') }}</td>
<td class="text-right">{{ number_format($ratio, 2) }}</td>
</tr>
<tr>
<td class="text-nowrap">{{ trans('laravel-filemanager::lfm.resize-scaled') }}</td>
<td class="text-right">
{{ trans('laravel-filemanager::lfm.resize-true') }}
</td>
</tr>
@endif
<tr>
<td class="text-nowrap">{{ trans('laravel-filemanager::lfm.resize-old-height') }}</td>
<td class="text-right">{{ $original_height }}px</td>
</tr>
<tr>
<td class="text-nowrap">{{ trans('laravel-filemanager::lfm.resize-old-width') }}</td>
<td class="text-right">{{ $original_width }}px</td>
</tr>
<tr>
<td class="text-nowrap" style="vertical-align: middle">{{ trans('laravel-filemanager::lfm.resize-new-height') }}</td>
<td class="text-right"><input type="text" id="height_display" class="form-control w-50 d-inline mr-2" value="{{ $height }}">px</td>
</tr>
<tr>
<td class="text-nowrap" style="vertical-align: middle">{{ trans('laravel-filemanager::lfm.resize-new-width') }}</td>
<td class="text-right"><input type="text" id="width_display" class="form-control w-50 d-inline mr-2" value="{{ $width }}">px</td>
</tr>
</tbody>
</table>
<div class="d-flex mb-3">
<button class="btn btn-secondary w-50 mr-1" onclick="loadItems()">{{ trans('laravel-filemanager::lfm.btn-cancel') }}</button>
<button class="btn btn-primary w-50" onclick="doResize()">{{ trans('laravel-filemanager::lfm.btn-resize') }}</button>
</div>
<input type="hidden" id="img" name="img" value="{{ $img->name }}">
<input type="hidden" name="ratio" value="{{ $ratio }}">
<input type="hidden" name="scaled" value="{{ $scaled }}">
<input type="hidden" id="original_height" name="original_height" value="{{ $original_height }}">
<input type="hidden" id="original_width" name="original_width" value="{{ $original_width }}">
<input type="hidden" id="height" name="height" value="{{ $height }}">
<input type="hidden" id="width" name="width" value="{{ $width }}">
</div>
</div>
</div>
<script>
$(document).ready(function () {
$("#height_display").html($("#resize").height() + "px");
$("#width_display").html($("#resize").width() + "px");
renderResizedValues($("#width_display").val(), $("#height_display").val());
$("#resize").resizable({
aspectRatio: true,
containment: "#containment",
handles: "n, e, s, w, se, sw, ne, nw",
resize: function (event, ui) {
$("#width").val($("#resize").width());
$("#height").val($("#resize").height());
$("#height_display").html($("#resize").height() + "px");
$("#width_display").html($("#resize").width() + "px");
renderResizedValues(ui.size.width, ui.size.height);
}
});
});
$('#width_display, #height_display').change(function () {
var newWidth = $("#width_display").val();
var newHeight = $("#height_display").val();
renderResizedValues(newWidth, newHeight);
$("#containment > .ui-wrapper").width(newWidth).height(newHeight);
$("#resize").width(newWidth).height(newHeight);
});
function renderResizedValues(newWidth, newHeight) {
$("#width").val(newWidth);
$("#height").val(newHeight);
$("#width_display").val(newWidth);
$("#height_display").val(newHeight);
$('#resize_mobile').css('background-size', '100% 100%');
if (newWidth < newHeight) {
$('#resize_mobile').css('width', (newWidth / newHeight * 100) + '%').css('padding-bottom', '100%');
} else if (newWidth > newHeight) {
$('#resize_mobile').css('width', '100%').css('padding-bottom', (newHeight / newWidth * 100) + '%');
} else { // newWidth === newHeight
$('#resize_mobile').css('width', '100%').css('padding-bottom', '100%');
}
}
function doResize() {
performLfmRequest('doresize', {
img: $("#img").val(),
dataX: $("#dataX").val(),
dataY: $("#dataY").val(),
dataHeight: $("#height").val(),
dataWidth: $("#width").val()
}).done(loadItems);

View File

@@ -1,19 +1,34 @@
<ul class="list-unstyled">
<div class="m-3 d-block d-lg-none">
<h1 style="font-size: 1.5rem;">Laravel File Manager</h1>
<small class="d-block">Ver 2.0</small>
<div class="row mt-3">
<div class="col-4">
<img src="{{ asset('vendor/laravel-filemanager/img/152px color.png') }}" class="w-100">
</div>
<div class="col-8">
<p>Current usage :</p>
<p>20 GB (Max : 1 TB)</p>
</div>
</div>
<div class="progress mt-3" style="height: .5rem;">
<div class="progress-bar progress-bar-striped progress-bar-animated w-75 bg-main" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<ul class="nav nav-pills flex-column">
@foreach($root_folders as $root_folder)
<li>
<a class="clickable folder-item" data-id="{{ $root_folder->path }}">
<i class="fa fa-folder"></i> {{ $root_folder->name }}
<li class="nav-item">
<a class="nav-link" href="#" data-type="0" data-path="{{ $root_folder->url }}">
<i class="fa fa-folder fa-fw"></i> {{ $root_folder->name }}
</a>
</li>
@foreach($root_folder->children as $directory)
<li style="margin-left: 10px;">
<a class="clickable folder-item" data-id="{{ $directory->path }}">
<i class="fa fa-folder"></i> {{ $directory->name }}
</a>
</li>
<li class="nav-item sub-item">
<a class="nav-link" href="#" data-type="0" data-path="{{ $directory->url }}">
<i class="fa fa-folder fa-fw"></i> {{ $directory->name }}
</a>
</li>
@endforeach
@if($root_folder->has_next)
<hr>
@endif
@endforeach
</ul>

View File

@@ -0,0 +1,16 @@
<script type='text/javascript'>
function getUrlParam(paramName) {
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i');
var match = window.location.search.match(reParam);
return ( match && match.length > 1 ) ? match[1] : null;
}
var funcNum = getUrlParam('CKEditorFuncNum');
var par = window.parent;
var op = window.opener;
var o = (par && par.CKEDITOR) ? par : ((op && op.CKEDITOR) ? op : false);
if (op) window.close();
if (o !== false) o.CKEDITOR.tools.callFunction(funcNum, "{{ $file }}");
</script>