Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -0,0 +1,8 @@
Please check the following instructions before submitting a bug :
* Make sure you are using the latest version.
* Make sure you read [installation](http://unisharp.github.io/laravel-filemanager/installation), [integration](http://unisharp.github.io/laravel-filemanager/integration), and [upgrade](http://unisharp.github.io/laravel-filemanager/upgrade) document.
If your problem still remains, please do these steps :
* Run `php ./vendor/unisharp/laravel-filemanager/bin/debug` and paste the results here.
* Capture screenshots of your browser console and paste them here.
* Provide the steps to reproduce your issue, so we might solve it quicker.

View File

@@ -0,0 +1 @@
/vendor

View File

@@ -0,0 +1 @@
preset: psr2

View File

@@ -0,0 +1,19 @@
language: php
php:
- 5.5
- 5.6
- 7.0
- hhvm
matrix:
fast_finish: true
allow_failures:
- php: 7.0
before_script:
- travis_retry composer self-update
- travis_retry composer install --no-interaction --prefer-source
script:
- vendor/bin/phpunit --verbose

View File

@@ -1,8 +1,8 @@
The MIT License (MIT)
Copyright (c) 2015 Trevor Sawler <https://github.com/tsawler>
Copyright (c) 2015 All contributors from GitHub
Copyright (c) 2015 UniSharp
Copyright (c) 2015-2017 All contributors from GitHub
Copyright (c) 2015-2017 UniSharp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,52 +1,71 @@
# Laravel Filemanager
[![Latest Stable Version](https://poser.pugx.org/unisharp/laravel-filemanager/v/stable)](https://packagist.org/packages/unisharp/laravel-filemanager)
[![Total Downloads](https://poser.pugx.org/unisharp/laravel-filemanager/downloads)](https://packagist.org/packages/unisharp/laravel-filemanager)
[![License](https://poser.pugx.org/unisharp/laravel-filemanager/license)](https://packagist.org/packages/unisharp/laravel-filemanager)
[![Latest Stable Version](https://poser.pugx.org/unisharp/laravel-filemanager/v/stable)](https://packagist.org/packages/unisharp/laravel-filemanager) [![Total Downloads](https://poser.pugx.org/unisharp/laravel-filemanager/downloads)](https://packagist.org/packages/unisharp/laravel-filemanager) [![Latest Unstable Version](https://poser.pugx.org/unisharp/laravel-filemanager/v/unstable)](https://packagist.org/packages/unisharp/laravel-filemanager) [![License](https://poser.pugx.org/unisharp/laravel-filemanager/license)](https://packagist.org/packages/unisharp/laravel-filemanager)
* Document : [unisharp.github.io/laravel-filemanager](http://unisharp.github.io/laravel-filemanager/)
* [Installation](http://unisharp.github.io/laravel-filemanager/installation)
* [Integration](http://unisharp.github.io/laravel-filemanager/integration)
* [Config](http://unisharp.github.io/laravel-filemanager/config)
* [Customization](http://unisharp.github.io/laravel-filemanager/customization)
* [Events](http://unisharp.github.io/laravel-filemanager/events)
* [Upgrade](http://unisharp.github.io/laravel-filemanager/upgrade)
* Demo : [Laravel Filemanager container](https://github.com/UniSharp/laravel-filemanager-example-5.3)
A files and images management user interface with file uploading support. (Works well with CKEditor and TinyMCE)
## v1.8 released
* Please follow the intructions in [upgrade document](https://unisharp.github.io/laravel-filemanager/upgrade).
* Important changes :
* Fix Windows compatibility (utf-8 file names and folder names).
* New feature : Copy & Crop. Thanks [gwleuverink](https://github.com/gwleuverink).
* [Config document](https://unisharp.github.io/laravel-filemanager/config) is refactored.
PR is welcome!
## Security
## Overview
It is important to note that if you use your own routes **you must protect your routes to Laravel-Filemanager in order to prevent unauthorized uploads to your server**. Fortunately, Laravel makes this very easy.
* The project was forked from [tsawler/laravel-filemanager](http://packalyst.com/packages/package/tsawler/laravel-filemanager)
* Customizable routes and middlewares
* Supported locales : en, fr, bg, tr, fa, es, pt-BR, tr, zh-CN, zh-TW, ar
* Supports public and private folders for multi users
* Supports multi-level folders
* Supports using independently(see integration doc)
If, for example, you want to ensure that only logged in users have the ability to access the Laravel-Filemanager, simply wrap the routes in a group, perhaps like this:
## Documents
```php
Route::group(['middleware' => 'auth'], function () {
Route::get('/laravel-filemanager', '\UniSharp\LaravelFilemanager\controllers\LfmController@show');
Route::post('/laravel-filemanager/upload', '\UniSharp\LaravelFilemanager\controllers\UploadController@upload');
// list all lfm routes here...
});
```
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
1. [Integration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
This approach ensures that only authenticated users have access to the Laravel-Filemanager. If you are using Middleware or some other approach to enforce security, modify as needed.
## Screenshots
* Independent usage example :
**If you use the laravel-filemanager default route, make sure the `auth` middleware (set in config/lfm.php) is enabled and functional**.
![Independent usage example](https://raw.githubusercontent.com/UniSharp/laravel-filemanager/gh_pages/images/lfm01.png)
## v2.0 progress
* [x] (done) Unit test
* [x] (done) Integrate with Laravel Storage
* [x] (done) Multiple selection
* [ ] Configurable disk of storage
* [ ] (in progress) Responsive design
* [ ] (in progress) Config refactoring
* [x] (done) JSON APIs
* [ ] Move to folder function
* [ ] Applying MIME icon generator
* [x] (done) Bootstrap 4 support
* List view :
![FileManager screenshot 1](https://raw.githubusercontent.com/UniSharp/laravel-filemanager/gh_pages/images/lfm02.png)
## Contributors & Credits
* Grid view :
### Developers / Maintainers
![FileManager screenshot 2](https://raw.githubusercontent.com/UniSharp/laravel-filemanager/gh_pages/images/lfm03.png)
* [Stream](https://github.com/g0110280)
* [@gwleuverink](https://github.com/gwleuverink)
* All [@UniSharp](https://github.com/UniSharp) members
### Contributors
## Credits
* [All contibutors](https://github.com/UniSharp/laravel-filemanager/graphs/contributors) from GitHub. (issues / PR)
* Special thanks to
* [@taswler](https://github.com/tsawler) the original author.
* [@olivervogel](https://github.com/olivervogel) for the awesome [image library](https://github.com/Intervention/image)
* [@welcoMattic](https://github.com/welcoMattic) providing fr translations and lots of bugfixes.
* [@fraterblack](https://github.com/fraterblack) TinyMCE 4 support and pt-BR translations.
* [@1dot44mb](https://github.com/1dot44mb) tr translations.
* [@Nikita240](https://github.com/Nikita240) fixing controller extending errors.
* [@amin101](https://github.com/amin101) guide for independent use and fixes for url/directory error on Windows
* [@nasirkhan](https://github.com/nasirkhan) bug fixes and alphanumeric filename check
* [@petyots](https://github.com/petyots) Bulgarian translation
* All [@UniSharp](https://github.com/UniSharp) members
* [@taswler](https://github.com/tsawler) the original author of this package.
* Nathan for providing security suggestions.
### Credits
* [@olivervogel](https://github.com/olivervogel) for the awesome [image library](https://github.com/Intervention/image).
* SVG Loaders by [Sam](http://samherbert.net/svg-loaders/) (Licensed MIT)

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env php
<?php
/*
* This file is part of laravel-filemanager.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$composerLock = file_get_contents('composer.lock');
$jsonComposerLock = json_decode($composerLock);
foreach ($jsonComposerLock->packages as $package) {
if ($package->name == 'unisharp/laravel-filemanager')
$lfmVersion = $package->version;
if ($package->name == 'laravel/framework')
$laravelVersion = $package->version;
if (isset($lfmVersion) && isset($laravelVersion))
break;
}
$imagickCheck = extension_loaded('imagick') ? 'Install' : 'Not Install';
$gfCheck = extension_loaded('gd') ? 'Install' : 'Not Install';
// show the basic information for debug message
echo 'OS System & Version: ' . php_uname() . PHP_EOL;
echo 'Laravel Version: ' . $laravelVersion . PHP_EOL;
echo 'File Manager Version: ' . $lfmVersion . PHP_EOL;
echo 'imagick Extension: ' . $imagickCheck . PHP_EOL;
echo 'gd Extension: ' . $gfCheck . PHP_EOL;

View File

@@ -24,16 +24,33 @@
],
"require": {
"php": ">=5.4.0",
"ext-exif": "*",
"ext-fileinfo": "*",
"illuminate/support": ">=4.2.0",
"intervention/image": "2.*"
},
"require-dev": {
"orchestra/testbench": "~3.0",
"phpspec/phpspec": "~2.1",
"phpunit/phpunit": "~4.8"
},
"suggest": {
"ext-gd": "to use GD library based image processing.",
"ext-imagick": "to use Imagick based image processing."
},
"autoload": {
"psr-4": {
"Unisharp\\Laravelfilemanager\\": "src/"
"UniSharp\\LaravelFilemanager\\": "src/"
}
},
"bin": ["bin/debug"],
"extra": {
"laravel": {
"providers": [
"UniSharp\\LaravelFilemanager\\LaravelFilemanagerServiceProvider"
],
"aliases": {
}
}
}
}

3169
vendor/unisharp/laravel-filemanager/composer.lock generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,69 +0,0 @@
## Documents
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
## Config
In `config/lfm.php` :
```php
'rename_file' => true,
// true : files will be renamed as uniqid
// false : files will remain original names
// true : filter filename characters which are not alphanumeric, and replace them with '_'
'alphanumeric_filename' => true,
'use_package_routes' => true,
// set this to false to customize route for file manager
'middlewares' => ['auth'],
// determine middlewares that apply to all file manager routes
// NOTE: for laravel 5.2, please use ['web', 'auth']
'allow_multi_user' => true,
// true : user can upload files to shared folder and their own folder
// false : all files are put together in shared folder
'user_field' => 'id',
// determine which column of users table will be used as user's folder name
'shared_folder_name' => 'shares',
// the name of shared folder
'thumb_folder_name' => 'thumbs',
// the name of thumb folder
'images_dir' => 'public/photos/',
'images_url' => '/photos/',
// path and url of images
'files_dir' => 'public/files/',
'files_url' => '/files/',
// path and url of files
// valid image mimetypes
'valid_image_mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif'
],
// valid file mimetypes (only when '/laravel-filemanager?type=Files')
'valid_file_mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'application/pdf',
'text/plain'
],
```

View File

@@ -1,55 +0,0 @@
## Documents
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
## Customization
Feel free to customize the routes and views if your need.
### Routes
1. Copy the routes in /vendor/unisharp/laravel-filemanager/src/routes.php
1. Make sure urls below is correspond to your route :
CKEditor
```javascript
<script>
CKEDITOR.replace( 'editor', {
filebrowserImageBrowseUrl: '/your-custom-route?type=Images',
filebrowserBrowseUrl: '/your-custom-route?type=Files',
});
</script>
```
And be sure to include the `?type=Images` or `?type=Files` parameter.
TinyMCE
```javascript
...
var cmsURL = editor_config.path_absolute + 'your-custom-route?field_name='+field_name+'&lang='+ tinymce.settings.language;
if (type == 'image') {
cmsURL = cmsURL + "&type=Images";
} else {
cmsURL = cmsURL + "&type=Files";
}
...
```
### Views
1. Copy the views from /vendor/unisharp/laravel-filemanager/src/views/ :
```bash
php artisan vendor:publish --tag=lfm_view
```
### Translations
1. Copy `vendor/unisharp/laravel-filemanager/src/lang/en` to `/resources/lang/vendor/laravel-filemanager/<YOUR LANGUAGE>/lfm.php`
2. Change the file according your preferences

View File

@@ -1,44 +0,0 @@
## Documents
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
## List of events
* Unisharp\Laravelfilemanager\Events\ImageWasUploaded
## How to use
To use events you can add a listener to listen to the events
Snippet for `EventServiceProvider`
```php
protected $listen = [
ImageWasUploaded::class => [
UploadListener::class,
],
];
```
The `UploadListener` will look like:
```php
class UploadListener
{
public function handle($event)
{
$method = 'on'.class_basename($event);
if (method_exists($this, $method)) {
call_user_func([$this, $method], $event);
}
}
public function onImageWasUploaded(ImageWasUploaded $event)
{
$path = $event->path();
//your code, for example resizing and cropping
}
}
```

View File

@@ -1,54 +0,0 @@
## Documents
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
## Requirements
* php >= 5.5
* Laravel 5
* requires [intervention/image](https://github.com/Intervention/image) (to make thumbs, crop and resize images).
## Notes
* For `laravel 5.2` and `laravel 5.3`, please set `'middlewares' => ['web', 'auth'],` in config/lfm.php
* With laravel-filemanager >= 1.3.0, the new configs `valid_image_mimetypes` and `valid_file_mimetypes` restrict the MIME types of the uploading files.
## Installation
1. Install package
```bash
composer require unisharp/laravel-filemanager
```
1. Edit `config/app.php` :
Add service providers
```php
Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
```
And add class aliases
```php
'Image' => Intervention\Image\Facades\Image::class,
```
Code above is for Laravel 5.1.
In Laravel 5.0 should leave only quoted class names.
1. Publish the package's config and assets :
```bash
php artisan vendor:publish --tag=lfm_config
php artisan vendor:publish --tag=lfm_public
```
1. Ensure that the files & images directories (in `config/lfm.php`) are writable by your web server.

View File

@@ -1,126 +0,0 @@
## Documents
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
1. [Integration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
## WYSIWYG Editor Integration:
### Option 1: CKEditor
1. Install [laravel-ckeditor](https://github.com/UniSharp/laravel-ckeditor) package
1. Modify the views
Sample 1 - Replace by ID:
```html
<script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
<textarea id="my-editor" name="content" class="form-control">{!! old('content', 'test editor content') !!}</textarea>
<script>
CKEDITOR.replace( 'my-editor', {
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
});
</script>
```
Sample 2 - With JQuery Selector:
```html
<script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="/vendor/unisharp/laravel-ckeditor/adapters/jquery.js"></script>
<textarea name="content" class="form-control my-editor">{!! old('content', 'test editor content') !!}</textarea>
<script>
$('textarea.my-editor').ckeditor({
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
});
</script>
```
### Option 2: TinyMCE4
```html
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
<textarea name="content" class="form-control my-editor">{!! old('content', $content) !!}</textarea>
<script>
var editor_config = {
path_absolute : "/",
selector: "textarea.my-editor",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern"
],
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
relative_urls: false,
file_browser_callback : function(field_name, url, type, win) {
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;
var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
if (type == 'image') {
cmsURL = cmsURL + "&type=Images";
} else {
cmsURL = cmsURL + "&type=Files";
}
tinyMCE.activeEditor.windowManager.open({
file : cmsURL,
title : 'Filemanager',
width : x * 0.8,
height : y * 0.8,
resizable : "yes",
close_previous : "no"
});
}
};
tinymce.init(editor_config);
</script>
```
##Standalone button
If you are going to use filemanager independently, meaning set the value of an input to selected photo/file url, follow this structure:
1. Create a button, input, and image preview holder if you are going to choose images.
Specify the id to the input and image preview by `data-input` and `data-preview`.
```html
<div class="input-group">
<span class="input-group-btn">
<a id="lfm" data-input="thumbnail" data-preview="holder" class="btn btn-primary">
<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;">
```
1. Import lfm.js(run `php artisan vendor:publish` if you need).
```javascript
<script src="/vendor/laravel-filemanager/js/lfm.js"></script>
```
1. Init filemanager with type. (requires jQuery)
```javascript
$('#lfm').filemanager('image');
```
or
```javascript
$('#lfm').filemanager('file');
```

View File

@@ -1,14 +0,0 @@
## Documents
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
## Upgrade guide
* `composer update unisharp/laravel-filemanager`
* `php artisan vendor:publish --tag=lfm_view --force`
* `php artisan vendor:publish --tag=lfm_config --force` (IMPORTANT: please backup your own `config/lfm.php` first)

View File

@@ -0,0 +1,11 @@
theme: jekyll-theme-cayman
# Setup
title: Laravel File Manager
description: File manager/gallery with CKEditor, TinyMCE and Summernote support.
google_analytics: UA-92410814-4
# About/contact
author:
name: UniSharp
url: https://github.com/UniSharp

View File

@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>{{ page.title | default: site.title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
<style>
#nav > span > a {
color: #dddddd;
}
#nav > span:not(:last-child)::after {
content: ' |';
color: #dddddd;
}
</style>
</head>
<body>
<section class="page-header">
<h1 class="project-name">{{ site.title | default: site.github.repository_name }}</h1>
<h2 class="project-tagline">{{ site.description | default: site.github.project_tagline }}</h2>
<a class="btn" href="https://github.com/UniSharp/laravel-filemanager-example-5.3" target="_blank">Demo</a>
{% if site.github.is_project_page %}
<a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a>
{% endif %}
{% if site.show_downloads %}
<a href="{{ site.github.zip_url }}" class="btn">Download .zip</a>
<a href="{{ site.github.tar_url }}" class="btn">Download .tar.gz</a>
{% endif %}
<nav id="nav">
<span><a href="/laravel-filemanager">Home</a></span>
<span><a href="installation">Installation</a></span>
<span><a href="integration">Integration</a></span>
<span><a href="config">Config</a></span>
<span><a href="customization">Customization</a></span>
<span><a href="events">Events</a></span>
<span><a href="upgrade">Upgrade</a></span>
<span><a href="contribution">Contribution</a></span>
</nav>
</section>
<section class="main-content">
{{ content }}
<footer class="site-footer">
{% if site.github.is_project_page %}
<span class="site-footer-owner"><a href="{{ site.github.repository_url }}">{{ site.github.repository_name }}</a> is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span>
{% endif %}
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
</footer>
</section>
{% if site.google_analytics %}
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
</body>
</html>

View File

@@ -0,0 +1,97 @@
**The config is in `config/lfm.php`.**
## Routing:
| Key | Type | Description |
|--------------------|---------|--------------------------------------------------------------------------------------------------------------|
| use\_package\_routes | boolean | Use routes from package or not. If false, you will need to define routes to all controllers of this package. |
| middlewares | array | Middlewares to be applied to default routes. For laravel 5.1 and before, remove 'web' from the array. |
| url_prefix | string | The url prefix to this package. Change it if necessary. |
## Multi-User Mode:
| Key | Type | Description |
|--------------------|---------|------------------------------------------------------------------------------------------------|
| allow\_multi\_user | boolean | If true, private folders will be created for each signed-in user. |
| allow\_share\_folder | boolean | If true, share folder will be created. |
| user_field | string | Private folders will be named by this. Can receive column name of `users` table or class name. |
### If you want to name private folders other than columns of users table, follow these steps:
1. Run `php artisan vendor:publish --tag=lfm_handler`.
2. Fill `App\Handler\ConfigHander::class` into `user_field`.
3. Edit `userField()` in the `App\Handler\ConfigHander`
## Working Directory:
| Key | Type | Description |
|--------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| base_directory | string | Which folder to store files in project, fill in 'public', 'resources', 'storage' and so on. Does not support path relative path like `../public_html` or `public/upload/user/`. |
| images\_folder\_name | string | Does not support path relative path like `../public_html` or `public/upload/user/`. |
| files\_folder\_name | string | Does not support path relative path like `../public_html` or `public/upload/user/`. |
| shared\_folder\_name | string | Does not support path relative path like `../public_html` or `public/upload/user/`. |
| thumb\_folder\_name | string | Does not support path relative path like `../public_html` or `public/upload/user/`. |
## Startup Views:
| Key | Type | Description |
|---------------------|--------|-----------------------------------------------------------------|
| images\_startup\_view | string | The default display type for images. Supported: "grid", "list". |
| files\_startup\_view | string | The default display type for files. Supported: "grid", "list". |
## Upload / Validation:
| Key | Type | Description |
|-------------------------|---------|--------------------------------------------------------------------------|
| rename_file | string | If true, the uploaded file will be renamed to uniqid() + file extension. |
| alphanumeric_filename | string | If true, non-alphanumeric file name will be replaced with `_`. |
| alphanumeric_directory | boolean | If true, non-alphanumeric folder name will be rejected. |
| should\_validate\_size | boolean | If true, the size of uploading file will be verified. |
| max\_image\_size | int | Specify max size of uploading image. |
| max\_file\_size | int | Specify max size of uploading file. |
| should\_validate\_mime | boolean | If true, the mime type of uploading file will be verified. |
| valid\_image\_mimetypes | array | Array of mime types. Available since v1.3.0 . |
| should\_create\_thumbnails | boolean | If true, thumbnails will be created for faster loading. |
| raster\_mimetypes | array | Array of mime types. Thumbnails will be created only for these mimetypes. |
| create\_folder\_mode | int | Permission setting for folders created by this package. |
| create\_file\_mode | int | Permission setting for files uploaded to this package. |
| should\_change\_file\_mode | boolean | If true, it will attempt to chmod the file after upload |
| valid\_file\_mimetypes | array | Array of mime types. Available since v1.3.0 . |
## Thumbnail dimensions:
| Key | Type | Description |
|------------------|--------|--------------------------------------------------|
| thumb\_img\_width | string | Width of thumbnail made when image is uploaded. |
| thumb\_img\_height | string | Height of thumbnail made when image is uploaded. |
## File Extension Information
| Key | Type | Description |
|-----------------|-------|---------------------------------------------|
| file\_type\_array | array | Map file extension with display names. |
| file\_icon\_array | array | Map file extension with icons(font-awsome). |
## php.ini override
| Key | Type | Description |
|-------------------|-----------------|-----------------------------------------------------------------------------------------------------------------------------------|
| php\_ini\_overrides | array or boolean | These values override your php.ini settings before uploading files. Set these to false to ingnore and apply your php.ini settings |
### Caveats
The php\_ini\_overrides are applied on every request the filemanager does and are reset once the script has finished executing.
This has one drawback: any ini settings that you might want to change that apply to the request itself will not work.
For example, overriding these settings will not work:
* upload\_max\_filesize
* post\_max\_size
**Why this is expected behaviour:**
upload\_max\_filesize and post\_max\_size will get set but uploaded files are already passed to your PHP script before the settings are changed.

View File

@@ -0,0 +1,13 @@
## Steps to contribute
1. Fork [unisharp/laravel-filemanager](https://github.com/UniSharp/laravel-filemanager) from GitHub.
1. Run commands below:
```
git clone git@github.com:UniSharp/laravel-filemanager-example-5.3.git
cd laravel-filemanager-example-5.3
composer require unisharp/laravel-filemanager:dev-master
make init
```
1. Edit codes in `vendor/unisharp/laravel-filemanager`
1. Push your changes to your fork.
1. Send a pull request to [unisharp/laravel-filemanager](https://github.com/UniSharp/laravel-filemanager).

View File

@@ -0,0 +1,34 @@
## Routes
1. Copy the routes in `/vendor/unisharp/laravel-filemanager/src/routes.php`
1. Make sure urls below is correspond to your route (remember to include type parameter `?type=Images` or `?type=Files`) :
* CKEditor
```javascript
CKEDITOR.replace('editor', {
filebrowserImageBrowseUrl: '/your-custom-route?type=Images',
filebrowserBrowseUrl: '/your-custom-route?type=Files'
});
```
* TinyMCE
```javascript
...
var cmsURL = editor_config.path_absolute + 'your-custom-route?field_name='+field_name+'&lang='+ tinymce.settings.language;
if (type == 'image') {
cmsURL = cmsURL + "&type=Images";
} else {
cmsURL = cmsURL + "&type=Files";
}
...
```
## Views
Copy views to `resources/views/vendor/unisharp/laravel-filemanager/` :
```bash
php artisan vendor:publish --tag=lfm_view
```
## Translations
1. Copy `vendor/unisharp/laravel-filemanager/src/lang/en` to `/resources/lang/vendor/laravel-filemanager/<YOUR LANGUAGE>/lfm.php`.
1. Edit the file as you please.

View File

@@ -0,0 +1,97 @@
## List of events
* Unisharp\Laravelfilemanager\Events\ImageIsUploading
* Unisharp\Laravelfilemanager\Events\ImageWasUploaded
* Unisharp\Laravelfilemanager\Events\ImageIsRenaming
* Unisharp\Laravelfilemanager\Events\ImageWasRenamed
* Unisharp\Laravelfilemanager\Events\ImageIsDeleting
* Unisharp\Laravelfilemanager\Events\ImageWasDeleted
* Unisharp\Laravelfilemanager\Events\FolderIsRenaming
* Unisharp\Laravelfilemanager\Events\FolderWasRenamed
* Unisharp\Laravelfilemanager\Events\ImageIsResizing
* Unisharp\Laravelfilemanager\Events\ImageWasResized
* Unisharp\Laravelfilemanager\Events\ImageIsCropping
* Unisharp\Laravelfilemanager\Events\ImageWasCropped
## How to use
* Sample code : [laravel-filemanager-demo-events](https://github.com/UniSharp/laravel-filemanager-demo-events)
* To use events you can add a listener to listen to the events.
Snippet for `EventServiceProvider`
```php
protected $listen = [
ImageWasUploaded::class => [
UploadListener::class,
],
];
```
The `UploadListener` will look like:
```php
class UploadListener
{
public function handle($event)
{
$method = 'on'.class_basename($event);
if (method_exists($this, $method)) {
call_user_func([$this, $method], $event);
}
}
public function onImageWasUploaded(ImageWasUploaded $event)
{
$path = $event->path();
//your code, for example resizing and cropping
}
}
```
* Or by using Event Subscribers
Snippet for `EventServiceProvider`
```php
protected $subscribe = [
UploadListener::class
];
```
The `UploadListener` will look like:
```php
public function subscribe($events)
{
$events->listen('*', UploadListener::class);
}
public function handle($event)
{
$method = 'on'.class_basename($event);
if (method_exists($this, $method)) {
call_user_func([$this, $method], $event);
}
}
public function onImageWasUploaded(ImageWasUploaded $event)
{
$path = $event->path();
// your code, for example resizing and cropping
}
public function onImageWasRenamed(ImageWasRenamed $event)
{
// image was renamed
}
public function onImageWasDeleted(ImageWasDeleted $event)
{
// image was deleted
}
public function onFolderWasRenamed(FolderWasRenamed $event)
{
// folder was renamed
}
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -0,0 +1,29 @@
[![Latest Stable Version](https://poser.pugx.org/unisharp/laravel-filemanager/v/stable)](https://packagist.org/packages/unisharp/laravel-filemanager)
[![Total Downloads](https://poser.pugx.org/unisharp/laravel-filemanager/downloads)](https://packagist.org/packages/unisharp/laravel-filemanager)
[![License](https://poser.pugx.org/unisharp/laravel-filemanager/license)](https://packagist.org/packages/unisharp/laravel-filemanager)
## Features
* CKEditor and TinyMCE integration
* Standalone button
* Uploading validation
* Cropping and resizing of images
* Public and private folders for multi users
* Customizable routes, middlewares, views, and folder path
* Supports two types : files and images. Each type works in different directory.
* Supported locales : ar, bg, de, el, en, es, fa, fr, he, hu, nl, pl, pt-BR, pt_PT, ro, ru, tr, zh-CN, zh-TW
PR is welcome!
## Screenshots
> Standalone button :
![Standalone button demo](https://unisharp.github.io/laravel-filemanager/images/lfm01.png)
> Grid view :
![Grid view demo](https://unisharp.github.io/laravel-filemanager/images/lfm02.png)
> List view :
![List view demo](https://unisharp.github.io/laravel-filemanager/images/lfm03.png)

View File

@@ -0,0 +1,56 @@
## Requirements
* php >= 5.4
* exif extension
* fileinfo extension
* GD Library >=2.0 or Imagick PHP extension >=6.5.7
* Laravel 5
* requires [intervention/image](https://github.com/Intervention/image) (to make thumbs, crop and resize images).
## Installation
1. Install package
```bash
composer require unisharp/laravel-filemanager:~1.8
```
1. Edit `config/app.php` :
\* *For Laravel 5.5 and up, skip to step 3. All service providers and facades are automatically discovered.*
Add service providers
```php
UniSharp\LaravelFilemanager\LaravelFilemanagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
```
And add class aliases
```php
'Image' => Intervention\Image\Facades\Image::class,
```
Code above is for Laravel 5.1.
In Laravel 5.0 should leave only quoted class names.
1. Publish the package's config and assets :
```bash
php artisan vendor:publish --tag=lfm_config
php artisan vendor:publish --tag=lfm_public
```
1. Run commands to clear cache :
```bash
php artisan route:clear
php artisan config:clear
```
1. Ensure that the files & images directories (in `config/lfm.php`) are writable by your web server (run commands like `chown` or `chmod`).
## What's next
1. Check the [integration document](http://unisharp.github.io/laravel-filemanager/integration) to see how to apply this package.
1. Check the [config document](http://unisharp.github.io/laravel-filemanager/config) to discover the flexibility of this package.

View File

@@ -0,0 +1,204 @@
## Note
Check `vendor/unisharp/laravel-filemanager/src/views/demo.blade.php`, which already integrated all options from below.
## WYSIWYG Editor Integration:
### Option 1: CKEditor
```html
<textarea id="my-editor" name="content" class="form-control">{!! old('content', 'test editor content') !!}</textarea>
<script src="//cdn.ckeditor.com/4.6.2/standard/ckeditor.js"></script>
<script>
var options = {
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
};
</script>
```
* Sample 1 - Replace by ID:
```html
<script>
CKEDITOR.replace('my-editor', options);
</script>
```
* Sample 2 - With JQuery Selector:
```html
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="/vendor/unisharp/laravel-ckeditor/adapters/jquery.js"></script>
<script>
$('textarea.my-editor').ckeditor(options);
</script>
```
### Option 2: TinyMCE4
```html
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
<textarea name="content" class="form-control my-editor">{!! old('content', $content) !!}</textarea>
<script>
var editor_config = {
path_absolute : "/",
selector: "textarea.my-editor",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern"
],
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
relative_urls: false,
file_browser_callback : function(field_name, url, type, win) {
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;
var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
if (type == 'image') {
cmsURL = cmsURL + "&type=Images";
} else {
cmsURL = cmsURL + "&type=Files";
}
tinyMCE.activeEditor.windowManager.open({
file : cmsURL,
title : 'Filemanager',
width : x * 0.8,
height : y * 0.8,
resizable : "yes",
close_previous : "no"
});
}
};
tinymce.init(editor_config);
</script>
```
### Option 3: Summernote
```html
<!-- dependencies (Summernote depends on Bootstrap & jQuery) -->
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.3/summernote.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.3/summernote.js"></script>
<!-- markup -->
<textarea id="summernote-editor" name="content">{!! old('content', $content) !!}</textarea>
<!-- summernote config -->
<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;
};
// 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() {
lfm({type: 'image', prefix: '/file-manager'}, function(url, path) {
context.invoke('insertImage', url);
});
}
});
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
}
})
});
</script>
```
## Standalone button
If you are going to use filemanager independently, meaning set the value of an input to selected photo/file url, follow this structure:
1. Create a button, input, and image preview holder if you are going to choose images.
Specify the id to the input and image preview by `data-input` and `data-preview`.
```html
<div class="input-group">
<span class="input-group-btn">
<a id="lfm" data-input="thumbnail" data-preview="holder" class="btn btn-primary">
<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;">
```
1. Import lfm.js(run `php artisan vendor:publish` if you need).
```html
<script src="/vendor/laravel-filemanager/js/lfm.js"></script>
```
1. Init filemanager with type. (requires jQuery)
```javascript
$('#lfm').filemanager('image');
```
or
```javascript
$('#lfm').filemanager('file');
```
Domain can be specified in the second parameter(optional, but will be required when developing on Windows mechines) :
```javascript
var domain = "{{ url() }}";
$('#lfm').filemanager('image', {prefix: domain});
```
## JavaScript integration
In case you are developing javascript application and you want dynamically to trigger filemanager popup, you can create function like this. It doesn't rely on jQuery.
```javascript
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;
}
```
And use it like this:
```javascript
lfm({type: 'image', prefix: 'prefix'}, function(url, path) {
});
```
## Embed file manager
```html
<iframe src="/laravel-filemanager" style="width: 100%; height: 500px; overflow: hidden; border: none;"></iframe>
```

View File

@@ -0,0 +1,19 @@
## Upgrade instructions
1. Please backup your own `config/lfm.php` before upgrading.
1. Run commands:
```bash
composer update unisharp/laravel-filemanager
php artisan vendor:publish --tag=lfm_view --force
php artisan vendor:publish --tag=lfm_public --force
php artisan vendor:publish --tag=lfm_config --force
php artisan route:clear
php artisan config:clear
```
1. Clear browser cache if page is broken after upgrading.

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>

File diff suppressed because one or more lines are too long

View File

@@ -1,58 +1,149 @@
html, body {
height: 100%;
@media screen and (max-width: 768px) {
#main {
padding: 0px;
}
#nav {
margin-bottom: -1px;
}
#content > .row {
margin: 0px;
}
}
.img-row {
overflow: visible;
margin-bottom: 10px;
}
.container {
height: 100%;
margin-left: 5px;
margin-right: 5px;
width: 99%;
}
.fill {
height: 100%;
min-height: 100%;
}
.wrapper {
height: 100%;
}
#lfm-leftcol {
min-height: 80%;
}
#right-nav {
@media screen and (min-width: 768px) {
#main {
border-left: 1px solid silver;
height: 90%;
min-height: 90%;
}
}
#content {
overflow: auto;
#wrapper {
padding: 0px;
}
#tree1 {
margin-left: 5px;
#wrapper > .panel {
border-radius: 0;
}
.pointer {
cursor: pointer;
#wrapper > .panel > .panel-heading {
border-radius: 0;
}
#wrapper > .panel > .panel-heading > .panel-title {
padding: 10px 0;
}
#wrapper > .row {
margin: 0px;
}
#fab a:hover, #fab a:focus{
color: white;
}
.item_name {
width: 120px;
overflow:hidden;
white-space:nowrap;
text-overflow: ellipsis;
}
.clickable {
cursor: pointer;
}
.img-preview {
background-color: #f7f7f7;
overflow: hidden;
width: 100%;
text-align: center;
height: 200px;
background-color: #f7f7f7;
overflow: hidden;
width: 100%;
text-align: center;
height: 200px;
}
.hidden {
display: none;
display: none;
}
.square {
width: 100%;
padding-bottom: 100%;
position: relative;
border: 1px solid rgb(221, 221, 221);
border-radius: 3px;
// max-width: 210px;
max-height: 210px;
}
.visible-xs .square {
width: 60px;
}
.square > img {
padding: 5px;
position: absolute;
max-width: 100%;
max-height: 100%;
margin: 0 auto;
display: inline-block;
vertical-align: middle;
}
.square > i {
font-size: 80px;
padding: 5px;
position: absolute;
top: calc(50% - 40px);
left: calc(50% - 40px);
}
.visible-xs .square > i {
font-size: 50px;
padding: 0px auto;
padding-top: 5px;
top: calc(50% - 25px);
left: calc(50% - 25px);
}
.caption {
margin-top: 10px;
margin-bottom: 20px;
}
.caption > .btn-group {
width: 100%;
}
.caption > .btn-group > .item_name {
width: calc(100% - 25px);
}
.caption > .btn-group > .dropdown-toggle {
width: 25px;
}
#lfm-loader{
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: gray;
opacity: 0.7;
z-index: 9999;
text-align: center;
}
#lfm-loader:before {
content: "";
display: inline-block;
vertical-align: middle;
height: 100%;
}
#lfm-loader img{
width: 100px;
margin: 0 auto;
display: inline-block;
vertical-align: middle;
}
.table-list-view{
margin-bottom: 120px;
}
.table-list-view .actions{
text-align: right;
}
.table-list-view .actions a:hover{
text-decoration: none;
}

View File

@@ -0,0 +1,671 @@
/**
* CONTENTS
*
* #Introduction........Naming conventions used throughout the code.
*
* #SETTINGS
* Variables............Globally-available variables and config.
*
* #TOOLS
* Mixins...............Useful mixins.
*
* #GENERIC
* Demo styles..........Styles for demo only (consider removing these).
*
* #BASE
* Raw styles...........The very basic component wrapper.
* Modifiers............The basic styles dependant on component placement.
* Debuggers............The basic styles dependant on component placement.
*
* #BUTTONS
* Base..................Wrapping and constraining every button.
* Modifiers.............Styles that depends on state and settings.
* Animations............Main animations of the component.
* Debuggers.............Styles for development.
*
* #LABELS
* Base..................Wrapping and constraining every label.
* Modifiers.............Styles that depends on state and settings.
* Debuggers.............Styles for development.
*
* #DEVELOPMENT
* In development........These styles are in development and not yet finalised
* Debuggers.............Helper styles and flags for development.
*/
/*------------------------------------*\
#Introduction
\*------------------------------------*/
/**
* The code AND the comments use naming conventions to refer to each part of
* the UI put in place by this component. If you see that somewhere they are
* not followed please consider a Pull Request. The naming conventions are:
*
* "Component" : the widget itself as a whole. This is the last time it will be
* called anything different than "component". So, stay away from
* "widget", "button" or anything else when referring to the
* Component in general.
*
* "Main Button" : the button that is always in view. Hovering or clicking on it
* will reveal the child buttons.
*
* "Child buttons" : if you've read the previous point you know what they are.
* Did you read the previous point? :)
*
* "Label(s)" : the tooltip that fades in when hovering over a button.
/*------------------------------------*\
#SETTINGS | Variables
\*------------------------------------*/
/**
* These variables are the default styles that serve as fallback and can be
* easily customised at compile time.
* Consider overriding them in your own style sheets rather than editing them
* here. Refer to the docs for more info.
*/
/* COLORS ----------------------------*/
/* EFFECTS ---------------------------*/
/* SPEEDS ----------------------------*/
/* SIZES -----------------------------*/
/* SPACING ---------------------------*/
/* OTHER VARIABLES -------------------*/
/*------------------------------------*\
#BASE | Raw styles
\*------------------------------------*/
/**
* The very core styling of the button.
* These styles are shared by every instance of the button.
* Styles placed here should NOT care about placement in the screen,
* options chosen by the user or state of the button.
*/
.mfb-component--tl, .mfb-component--tr, .mfb-component--bl, .mfb-component--br {
box-sizing: border-box;
margin: 25px;
position: fixed;
white-space: nowrap;
z-index: 30;
padding-left: 0;
list-style: none; }
.mfb-component--tl *, .mfb-component--tr *, .mfb-component--bl *, .mfb-component--br *, .mfb-component--tl *:before, .mfb-component--tr *:before, .mfb-component--bl *:before, .mfb-component--br *:before, .mfb-component--tl *:after, .mfb-component--tr *:after, .mfb-component--bl *:after, .mfb-component--br *:after {
box-sizing: inherit; }
/*------------------------------------*\
#BASE | Modifiers
\*------------------------------------*/
/**
* These styles depends on the placement of the button.
* Styles can be:
* 1. Top-left: modified by the " --tl " suffix.
* 2. Top-right: modified by the " --tr " suffix.
* 3. Bottom-left: modified by the " --bl " suffix.
* 4. Bottom-right: modified by the " --br " suffix.
*/
.mfb-component--tl {
left: 0;
top: 0; }
.mfb-component--tr {
right: 0;
top: 0; }
.mfb-component--bl {
left: 0;
bottom: 0; }
.mfb-component--br {
right: 0;
bottom: 0; }
/*------------------------------------*\
#BUTTONS | Base
\*------------------------------------*/
.mfb-component__button--main, .mfb-component__button--child {
background-color: #75C7C3;
display: inline-block;
position: relative;
border: none;
border-radius: 50%;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
cursor: pointer;
outline: none;
padding: 0;
position: relative;
-webkit-user-drag: none;
color: #f1f1f1; }
/**
* This is the unordered list for the list items that contain
* the child buttons.
*
*/
.mfb-component__list {
list-style: none;
margin: 0;
padding: 0; }
.mfb-component__list > li {
display: block;
position: absolute;
top: 0;
right: 1px;
padding: 10px 0;
margin: -10px 0; }
/**
* These are the basic styles for all the icons inside the main button
*/
.mfb-component__icon, .mfb-component__main-icon--active,
.mfb-component__main-icon--resting, .mfb-component__child-icon {
position: absolute;
font-size: 18px;
text-align: center;
line-height: 56px;
width: 100%; }
.mfb-component__wrap {
padding: 25px;
margin: -25px; }
[data-mfb-toggle="hover"]:hover .mfb-component__icon, [data-mfb-toggle="hover"]:hover .mfb-component__main-icon--active,
[data-mfb-toggle="hover"]:hover .mfb-component__main-icon--resting, [data-mfb-toggle="hover"]:hover .mfb-component__child-icon,
[data-mfb-state="open"] .mfb-component__icon,
[data-mfb-state="open"] .mfb-component__main-icon--active,
[data-mfb-state="open"] .mfb-component__main-icon--resting,
[data-mfb-state="open"] .mfb-component__child-icon {
-webkit-transform: scale(1) rotate(0deg);
transform: scale(1) rotate(0deg); }
/*------------------------------------*\
#BUTTONS | Modifiers
\*------------------------------------*/
.mfb-component__button--main {
height: 56px;
width: 56px;
z-index: 20; }
.mfb-component__button--child {
height: 56px;
width: 56px; }
.mfb-component__main-icon--active,
.mfb-component__main-icon--resting {
-webkit-transform: scale(1) rotate(360deg);
transform: scale(1) rotate(360deg);
-webkit-transition: -webkit-transform 150ms cubic-bezier(0.4, 0, 1, 1);
transition: transform 150ms cubic-bezier(0.4, 0, 1, 1); }
.mfb-component__child-icon,
.mfb-component__child-icon {
line-height: 56px;
font-size: 18px; }
.mfb-component__main-icon--active {
opacity: 0; }
[data-mfb-toggle="hover"]:hover .mfb-component__main-icon,
[data-mfb-state="open"] .mfb-component__main-icon {
-webkit-transform: scale(1) rotate(0deg);
transform: scale(1) rotate(0deg); }
[data-mfb-toggle="hover"]:hover .mfb-component__main-icon--resting,
[data-mfb-state="open"] .mfb-component__main-icon--resting {
opacity: 0;
position: absolute !important; }
[data-mfb-toggle="hover"]:hover .mfb-component__main-icon--active,
[data-mfb-state="open"] .mfb-component__main-icon--active {
opacity: 1; }
/*------------------------------------*\
#BUTTONS | Animations
\*------------------------------------*/
/**
* SLIDE IN + FADE
* When hovering the main button, the child buttons slide out from beneath
* the main button while transitioning from transparent to opaque.
*
*/
.mfb-component--tl.mfb-slidein .mfb-component__list li,
.mfb-component--tr.mfb-slidein .mfb-component__list li {
opacity: 0;
transition: all 0.5s; }
.mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li, .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li,
.mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li,
.mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li {
opacity: 1; }
.mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(70px);
transform: translateY(70px); }
.mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(140px);
transform: translateY(140px); }
.mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(210px);
transform: translateY(210px); }
.mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(280px);
transform: translateY(280px); }
.mfb-component--bl.mfb-slidein .mfb-component__list li,
.mfb-component--br.mfb-slidein .mfb-component__list li {
opacity: 0;
transition: all 0.5s; }
.mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li, .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li,
.mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li,
.mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li {
opacity: 1; }
.mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(-70px);
transform: translateY(-70px); }
.mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(-140px);
transform: translateY(-140px); }
.mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(-210px);
transform: translateY(-210px); }
.mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(-280px);
transform: translateY(-280px); }
/**
* SLIDE IN SPRING
* Same as slide-in but with a springy animation.
*
*/
.mfb-component--tl.mfb-slidein-spring .mfb-component__list li,
.mfb-component--tr.mfb-slidein-spring .mfb-component__list li {
opacity: 0;
transition: all 0.5s;
transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(1) {
transition-delay: 0.05s; }
.mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(2) {
transition-delay: 0.1s; }
.mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(3) {
transition-delay: 0.15s; }
.mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(4) {
transition-delay: 0.2s; }
.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li, .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li,
.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li,
.mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li {
opacity: 1; }
.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
transition-delay: 0.05s;
-webkit-transform: translateY(70px);
transform: translateY(70px); }
.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
transition-delay: 0.1s;
-webkit-transform: translateY(140px);
transform: translateY(140px); }
.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
transition-delay: 0.15s;
-webkit-transform: translateY(210px);
transform: translateY(210px); }
.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
transition-delay: 0.2s;
-webkit-transform: translateY(280px);
transform: translateY(280px); }
.mfb-component--bl.mfb-slidein-spring .mfb-component__list li,
.mfb-component--br.mfb-slidein-spring .mfb-component__list li {
opacity: 0;
transition: all 0.5s;
transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(1) {
transition-delay: 0.05s; }
.mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(2) {
transition-delay: 0.1s; }
.mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(3) {
transition-delay: 0.15s; }
.mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(4) {
transition-delay: 0.2s; }
.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li, .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li,
.mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li,
.mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li {
opacity: 1; }
.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
transition-delay: 0.05s;
-webkit-transform: translateY(-70px);
transform: translateY(-70px); }
.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
transition-delay: 0.1s;
-webkit-transform: translateY(-140px);
transform: translateY(-140px); }
.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
transition-delay: 0.15s;
-webkit-transform: translateY(-210px);
transform: translateY(-210px); }
.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
transition-delay: 0.2s;
-webkit-transform: translateY(-280px);
transform: translateY(-280px); }
/**
* ZOOM-IN
* When hovering the main button, the child buttons grow
* from zero to normal size.
*
*/
.mfb-component--tl.mfb-zoomin .mfb-component__list li,
.mfb-component--tr.mfb-zoomin .mfb-component__list li {
-webkit-transform: scale(0);
transform: scale(0); }
.mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(70px) scale(0);
transform: translateY(70px) scale(0);
transition: all 0.5s;
transition-delay: 0.15s; }
.mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(140px) scale(0);
transform: translateY(140px) scale(0);
transition: all 0.5s;
transition-delay: 0.1s; }
.mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(210px) scale(0);
transform: translateY(210px) scale(0);
transition: all 0.5s;
transition-delay: 0.05s; }
.mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(280px) scale(0);
transform: translateY(280px) scale(0);
transition: all 0.5s;
transition-delay: 0s; }
.mfb-component--tl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--tl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(70px) scale(1);
transform: translateY(70px) scale(1);
transition-delay: 0.05s; }
.mfb-component--tl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--tl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(140px) scale(1);
transform: translateY(140px) scale(1);
transition-delay: 0.1s; }
.mfb-component--tl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--tl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(210px) scale(1);
transform: translateY(210px) scale(1);
transition-delay: 0.15s; }
.mfb-component--tl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--tl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(280px) scale(1);
transform: translateY(280px) scale(1);
transition-delay: 0.2s; }
.mfb-component--bl.mfb-zoomin .mfb-component__list li,
.mfb-component--br.mfb-zoomin .mfb-component__list li {
-webkit-transform: scale(0);
transform: scale(0); }
.mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(-70px) scale(0);
transform: translateY(-70px) scale(0);
transition: all 0.5s;
transition-delay: 0.15s; }
.mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(-140px) scale(0);
transform: translateY(-140px) scale(0);
transition: all 0.5s;
transition-delay: 0.1s; }
.mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(-210px) scale(0);
transform: translateY(-210px) scale(0);
transition: all 0.5s;
transition-delay: 0.05s; }
.mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(-280px) scale(0);
transform: translateY(-280px) scale(0);
transition: all 0.5s;
transition-delay: 0s; }
.mfb-component--bl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--bl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(-70px) scale(1);
transform: translateY(-70px) scale(1);
transition-delay: 0.05s; }
.mfb-component--bl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--bl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(-140px) scale(1);
transform: translateY(-140px) scale(1);
transition-delay: 0.1s; }
.mfb-component--bl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--bl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(-210px) scale(1);
transform: translateY(-210px) scale(1);
transition-delay: 0.15s; }
.mfb-component--bl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--bl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(-280px) scale(1);
transform: translateY(-280px) scale(1);
transition-delay: 0.2s; }
/**
* FOUNTAIN
* When hovering the main button the child buttons
* jump into view from outside the viewport
*/
.mfb-component--tl.mfb-fountain .mfb-component__list li,
.mfb-component--tr.mfb-fountain .mfb-component__list li {
-webkit-transform: scale(0);
transform: scale(0); }
.mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(-70px) scale(0);
transform: translateY(-70px) scale(0);
transition: all 0.5s;
transition-delay: 0.15s; }
.mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(-140px) scale(0);
transform: translateY(-140px) scale(0);
transition: all 0.5s;
transition-delay: 0.1s; }
.mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(-210px) scale(0);
transform: translateY(-210px) scale(0);
transition: all 0.5s;
transition-delay: 0.05s; }
.mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(-280px) scale(0);
transform: translateY(-280px) scale(0);
transition: all 0.5s;
transition-delay: 0s; }
.mfb-component--tl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--tl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
.mfb-component--tr.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(70px) scale(1);
transform: translateY(70px) scale(1);
transition-delay: 0.05s; }
.mfb-component--tl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--tl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
.mfb-component--tr.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(140px) scale(1);
transform: translateY(140px) scale(1);
transition-delay: 0.1s; }
.mfb-component--tl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--tl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
.mfb-component--tr.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(210px) scale(1);
transform: translateY(210px) scale(1);
transition-delay: 0.15s; }
.mfb-component--tl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--tl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
.mfb-component--tr.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(280px) scale(1);
transform: translateY(280px) scale(1);
transition-delay: 0.2s; }
.mfb-component--bl.mfb-fountain .mfb-component__list li,
.mfb-component--br.mfb-fountain .mfb-component__list li {
-webkit-transform: scale(0);
transform: scale(0); }
.mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(70px) scale(0);
transform: translateY(70px) scale(0);
transition: all 0.5s;
transition-delay: 0.15s; }
.mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(140px) scale(0);
transform: translateY(140px) scale(0);
transition: all 0.5s;
transition-delay: 0.1s; }
.mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(210px) scale(0);
transform: translateY(210px) scale(0);
transition: all 0.5s;
transition-delay: 0.05s; }
.mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(280px) scale(0);
transform: translateY(280px) scale(0);
transition: all 0.5s;
transition-delay: 0s; }
.mfb-component--bl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--bl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
.mfb-component--br.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
-webkit-transform: translateY(-70px) scale(1);
transform: translateY(-70px) scale(1);
transition-delay: 0.05s; }
.mfb-component--bl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--bl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
.mfb-component--br.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
-webkit-transform: translateY(-140px) scale(1);
transform: translateY(-140px) scale(1);
transition-delay: 0.1s; }
.mfb-component--bl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--bl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
.mfb-component--br.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
-webkit-transform: translateY(-210px) scale(1);
transform: translateY(-210px) scale(1);
transition-delay: 0.15s; }
.mfb-component--bl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--bl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
.mfb-component--br.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
-webkit-transform: translateY(-280px) scale(1);
transform: translateY(-280px) scale(1);
transition-delay: 0.2s; }
/*------------------------------------*\
#LABELS | base
\*------------------------------------*/
/**
* These are the labels associated to each button,
* exposed only when hovering the related button.
* They are called labels but are in fact data-attributes of
* each button (an anchor tag).
*/
[data-mfb-label]:after {
content: attr(data-mfb-label);
opacity: 0;
transition: all 0.5s;
background: rgba(0, 0, 0, 0.4);
padding: 4px 10px;
border-radius: 3px;
color: rgba(255, 255, 255, 0.8);
font-size: 14px;
font-weight: normal;
pointer-events: none;
line-height: normal;
position: absolute;
top: 50%;
margin-top: -11px;
transition: all 0.5s; }
[data-mfb-toggle="hover"] [data-mfb-label]:hover:after,
[data-mfb-state="open"] [data-mfb-label]:after {
content: attr(data-mfb-label);
opacity: 1;
transition: all 0.3s; }
/*------------------------------------*\
#LABELS | Modifiers
\*------------------------------------*/
.mfb-component--br [data-mfb-label]:after, .mfb-component--tr [data-mfb-label]:after {
content: attr(data-mfb-label);
right: 70px; }
.mfb-component--br .mfb-component__list [data-mfb-label]:after, .mfb-component--tr .mfb-component__list [data-mfb-label]:after {
content: attr(data-mfb-label);
right: 70px; }
.mfb-component--tl [data-mfb-label]:after, .mfb-component--bl [data-mfb-label]:after {
content: attr(data-mfb-label);
left: 70px; }
.mfb-component--tl .mfb-component__list [data-mfb-label]:after, .mfb-component--bl .mfb-component__list [data-mfb-label]:after {
content: attr(data-mfb-label);
left: 70px; }
/*------------------------------------*\
#DEVELOPMENT | In development
\*------------------------------------*/
/**
* This part is where unfinished code should stay.
* When a feature is ready(sh) move these styles to their proper place.
*/
/*------------------------------------*\
#DEVELOPMENT | Debuggers
\*------------------------------------*/
/**
* These are mainly helpers for development. They do not have to end up
* in production but it's handy to keep them when developing.
*/
/**
* Apply this class to the html tag when developing the slide-in button
*/
/*# sourceMappingURL=mfb.css.map */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,33 @@
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
<svg width="120" height="30" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="#fff">
<circle cx="15" cy="15" r="15">
<animate attributeName="r" from="15" to="15"
begin="0s" dur="0.8s"
values="15;9;15" calcMode="linear"
repeatCount="indefinite" />
<animate attributeName="fill-opacity" from="1" to="1"
begin="0s" dur="0.8s"
values="1;.5;1" calcMode="linear"
repeatCount="indefinite" />
</circle>
<circle cx="60" cy="15" r="9" fill-opacity="0.3">
<animate attributeName="r" from="9" to="9"
begin="0s" dur="0.8s"
values="9;15;9" calcMode="linear"
repeatCount="indefinite" />
<animate attributeName="fill-opacity" from="0.5" to="0.5"
begin="0s" dur="0.8s"
values=".5;1;.5" calcMode="linear"
repeatCount="indefinite" />
</circle>
<circle cx="105" cy="15" r="15">
<animate attributeName="r" from="15" to="15"
begin="0s" dur="0.8s"
values="15;9;15" calcMode="linear"
repeatCount="indefinite" />
<animate attributeName="fill-opacity" from="1" to="1"
begin="0s" dur="0.8s"
values="1;.5;1" calcMode="linear"
repeatCount="indefinite" />
</circle>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because one or more lines are too long

View File

@@ -1,33 +1,24 @@
(function( $ ){
$.fn.filemanager = function(type = 'image') {
$.fn.filemanager = function(type, options) {
type = type || 'file';
if (type === 'image' || type === 'images') {
type = 'Images';
} else {
type = 'Files';
}
this.on('click', function(e) {
var route_prefix = (options && options.prefix) ? options.prefix : '/laravel-filemanager';
localStorage.setItem('target_input', $(this).data('input'));
localStorage.setItem('target_preview', $(this).data('preview'));
window.open(route_prefix + '?type=' + type, 'FileManager', 'width=900,height=600');
window.SetUrl = function (url, file_path) {
//set the value of the desired input to image url
var target_input = $('#' + localStorage.getItem('target_input'));
target_input.val(file_path).trigger('change');
let input_id = this.data('input');
let preview_id = this.data('preview');
this.on('click', function(e) {
localStorage.setItem('target_input', input_id);
localStorage.setItem('target_preview', preview_id);
window.open('/laravel-filemanager?type=' + type, 'FileManager', 'width=900,height=600');
return false;
});
}
//set or change the preview image src
var target_preview = $('#' + localStorage.getItem('target_preview'));
target_preview.attr('src', url).trigger('change');
};
return false;
});
}
})(jQuery);
function SetUrl(url){
//set the value of the desired input to image url
let target_input = $('#' + localStorage.getItem('target_input'));
target_input.val(url);
//set or change the preview image src
let target_preview = $('#' + localStorage.getItem('target_preview'));
target_preview.attr('src',url);
}

View File

@@ -0,0 +1,98 @@
/**
* Material floating button
* By: Nobita
* Repo and docs: https://github.com/nobitagit/material-floating-button
*
* License: MIT
*/
// build script hook - don't remove
;(function ( window, document, undefined ) {
'use strict';
/**
* Some defaults
*/
var clickOpt = 'click',
hoverOpt = 'hover',
toggleMethod = 'data-mfb-toggle',
menuState = 'data-mfb-state',
isOpen = 'open',
isClosed = 'closed',
mainButtonClass = 'mfb-component__button--main';
/**
* Internal references
*/
var elemsToClick,
elemsToHover,
mainButton,
target,
currentState;
/**
* For every menu we need to get the main button and attach the appropriate evt.
*/
function attachEvt( elems, evt ){
for( var i = 0, len = elems.length; i < len; i++ ){
mainButton = elems[i].querySelector('.' + mainButtonClass);
mainButton.addEventListener( evt , toggleButton, false);
}
}
/**
* Remove the hover option, set a click toggle and a default,
* initial state of 'closed' to menu that's been targeted.
*/
function replaceAttrs( elems ){
for( var i = 0, len = elems.length; i < len; i++ ){
elems[i].setAttribute( toggleMethod, clickOpt );
elems[i].setAttribute( menuState, isClosed );
}
}
function getElemsByToggleMethod( selector ){
return document.querySelectorAll('[' + toggleMethod + '="' + selector + '"]');
}
/**
* The open/close action is performed by toggling an attribute
* on the menu main element.
*
* First, check if the target is the menu itself. If it's a child
* keep walking up the tree until we found the main element
* where we can toggle the state.
*/
function toggleButton( evt ){
target = evt.target;
while ( target && !target.getAttribute( toggleMethod ) ){
target = target.parentNode;
if(!target) { return; }
}
currentState = target.getAttribute( menuState ) === isOpen ? isClosed : isOpen;
target.setAttribute(menuState, currentState);
}
/**
* On touch enabled devices we assume that no hover state is possible.
* So, we get the menu with hover action configured and we set it up
* in order to make it usable with tap/click.
**/
if ( window.Modernizr && Modernizr.touch ){
elemsToHover = getElemsByToggleMethod( hoverOpt );
replaceAttrs( elemsToHover );
}
elemsToClick = getElemsByToggleMethod( clickOpt );
attachEvt( elemsToClick, 'click' );
// build script hook - don't remove
})( window, document );

View File

@@ -0,0 +1,375 @@
var show_list;
var sort_type = 'alphabetic';
$(document).ready(function () {
bootbox.setDefaults({locale:lang['locale-bootbox']});
loadFolders();
performLfmRequest('errors')
.done(function (data) {
var response = JSON.parse(data);
for (var i = 0; i < response.length; i++) {
$('#alerts').append(
$('<div>').addClass('alert alert-warning')
.append($('<i>').addClass('fa fa-exclamation-circle'))
.append(' ' + response[i])
);
}
});
$(window).on('dragenter', function(){
$('#uploadModal').modal('show');
});
});
// ======================
// == Navbar actions ==
// ======================
$('#nav-buttons a').click(function (e) {
e.preventDefault();
});
$('#to-previous').click(function () {
var previous_dir = getPreviousDir();
if (previous_dir == '') return;
goTo(previous_dir);
});
$('#add-folder').click(function () {
bootbox.prompt(lang['message-name'], function (result) {
if (result == null) return;
createFolder(result);
});
});
$('#upload').click(function () {
$('#uploadModal').modal('show');
});
$('#upload-btn').click(function () {
$(this).html('')
.append($('<i>').addClass('fa fa-refresh fa-spin'))
.append(" " + lang['btn-uploading'])
.addClass('disabled');
function resetUploadForm() {
$('#uploadModal').modal('hide');
$('#upload-btn').html(lang['btn-upload']).removeClass('disabled');
$('input#upload').val('');
}
$('#uploadForm').ajaxSubmit({
success: function (data, statusText, xhr, $form) {
resetUploadForm();
refreshFoldersAndItems(data);
displaySuccessMessage(data);
},
error: function (jqXHR, textStatus, errorThrown) {
displayErrorResponse(jqXHR);
resetUploadForm();
}
});
});
$('#thumbnail-display').click(function () {
show_list = 0;
loadItems();
});
$('#list-display').click(function () {
show_list = 1;
loadItems();
});
$('#list-sort-alphabetic').click(function() {
sort_type = 'alphabetic';
loadItems();
});
$('#list-sort-time').click(function() {
sort_type = 'time';
loadItems();
});
// ======================
// == Folder actions ==
// ======================
$(document).on('click', '.file-item', function (e) {
useFile($(this).data('id'));
});
$(document).on('click', '.folder-item', function (e) {
goTo($(this).data('id'));
});
function goTo(new_dir) {
$('#working_dir').val(new_dir);
loadItems();
}
function getPreviousDir() {
var ds = '/';
var working_dir = $('#working_dir').val();
var last_ds = working_dir.lastIndexOf(ds);
var previous_dir = working_dir.substring(0, last_ds);
return previous_dir;
}
function dir_starts_with(str) {
return $('#working_dir').val().indexOf(str) === 0;
}
function setOpenFolders() {
var folders = $('.folder-item');
for (var i = folders.length - 1; i >= 0; i--) {
// close folders that are not parent
if (! dir_starts_with($(folders[i]).data('id'))) {
$(folders[i]).children('i').removeClass('fa-folder-open').addClass('fa-folder');
} else {
$(folders[i]).children('i').removeClass('fa-folder').addClass('fa-folder-open');
}
}
}
// ====================
// == Ajax actions ==
// ====================
function performLfmRequest(url, parameter, type) {
var data = defaultParameters();
if (parameter != null) {
$.each(parameter, function (key, value) {
data[key] = value;
});
}
return $.ajax({
type: 'GET',
dataType: type || 'text',
url: lfm_route + '/' + url,
data: data,
cache: false
}).fail(function (jqXHR, textStatus, errorThrown) {
displayErrorResponse(jqXHR);
});
}
function displayErrorResponse(jqXHR) {
notify('<div style="max-height:50vh;overflow: scroll;">' + jqXHR.responseText + '</div>');
}
function displaySuccessMessage(data){
if(data == 'OK'){
var success = $('<div>').addClass('alert alert-success')
.append($('<i>').addClass('fa fa-check'))
.append(' File Uploaded Successfully.');
$('#alerts').append(success);
setTimeout(function () {
success.remove();
}, 2000);
}
}
var refreshFoldersAndItems = function (data) {
loadFolders();
if (data != 'OK') {
data = Array.isArray(data) ? data.join('<br/>') : data;
notify(data);
}
};
var hideNavAndShowEditor = function (data) {
$('#nav-buttons > ul').addClass('hidden');
$('#content').html(data);
}
function loadFolders() {
performLfmRequest('folders', {}, 'html')
.done(function (data) {
$('#tree').html(data);
loadItems();
});
}
function loadItems() {
$('#lfm-loader').show();
performLfmRequest('jsonitems', {show_list: show_list, sort_type: sort_type}, 'html')
.done(function (data) {
var response = JSON.parse(data);
$('#content').html(response.html);
$('#nav-buttons > ul').removeClass('hidden');
$('#working_dir').val(response.working_dir);
$('#current_dir').text(response.working_dir);
console.log('Current working_dir : ' + $('#working_dir').val());
if (getPreviousDir() == '') {
$('#to-previous').addClass('hide');
} else {
$('#to-previous').removeClass('hide');
}
setOpenFolders();
})
.always(function(){
$('#lfm-loader').hide();
});
}
function createFolder(folder_name) {
performLfmRequest('newfolder', {name: folder_name})
.done(refreshFoldersAndItems);
}
function rename(item_name) {
bootbox.prompt({
title: lang['message-rename'],
value: item_name,
callback: function (result) {
if (result == null) return;
performLfmRequest('rename', {
file: item_name,
new_name: result
}).done(refreshFoldersAndItems);
}
});
}
function trash(item_name) {
bootbox.confirm(lang['message-delete'], function (result) {
if (result == true) {
performLfmRequest('delete', {items: item_name})
.done(refreshFoldersAndItems);
}
});
}
function cropImage(image_name) {
performLfmRequest('crop', {img: image_name})
.done(hideNavAndShowEditor);
}
function resizeImage(image_name) {
performLfmRequest('resize', {img: image_name})
.done(hideNavAndShowEditor);
}
function download(file_name) {
var data = defaultParameters();
data['file'] = file_name;
location.href = lfm_route + '/download?' + $.param(data);
}
// ==================================
// == Ckeditor, Bootbox, preview ==
// ==================================
function useFile(file_url) {
function getUrlParam(paramName) {
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i');
var match = window.location.search.match(reParam);
return ( match && match.length > 1 ) ? match[1] : null;
}
function useTinymce3(url) {
var win = tinyMCEPopup.getWindowArg("window");
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = url;
if (typeof(win.ImageDialog) != "undefined") {
// Update image dimensions
if (win.ImageDialog.getImageData) {
win.ImageDialog.getImageData();
}
// Preview if necessary
if (win.ImageDialog.showPreviewImage) {
win.ImageDialog.showPreviewImage(url);
}
}
tinyMCEPopup.close();
}
function useTinymce4AndColorbox(url, field_name) {
parent.document.getElementById(field_name).value = url;
if(typeof parent.tinyMCE !== "undefined") {
parent.tinyMCE.activeEditor.windowManager.close();
}
if(typeof parent.$.fn.colorbox !== "undefined") {
parent.$.fn.colorbox.close();
}
}
function useCkeditor3(url) {
if (window.opener) {
// Popup
window.opener.CKEDITOR.tools.callFunction(getUrlParam('CKEditorFuncNum'), url);
} else {
// Modal (in iframe)
parent.CKEDITOR.tools.callFunction(getUrlParam('CKEditorFuncNum'), url);
parent.CKEDITOR.tools.callFunction(getUrlParam('CKEditorCleanUpFuncNum'));
}
}
function useFckeditor2(url) {
var p = url;
var w = data['Properties']['Width'];
var h = data['Properties']['Height'];
window.opener.SetUrl(p,w,h);
}
var url = file_url;
var field_name = getUrlParam('field_name');
var is_ckeditor = getUrlParam('CKEditor');
var is_fcke = typeof data != 'undefined' && data['Properties']['Width'] != '';
var file_path = url.replace(route_prefix, '');
if (window.opener || window.tinyMCEPopup || field_name || getUrlParam('CKEditorCleanUpFuncNum') || is_ckeditor) {
if (window.tinyMCEPopup) { // use TinyMCE > 3.0 integration method
useTinymce3(url);
} else if (field_name) { // tinymce 4 and colorbox
useTinymce4AndColorbox(url, field_name);
} else if(is_ckeditor) { // use CKEditor 3.0 + integration method
useCkeditor3(url);
} else if (is_fcke) { // use FCKEditor 2.0 integration method
useFckeditor2(url);
} else { // standalone button or other situations
window.opener.SetUrl(url, file_path);
}
if (window.opener) {
window.close();
}
} else {
// No editor found, open/download file using browser's default method
window.open(url);
}
}
//end useFile
function defaultParameters() {
return {
working_dir: $('#working_dir').val(),
type: $('#type').val()
};
}
function notImp() {
notify('Not yet implemented!');
}
function notify(message) {
bootbox.alert(message);
}
function fileView(file_url, timestamp) {
bootbox.dialog({
title: lang['title-view'],
message: $('<img>')
.addClass('img img-responsive center-block')
.attr('src', file_url + '?timestamp=' + timestamp),
size: 'large',
onEscape: true,
backdrop: true
});
}

View File

@@ -0,0 +1,17 @@
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
/**
* Class DemoController.
*/
class DemoController extends LfmController
{
/**
* @return mixed
*/
public function index()
{
return view('laravel-filemanager::demo');
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Response;
/**
* Class RedirectController.
*/
class RedirectController extends LfmController
{
private $file_path;
public function __construct()
{
$delimiter = config('lfm.url_prefix', config('lfm.prefix')). '/';
$url = urldecode(request()->url());
$external_path = substr($url, strpos($url, $delimiter) + strlen($delimiter));
$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)) {
abort(404);
}
$file = File::get($file_path);
$type = parent::getFileType($file_path);
$response = Response::make($file);
$response->header('Content-Type', $type);
return $response;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class FolderIsRenaming
{
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

@@ -1,10 +1,11 @@
<?php
namespace Unisharp\Laravelfilemanager\Events;
namespace UniSharp\LaravelFilemanager\Events;
class FolderWasRenamed
{
private $path;
private $old_path;
private $new_path;
public function __construct($old_path, $new_path)
{
@@ -15,14 +16,13 @@ class FolderWasRenamed
/**
* @return string
*/
public function old_path()
public function oldPath()
{
return $this->old_path;
}
public function new_path()
public function newPath()
{
return $this->new_path;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace UniSharp\LaravelFilemanager\Events;
class ImageIsCropping
{
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 ImageIsDeleting
{
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 ImageIsRenaming
{
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 ImageIsResizing
{
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 ImageIsUploading
{
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 ImageWasCropped
{
private $path;
public function __construct($path)
{
$this->path = $path;
}
/**
* @return string
*/
public function path()
{
return $this->path;
}
}

View File

@@ -1,6 +1,6 @@
<?php
namespace Unisharp\Laravelfilemanager\Events;
namespace UniSharp\LaravelFilemanager\Events;
class ImageWasDeleted
{
@@ -18,5 +18,4 @@ class ImageWasDeleted
{
return $this->path;
}
}

View File

@@ -1,10 +1,11 @@
<?php
namespace Unisharp\Laravelfilemanager\Events;
namespace UniSharp\LaravelFilemanager\Events;
class ImageWasRenamed
{
private $path;
private $old_path;
private $new_path;
public function __construct($old_path, $new_path)
{
@@ -15,14 +16,13 @@ class ImageWasRenamed
/**
* @return string
*/
public function old_path()
public function oldPath()
{
return $this->old_path;
}
public function new_path()
public function newPath()
{
return $this->new_path;
}
}

View File

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

View File

@@ -1,6 +1,6 @@
<?php
namespace Unisharp\Laravelfilemanager\Events;
namespace UniSharp\LaravelFilemanager\Events;
class ImageWasUploaded
{
@@ -18,5 +18,4 @@ class ImageWasUploaded
{
return $this->path;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace UniSharp\LaravelFilemanager\Handlers;
class ConfigHandler
{
public function userField()
{
return auth()->user()->id;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Handlers;
class LfmConfigHandler extends \UniSharp\LaravelFilemanager\Handlers\ConfigHandler
{
public function userField()
{
return parent::userField();
}
}

View File

@@ -1,15 +1,15 @@
<?php namespace Unisharp\Laravelfilemanager;
<?php
namespace UniSharp\LaravelFilemanager;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider;
/**
* Class LaravelFilemanagerServiceProvider
* @package Unisharp\Laravelfilemanager
* Class LaravelFilemanagerServiceProvider.
*/
class LaravelFilemanagerServiceProvider extends ServiceProvider {
class LaravelFilemanagerServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
@@ -17,8 +17,9 @@ class LaravelFilemanagerServiceProvider extends ServiceProvider {
*/
public function boot()
{
if (Config::get('lfm.use_package_routes'))
if (Config::get('lfm.use_package_routes')) {
include __DIR__ . '/routes.php';
}
$this->loadTranslationsFrom(__DIR__.'/lang', 'laravel-filemanager');
@@ -28,13 +29,17 @@ class LaravelFilemanagerServiceProvider extends ServiceProvider {
__DIR__ . '/config/lfm.php' => base_path('config/lfm.php'),
], 'lfm_config');
$this->publishes([
__DIR__.'/../public' => public_path('vendor/laravel-filemanager'),
$this->publishes([
__DIR__.'/../public' => public_path('vendor/laravel-filemanager'),
], 'lfm_public');
$this->publishes([
__DIR__.'/views' => base_path('resources/views/vendor/laravel-filemanager'),
], 'lfm_view');
$this->publishes([
__DIR__.'/Handlers/LfmConfigHandler.php' => base_path('app/Handlers/LfmConfigHandler.php'),
], 'lfm_handler');
}
/**
@@ -44,10 +49,8 @@ class LaravelFilemanagerServiceProvider extends ServiceProvider {
*/
public function register()
{
$this->app['laravel-filemanager'] = $this->app->share(function ()
{
$this->app->singleton('laravel-filemanager', function () {
return true;
});
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace UniSharp\LaravelFilemanager\Middlewares;
use Closure;
use UniSharp\LaravelFilemanager\Traits\LfmHelpers;
class CreateDefaultFolder
{
use LfmHelpers;
public function handle($request, Closure $next)
{
$this->checkDefaultFolderExists('user');
$this->checkDefaultFolderExists('share');
return $next($request);
}
private function checkDefaultFolderExists($type = 'share')
{
if ($type === 'user' && ! $this->allowMultiUser()) {
return;
}
if ($type === 'share' && ! $this->allowShareFolder()) {
return;
}
$path = $this->getRootFolderPath($type);
$this->createFolderByPath($path);
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace UniSharp\LaravelFilemanager\Middlewares;
use Closure;
use UniSharp\LaravelFilemanager\Traits\LfmHelpers;
class MultiUser
{
use LfmHelpers;
public function handle($request, Closure $next)
{
if ($this->allowMultiUser()) {
$previous_dir = $request->input('working_dir');
$working_dir = $this->rootFolder('user');
if ($previous_dir == null) {
$request->merge(compact('working_dir'));
} elseif (! $this->validDir($previous_dir)) {
$request->replace(compact('working_dir'));
}
}
return $next($request);
}
private function validDir($previous_dir)
{
if (starts_with($previous_dir, $this->rootFolder('share'))) {
return true;
}
if (starts_with($previous_dir, $this->rootFolder('user'))) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,645 @@
<?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,48 +1,119 @@
<?php
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',
/*
|--------------------------------------------------------------------------
| Multi-User Mode
|--------------------------------------------------------------------------
*/
// 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,
// 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
// Ex: The private folder of user will be named as the user id.
'user_field' => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,
/*
|--------------------------------------------------------------------------
| Working Directory
|--------------------------------------------------------------------------
*/
// 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',
/*
|--------------------------------------------------------------------------
| Startup Views
|--------------------------------------------------------------------------
*/
// The default display type for items.
// Supported: "grid", "list"
'images_startup_view' => 'grid',
'files_startup_view' => 'list',
/*
|--------------------------------------------------------------------------
| Upload / Validation
|--------------------------------------------------------------------------
*/
// If true, the uploaded file will be renamed to uniqid() + file extension.
'rename_file' => true,
'rename_file' => false,
// If rename_file set to false and this set to true, then non-alphanumeric characters in filename will be replaced.
'alphanumeric_filename' => true,
// If true, non-alphanumeric folder name will not be allowed.
'alphanumeric_filename' => false,
// If true, non-alphanumeric folder name will be rejected.
'alphanumeric_directory' => false,
'use_package_routes' => true,
// If true, the uploading file's size will be verified for over than max_image_size/max_file_size.
'should_validate_size' => false,
// For laravel 5.2, please set to ['web', 'auth']
'middlewares' => ['auth'],
'max_image_size' => 50000,
'max_file_size' => 50000,
// Add prefix for routes
'prefix' => 'laravel-filemanager',
// Allow multi_user mode or not.
// If true, laravel-filemanager create private folders for each signed-in user.
'allow_multi_user' => true,
// The database field to identify a user.
// When set to 'id', the private folder will be named as the user id.
// NOTE: make sure to use an unique field.
'user_field' => 'id',
'shared_folder_name' => 'shares',
'thumb_folder_name' => 'thumbs',
'images_dir' => 'public/photos/',
'images_url' => '/photos/',
'files_dir' => 'public/files/',
'files_url' => '/files/',
// If true, the uploading file's mime type will be valid in valid_image_mimetypes/valid_file_mimetypes.
'should_validate_mime' => false,
// available since v1.3.0
'valid_image_mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif'
'image/gif',
'image/svg+xml',
],
// If true, image thumbnails would be created during upload
'should_create_thumbnails' => true,
// Create thumbnails automatically only for listed types.
'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,
// 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' => [
@@ -50,12 +121,27 @@ return [
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
'application/pdf',
'text/plain',
],
// file extensions array, only for showing file information, it won't affect the upload process.
'file_type_array' => [
/*
|--------------------------------------------------------------------------
| Image / Folder Setting
|--------------------------------------------------------------------------
*/
'thumb_img_width' => 200,
'thumb_img_height' => 200,
/*
|--------------------------------------------------------------------------
| File Extension Information
|--------------------------------------------------------------------------
*/
'file_type_array' => [
'pdf' => 'Adobe Acrobat',
'doc' => 'Microsoft Word',
'docx' => 'Microsoft Word',
@@ -70,8 +156,7 @@ return [
'pptx' => 'Microsoft PowerPoint',
],
// file extensions array, only for showing icons, it won't affect the upload process.
'file_icon_array' => [
'file_icon_array' => [
'pdf' => 'fa-file-pdf-o',
'doc' => 'fa-file-word-o',
'docx' => 'fa-file-word-o',
@@ -85,4 +170,20 @@ return [
'ppt' => 'fa-file-powerpoint-o',
'pptx' => 'fa-file-powerpoint-o',
],
/*
|--------------------------------------------------------------------------
| php.ini override
|--------------------------------------------------------------------------
|
| These values override your php.ini settings before uploading files
| Set these to false to ingnore and apply your php.ini settings
|
| Please note that the 'upload_max_filesize' & 'post_max_size'
| directives are not supported.
*/
'php_ini_overrides' => [
'memory_limit' => '256M',
],
];

View File

@@ -1,4 +1,6 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;

View File

@@ -1,52 +1,69 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\View;
use Intervention\Image\Facades\Image;
use UniSharp\LaravelFilemanager\Events\ImageIsCropping;
use UniSharp\LaravelFilemanager\Events\ImageWasCropped;
/**
* Class CropController
* @package Unisharp\Laravelfilemanager\controllers
* Class CropController.
*/
class CropController extends LfmController {
class CropController extends LfmController
{
/**
* Show crop page
* Show crop page.
*
* @return mixed
*/
public function getCrop()
{
$working_dir = Input::get('working_dir');
$img = parent::getUrl('directory') . Input::get('img');
$working_dir = request('working_dir');
$img = parent::objectPresenter(parent::getCurrentPath(request('img')));
return View::make('laravel-filemanager::crop')
return view('laravel-filemanager::crop')
->with(compact('working_dir', 'img'));
}
/**
* Crop the image (called via ajax)
* Crop the image (called via ajax).
*/
public function getCropimage()
public function getCropimage($overWrite = true)
{
$image = Input::get('img');
$dataX = Input::get('dataX');
$dataY = Input::get('dataY');
$dataHeight = Input::get('dataHeight');
$dataWidth = Input::get('dataWidth');
$dataX = request('dataX');
$dataY = request('dataY');
$dataHeight = request('dataHeight');
$dataWidth = request('dataWidth');
$image_path = parent::getCurrentPath(request('img'));
$crop_path = $image_path;
if (! $overWrite) {
$fileParts = explode('.', request('img'));
$fileParts[count($fileParts) - 2] = $fileParts[count($fileParts) - 2] . '_cropped_' . time();
$crop_path = parent::getCurrentPath(implode('.', $fileParts));
}
event(new ImageIsCropping($image_path));
// crop image
$tmp_img = Image::make(public_path() . $image);
$tmp_img->crop($dataWidth, $dataHeight, $dataX, $dataY)
->save(public_path() . $image);
Image::make($image_path)
->crop($dataWidth, $dataHeight, $dataX, $dataY)
->save($crop_path);
// make new thumbnail
$thumb_img = Image::make(public_path() . $image);
$thumb_img->fit(200, 200)
->save(parent::getPath('thumb') . parent::getFileName($image)['short']);
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)));
}
event(new ImageWasCropped($image_path));
}
public function getNewCropimage()
{
$this->getCropimage(false);
}
}

View File

@@ -1,55 +1,56 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Support\Facades\Event;
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Input;
use Lang;
use Unisharp\Laravelfilemanager\Events\ImageWasDeleted;
use UniSharp\LaravelFilemanager\Events\ImageIsDeleting;
use UniSharp\LaravelFilemanager\Events\ImageWasDeleted;
/**
* Class CropController
* @package Unisharp\Laravelfilemanager\controllers
* Class CropController.
*/
class DeleteController extends LfmController {
class DeleteController extends LfmController
{
/**
* Delete image and associated thumbnail
* Delete image and associated thumbnail.
*
* @return mixed
*/
public function getDelete()
{
$name_to_delete = Input::get('items');
$name_to_delete = request('items');
$file_path = parent::getPath('directory');
$file_to_delete = parent::getCurrentPath($name_to_delete);
$thumb_to_delete = parent::getThumbPath($name_to_delete);
$file_to_delete = $file_path . $name_to_delete;
$thumb_to_delete = parent::getPath('thumb') . $name_to_delete;
event(new ImageIsDeleting($file_to_delete));
if (!File::exists($file_to_delete)) {
return $file_to_delete . ' not found!';
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 (sizeof(File::files($file_to_delete)) != 0) {
return Lang::get('laravel-filemanager::lfm.error-delete');
if (! parent::directoryIsEmpty($file_to_delete)) {
return parent::error('delete-folder');
}
File::deleteDirectory($file_to_delete);
return 'OK';
return parent::$success_response;
}
File::delete($file_to_delete);
Event::fire(new ImageWasDeleted($file_to_delete));
if ('Images' === $this->file_type) {
if (parent::fileIsImage($file_to_delete)) {
File::delete($thumb_to_delete);
}
return 'OK';
}
File::delete($file_to_delete);
event(new ImageWasDeleted($file_to_delete));
return parent::$success_response;
}
}

View File

@@ -1,24 +1,19 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Response;
namespace UniSharp\LaravelFilemanager\Controllers;
/**
* Class DownloadController
* @package Unisharp\Laravelfilemanager\controllers
* Class DownloadController.
*/
class DownloadController extends LfmController {
class DownloadController extends LfmController
{
/**
* Download a file
* Download a file.
*
* @return mixed
*/
public function getDownload()
{
return Response::download(parent::getPath('directory') . Input::get('file'));
return response()->download(parent::getCurrentPath(request('file')));
}
}

View File

@@ -1,61 +1,75 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Config;
use Lang;
/**
* Class FolderController
* @package Unisharp\Laravelfilemanager\controllers
* Class FolderController.
*/
class FolderController extends LfmController {
class FolderController extends LfmController
{
/**
* Get list of folders as json to populate treeview
* Get list of folders as json to populate treeview.
*
* @return mixed
*/
public function getFolders()
{
$user_path = parent::getPath('user');
$lfm_user_path = parent::getFileName($user_path);
$user_folders = parent::getDirectories($user_path);
$folder_types = [];
$root_folders = [];
$share_path = parent::getPath('share');
$lfm_share_path = parent::getFileName($share_path);
$shared_folders = parent::getDirectories($share_path);
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)),
]);
}
return view('laravel-filemanager::tree')
->with('user_dir', $lfm_user_path['long'])
->with('dirs', $user_folders)
->with('share_dir', $lfm_share_path['long'])
->with('shares', $shared_folders);
->with(compact('root_folders'));
}
/**
* Add a new folder
* Add a new folder.
*
* @return mixed
*/
public function getAddfolder()
{
$folder_name = trim(Input::get('name'));
$folder_name = parent::translateFromUtf8(trim(request('name')));
$path = parent::getCurrentPath($folder_name);
$path = parent::getPath('directory') . $folder_name;
if (empty($folder_name)) {
return parent::error('folder-name');
}
if (File::exists($path)) {
return Lang::get('laravel-filemanager::lfm.error-folder-exist');
} elseif (empty($folder_name)) {
return Lang::get('laravel-filemanager::lfm.error-folder-name');
} elseif (Config::get('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $folder_name)) {
return Lang::get('laravel-filemanager::lfm.error-folder-alnum');
} else {
File::makeDirectory($path, $mode = 0777, true, true);
return 'OK';
return parent::error('folder-exist');
}
}
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

@@ -1,90 +1,60 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Input;
namespace UniSharp\LaravelFilemanager\Controllers;
/**
* Class ItemsController
* @package Unisharp\Laravelfilemanager\controllers
* Class ItemsController.
*/
class ItemsController extends LfmController {
class ItemsController extends LfmController
{
/**
* Get the images to load for a selected folder
* Get the images to load for a selected folder.
*
* @return mixed
*/
public function getItems()
{
$type = Input::get('type');
$view = $this->getView();
$path = parent::getPath();
$path = parent::getCurrentPath();
$sort_type = request('sort_type');
$files = File::files($path);
$file_info = $this->getFileInfos($files, $type);
$directories = parent::getDirectories($path);
$thumb_url = parent::getUrl('thumb');
$files = parent::sortFilesAndDirectories(parent::getFilesWithInfo($path), $sort_type);
$directories = parent::sortFilesAndDirectories(parent::getDirectories($path), $sort_type);
return view($view)
->with(compact('type', 'file_info', 'directories', 'thumb_url'));
return [
'html' => (string) view($this->getView())->with([
'files' => $files,
'directories' => $directories,
'items' => array_merge($directories, $files),
]),
'working_dir' => parent::getInternalPath($path),
];
}
private function getFileInfos($files, $type = 'Images')
{
$file_info = [];
foreach ($files as $key => $file) {
$file_name = parent::getFileName($file)['short'];
$file_created = filemtime($file);
$file_size = number_format((File::size($file) / 1024), 2, ".", "");
if ($file_size > 1024) {
$file_size = number_format(($file_size / 1024), 2, ".", "") . " Mb";
} else {
$file_size = $file_size . " Kb";
}
if ($type === 'Images') {
$file_type = File::mimeType($file);
$icon = '';
} else {
$extension = strtolower(File::extension($file_name));
$icon_array = Config::get('lfm.file_icon_array');
$type_array = Config::get('lfm.file_type_array');
if (array_key_exists($extension, $icon_array)) {
$icon = $icon_array[$extension];
$file_type = $type_array[$extension];
} else {
$icon = "fa-file";
$file_type = "File";
}
}
$file_info[$key] = [
'name' => $file_name,
'size' => $file_size,
'created' => $file_created,
'type' => $file_type,
'icon' => $icon,
];
}
return $file_info;
}
private function getView()
{
if (Input::get('show_list') == 1) {
return 'laravel-filemanager::list-view';
} else {
return 'laravel-filemanager::grid-view';
$view_type = request('show_list');
if (null === $view_type) {
return $this->composeViewName($this->getStartupViewFromConfig());
}
$view_mapping = [
'0' => 'grid',
'1' => 'list'
];
return $this->composeViewName($view_mapping[$view_type]);
}
private function composeViewName($view_type = 'grid')
{
return "laravel-filemanager::$view_type-view";
}
private function getStartupViewFromConfig($default = 'grid')
{
$type_key = parent::currentLfmType();
$startup_view = config('lfm.' . $type_key . 's_startup_view', $default);
return $startup_view;
}
}

View File

@@ -1,180 +1,49 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Input;
namespace UniSharp\LaravelFilemanager\Controllers;
use UniSharp\LaravelFilemanager\Traits\LfmHelpers;
/**
* Class LfmController
* @package Unisharp\Laravelfilemanager\controllers
* Class LfmController.
*/
class LfmController extends Controller {
class LfmController extends Controller
{
use LfmHelpers;
/**
* @var
*/
public $file_location = null;
public $dir_location = null;
public $file_type = null;
protected static $success_response = 'OK';
/**
* Constructor
*/
public function __construct()
{
$this->file_type = Input::get('type', 'Images'); // default set to Images.
if ('Images' === $this->file_type) {
$this->dir_location = Config::get('lfm.images_url');
$this->file_location = Config::get('lfm.images_dir');
} elseif ('Files' === $this->file_type) {
$this->dir_location = Config::get('lfm.files_url');
$this->file_location = Config::get('lfm.files_dir');
} else {
throw new \Exception('unexpected type parameter');
}
$this->checkDefaultFolderExists('user');
$this->checkDefaultFolderExists('share');
$this->applyIniOverrides();
}
/**
* Show the filemanager
* Show the filemanager.
*
* @return mixed
*/
public function show()
{
$working_dir = '/';
$working_dir .= (Config::get('lfm.allow_multi_user')) ? $this->getUserSlug() : Config::get('lfm.shared_folder_name');
$extension_not_found = ! extension_loaded('gd') && ! extension_loaded('imagick');
return view('laravel-filemanager::index')
->with('working_dir', $working_dir)
->with('file_type', $this->file_type)
->with('extension_not_found', $extension_not_found);
return view('laravel-filemanager::index');
}
/*****************************
*** Private Functions ***
*****************************/
private function checkDefaultFolderExists($type = 'share')
public function getErrors()
{
if ($type === 'user' && \Config::get('lfm.allow_multi_user') !== true) {
return;
$arr_errors = [];
if (! extension_loaded('gd') && ! extension_loaded('imagick')) {
array_push($arr_errors, trans('laravel-filemanager::lfm.message-extension_not_found'));
}
$path = $this->getPath($type);
$type_key = $this->currentLfmType();
$mine_config = 'lfm.valid_' . $type_key . '_mimetypes';
$config_error = null;
if (!File::exists($path)) {
File::makeDirectory($path, $mode = 0777, true, true);
}
}
private function formatLocation($location, $type = null, $get_thumb = false)
{
if ($type === 'share') {
return $location . Config::get('lfm.shared_folder_name');
} elseif ($type === 'user') {
return $location . $this->getUserSlug();
if (! is_array(config($mine_config))) {
array_push($arr_errors, 'Config : ' . $mine_config . ' is not a valid array.');
}
$working_dir = Input::get('working_dir');
// remove first slash
if (substr($working_dir, 0, 1) === '/') {
$working_dir = substr($working_dir, 1);
}
$location .= $working_dir;
if ($type === 'directory' || $type === 'thumb') {
$location .= '/';
}
//if user is inside thumbs folder there is no need
// to add thumbs substring to the end of $location
$in_thumb_folder = preg_match('/'.Config::get('lfm.thumb_folder_name').'$/i',$working_dir);
if ($type === 'thumb' && !$in_thumb_folder) {
$location .= Config::get('lfm.thumb_folder_name') . '/';
}
return $location;
}
/****************************
*** Shared Functions ***
****************************/
public function getUserSlug()
{
return empty(auth()->user()) ? '' : \Auth::user()->user_field;
}
public function getPath($type = null, $get_thumb = false)
{
$path = base_path() . '/' . $this->file_location;
$path = $this->formatLocation($path, $type);
return $path;
}
public function getUrl($type = null)
{
$url = $this->dir_location;
$url = $this->formatLocation($url, $type);
$url = str_replace('\\','/',$url);
return $url;
}
public function getDirectories($path)
{
$thumb_folder_name = Config::get('lfm.thumb_folder_name');
$all_directories = File::directories($path);
$arr_dir = [];
foreach ($all_directories as $directory) {
$dir_name = $this->getFileName($directory);
if ($dir_name['short'] !== $thumb_folder_name) {
$arr_dir[] = $dir_name;
}
}
return $arr_dir;
}
public function getFileName($file)
{
$lfm_dir_start = strpos($file, $this->file_location);
$working_dir_start = $lfm_dir_start + strlen($this->file_location);
$lfm_file_path = substr($file, $working_dir_start);
$arr_dir = explode('/', $lfm_file_path);
$arr_filename['short'] = end($arr_dir);
$arr_filename['long'] = '/' . $lfm_file_path;
return $arr_filename;
return $arr_errors;
}
}

View File

@@ -1,61 +1,88 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Support\Facades\Event;
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Str;
use Lang;
use Unisharp\Laravelfilemanager\Events\ImageWasRenamed;
use Unisharp\Laravelfilemanager\Events\FolderWasRenamed;
use UniSharp\LaravelFilemanager\Events\ImageIsRenaming;
use UniSharp\LaravelFilemanager\Events\ImageWasRenamed;
use UniSharp\LaravelFilemanager\Events\FolderIsRenaming;
use UniSharp\LaravelFilemanager\Events\FolderWasRenamed;
/**
* Class RenameController
* @package Unisharp\Laravelfilemanager\controllers
* Class RenameController.
*/
class RenameController extends LfmController {
class RenameController extends LfmController
{
/**
* @return string
*/
public function getRename()
{
$old_name = Input::get('file');
$new_name = trim(Input::get('new_name'));
$file_path = parent::getPath('directory');
$thumb_path = parent::getPath('thumb');
$old_file = $file_path . $old_name;
if (!File::isDirectory($old_file)) {
$extension = File::extension($old_file);
$new_name = str_replace('.' . $extension, '', $new_name) . '.' . $extension;
}
$new_file = $file_path . $new_name;
if (Config::get('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $new_name)) {
return Lang::get('laravel-filemanager::lfm.error-folder-alnum');
} elseif (File::exists($new_file)) {
return Lang::get('laravel-filemanager::lfm.error-rename');
}
$old_name = parent::translateFromUtf8(request('file'));
$new_name = parent::translateFromUtf8(trim(request('new_name')));
$old_file = parent::getCurrentPath($old_name);
if (File::isDirectory($old_file)) {
File::move($old_file, $new_file);
Event::fire(new FolderWasRenamed($old_file, $new_file));
return 'OK';
return $this->renameDirectory($old_name, $new_name);
} else {
return $this->renameFile($old_name, $new_name);
}
}
protected function renameDirectory($old_name, $new_name)
{
if (empty($new_name)) {
return parent::error('folder-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)) {
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));
if ('Images' === $this->file_type) {
File::move($thumb_path . $old_name, $thumb_path . $new_name);
return parent::$success_response;
}
protected function renameFile($old_name, $new_name)
{
if (empty($new_name)) {
return parent::error('file-name');
}
Event::fire(new ImageWasRenamed($old_file, $new_file));
$old_file = parent::getCurrentPath($old_name);
$extension = File::extension($old_file);
$new_file = parent::getCurrentPath(basename($new_name, ".$extension") . ".$extension");
return 'OK';
if (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)) {
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));
}
File::move($old_file, $new_file);
// TODO Should be "FileWasRenamed"
event(new ImageWasRenamed($old_file, $new_file));
return parent::$success_response;
}
}

View File

@@ -1,52 +1,52 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\View;
use Intervention\Image\Facades\Image;
use UniSharp\LaravelFilemanager\Events\ImageIsResizing;
use UniSharp\LaravelFilemanager\Events\ImageWasResized;
/**
* Class ResizeController
* @package Unisharp\Laravelfilemanager\controllers
* Class ResizeController.
*/
class ResizeController extends LfmController {
class ResizeController extends LfmController
{
/**
* Dipsplay image for resizing
* Dipsplay image for resizing.
*
* @return mixed
*/
public function getResize()
{
$ratio = 1.0;
$image = Input::get('img');
$image = request('img');
$path_to_image = parent::getPath('directory') . $image;
$original_width = Image::make($path_to_image)->width();
$original_height = Image::make($path_to_image)->height();
$original_image = Image::make(parent::getCurrentPath($image));
$original_width = $original_image->width();
$original_height = $original_image->height();
$scaled = false;
// FIXME size should be configurable
if ($original_width > 600) {
$ratio = 600 / $original_width;
$width = $original_width * $ratio;
$ratio = 600 / $original_width;
$width = $original_width * $ratio;
$height = $original_height * $ratio;
$scaled = true;
} else {
$width = $original_width;
$width = $original_width;
$height = $original_height;
}
if ($height > 400) {
$ratio = 400 / $original_height;
$width = $original_width * $ratio;
$ratio = 400 / $original_height;
$width = $original_width * $ratio;
$height = $original_height * $ratio;
$scaled = true;
}
return View::make('laravel-filemanager::resize')
->with('img', parent::getUrl('directory') . $image)
return view('laravel-filemanager::resize')
->with('img', parent::objectPresenter(parent::getCurrentPath($image)))
->with('height', number_format($height, 0))
->with('width', $width)
->with('original_height', $original_height)
@@ -55,23 +55,18 @@ class ResizeController extends LfmController {
->with('ratio', $ratio);
}
public function performResize()
{
$img = Input::get('img');
$dataX = Input::get('dataX');
$dataY = Input::get('dataY');
$height = Input::get('dataHeight');
$width = Input::get('dataWidth');
$dataX = request('dataX');
$dataY = request('dataY');
$height = request('dataHeight');
$width = request('dataWidth');
$image_path = parent::getCurrentPath(request('img'));
try {
Image::make(public_path() . $img)->resize($width, $height)->save();
return "OK";
} catch (Exception $e) {
return "width : " . $width . " height: " . $height;
return $e;
}
event(new ImageIsResizing($image_path));
Image::make($image_path)->resize($width, $height)->save();
event(new ImageWasResized($image_path));
return parent::$success_response;
}
}

View File

@@ -1,144 +1,204 @@
<?php namespace Unisharp\Laravelfilemanager\controllers;
<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Support\Facades\Event;
use Unisharp\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Str;
use Lang;
use Illuminate\Support\Facades\Log;
use Intervention\Image\Facades\Image;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Unisharp\Laravelfilemanager\Events\ImageWasUploaded;
use UniSharp\LaravelFilemanager\Events\ImageIsUploading;
use UniSharp\LaravelFilemanager\Events\ImageWasUploaded;
/**
* Class UploadController
* @package Unisharp\Laravelfilemanager\controllers
* Class UploadController.
*/
class UploadController extends LfmController {
class UploadController extends LfmController
{
protected $errors;
private $default_file_types = ['application/pdf'];
private $default_image_types = ['image/jpeg', 'image/png', 'image/gif'];
public function __construct()
{
parent::__construct();
$this->errors = [];
}
/**
* Upload an image/file and (for images) create thumbnail
* Upload files
*
* @param UploadRequest $request
* @param void
* @return string
*/
public function upload()
{
$files = request()->file('upload');
// single file
if (!is_array($files)) {
$file = $files;
if (!$this->fileIsValid($file)) {
return $this->errors;
}
$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 {
$res = $this->uploadValidator();
if (true !== $res) {
return Lang::get('laravel-filemanager::lfm.error-invalid');
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);
}
} 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) {
return $e->getMessage();
array_push($this->errors, parent::error('invalid'));
Log::error($e->getMessage(), [
'file' => $e->getFile(),
'line' => $e->getLine(),
'trace' => $e->getTraceAsString()
]);
return false;
}
$file = Input::file('upload');
$new_filename = $this->getNewName($file);
$dest_path = parent::getPath('directory');
if (File::exists($dest_path . $new_filename)) {
return Lang::get('laravel-filemanager::lfm.error-file-exist');
}
$file->move($dest_path, $new_filename);
if ('Images' === $this->file_type) {
$this->makeThumb($dest_path, $new_filename);
}
Event::fire(new ImageWasUploaded(realpath($dest_path.'/'.$new_filename)));
// upload via ckeditor 'Upload' tab
if (!Input::has('show_list')) {
return $this->useFile($new_filename);
}
return 'OK';
}
private function uploadValidator()
{
// when uploading a file with the POST named "upload"
$expected_file_type = $this->file_type;
$is_valid = false;
$file = Input::file('upload');
if (empty($file)) {
throw new \Exception(Lang::get('laravel-filemanager::lfm.error-file-empty'));
} elseif (!$file instanceof UploadedFile) {
throw new \Exception(Lang::get('laravel-filemanager::lfm.error-instance'));
} elseif ($file->getError() == UPLOAD_ERR_INI_SIZE) {
$max_size = ini_get('upload_max_filesize');
throw new \Exception(Lang::get('laravel-filemanager::lfm.error-file-size', ['max' => $max_size]));
} elseif ($file->getError() != UPLOAD_ERR_OK) {
dd('File failed to upload. Error code: ' . $file->getError());
}
$mimetype = $file->getMimeType();
if ($expected_file_type === 'Files') {
$config_name = 'lfm.valid_file_mimetypes';
$valid_mimetypes = Config::get($config_name, $this->default_file_types);
} else {
$config_name = 'lfm.valid_image_mimetypes';
$valid_mimetypes = Config::get($config_name, $this->default_image_types);
}
if (!is_array($valid_mimetypes)) {
throw new \Exception('Config : ' . $config_name . ' is not set correctly');
}
if (in_array($mimetype, $valid_mimetypes)) {
$is_valid = true;
}
if (false === $is_valid) {
throw new \Exception(Lang::get('laravel-filemanager::lfm.error-mime') . $mimetype);
}
return $is_valid;
}
private function getNewName($file)
{
$new_filename = trim(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME));
if (Config::get('lfm.rename_file') === true) {
$new_filename = uniqid();
} elseif (Config::get('lfm.alphanumeric_filename') === true) {
$new_filename = preg_replace('/[^A-Za-z0-9\-\']/', '_', $new_filename);
}
$new_filename = $new_filename . '.' . $file->getClientOriginalExtension();
// TODO should be "FileWasUploaded"
event(new ImageWasUploaded(realpath($new_file_path)));
return $new_filename;
}
private function makeThumb($dest_path, $new_filename)
private function fileIsValid($file)
{
$thumb_folder_name = Config::get('lfm.thumb_folder_name');
if (!File::exists($dest_path . $thumb_folder_name)) {
File::makeDirectory($dest_path . $thumb_folder_name);
if (empty($file)) {
array_push($this->errors, parent::error('file-empty'));
return false;
}
$thumb_img = Image::make($dest_path . $new_filename);
$thumb_img->fit(200, 200)
->save($dest_path . $thumb_folder_name . '/' . $new_filename);
unset($thumb_img);
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;
}
}
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::getUrl('directory') . $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'>
@@ -159,4 +219,18 @@ class UploadController extends LfmController {
</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;
}
}

View File

@@ -39,7 +39,7 @@ return [
'error-file-empty' => 'يجب اختيارملف!',
'error-file-exist' => 'يوجد ملف سابق بنفس الاسم!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'لا يمكن حذف هذا المجلد لانه غير فارغ!',
'error-delete-folder'=> 'لا يمكن حذف هذا المجلد لانه غير فارغ!',
'error-folder-name' => 'اسم المجلد لا يمكن ان يكون فاغ!',
'error-folder-exist'=> 'اسم المجلد مستخدما مسبقا!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',

View File

@@ -39,7 +39,7 @@ return [
'error-file-empty' => 'Трябва да изберете файл !',
'error-file-exist' => 'Файл с това име вече съществува!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'Не можете да изтриете тази папка, защото не е празна!',
'error-delete-folder'=> 'Не можете да изтриете тази папка, защото не е празна!',
'error-folder-name' => 'Моля изберете име на папката',
'error-folder-exist'=> 'Папка с това име вече съществува!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',

View File

@@ -0,0 +1,72 @@
<?php
return [
'nav-back' => 'Zurück',
'nav-new' => 'Neuer Ordner',
'nav-upload' => 'Hochladen',
'nav-thumbnails' => 'Thumbnails',
'nav-list' => 'List',
'menu-rename' => 'Umbenennen',
'menu-delete' => 'Löschen',
'menu-view' => 'Ansehen',
'menu-download' => 'Download',
'menu-resize' => 'Größe Ändern',
'menu-crop' => 'Zuschneiden',
'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',
'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-extension_not_found' => 'Installieren Sie gd oder imagick Erweiterung um Bilder zuzuschneiden, Größe ändern und Thumbnails zu erstellen.',
'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',
'btn-upload' => 'Datei hochladen',
'btn-uploading' => 'Hochladen...',
'btn-close' => 'Schließen',
'btn-crop' => 'Zuschneiden',
'btn-cancel' => 'Stornieren',
'btn-resize' => 'Größe ändern',
'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

@@ -0,0 +1,69 @@
<?php
return [
'nav-back' => 'Επιστροφή',
'nav-new' => 'Νέος φάκελος',
'nav-upload' => 'Ανέβασμα',
'nav-thumbnails' => 'Εικονίδια',
'nav-list' => 'Λίστα',
'menu-rename' => 'Μετονομασία',
'menu-delete' => 'Διαγραφή',
'menu-view' => 'Επισκόπηση',
'menu-download' => 'Κατέβασμα',
'menu-resize' => 'Αλλαγή μεγέθους',
'menu-crop' => 'Κόψιμο',
'title-page' => 'Διαχείριση αρχείων',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Ανέβασμα αρχείου',
'title-view' => 'Επισκόπηση αρχείου',
'title-root' => 'Αρχεία',
'title-shares' => 'Κοινόχρηστα αρχεία',
'title-item' => 'Αντικείμενο',
'title-size' => 'Μέγεθος',
'title-type' => 'Τύπος',
'title-modified' => 'Ανανεώθηκε',
'title-action' => 'Ενέργεια',
'type-folder' => 'Φάκελος',
'message-empty' => 'Ο φάκελος είναι άδειος',
'message-choose' => 'Επιλογή αρχείων',
'message-delete' => 'Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτό το αντικείμενο?',
'message-name' => 'Όνομα φακέλου:',
'message-rename' => 'Μετονομασία σε:',
'message-extension_not_found' => 'Παρακαλούμε κάντε εγκατάσταση του gd ή imagick php προσθετου προκειμένου να μπορείτε να κόψετε, αλλάξετε το μέγεθος και δημιουργήσετε εικονίδια των εικόνων.',
'error-rename' => 'Αυτό το όνομα αρχείου χρησιμοποιείται ήδη',
'error-file-empty' => 'Πρέπει να επιλέξετε ένα αρχείο!',
'error-file-exist' => 'Υπάρχει ήδη αρχείο με αυτό το όνομα!',
'error-file-size' => 'Το μέγεθος του αρχείου ξεπερνά το επιτρεπόμενο όριο σε μέγεθος (μέγιστο μέγεθος: :max)',
'error-delete-folder'=> 'Δεν μπορείτε να διαγράψετε τον φάκελο γιατί περιέχει αρχεία!',
'error-folder-name' => 'Ο φάκελος δεν γίνεται να είναι άδειος',
'error-folder-exist'=> 'Υπάρχει ήδη φάκελος με αυτό το όνομα!',
'error-folder-alnum'=> 'Επιτρέπονται μόνο γράμματα και αριθμοί για το όνομα των φακέλων!',
'error-mime' => 'Λανθασμένος τύπος αρχείου: ',
'error-size' => 'Μέγιστο μέγεθος αρχείου:',
'error-instance' => 'Το ανεβασμένο αρχείο έπρεπε να είναι του τύπου UploadedFile',
'error-invalid' => 'Λάθος αίτημα ανεβάσματος',
'error-other' => 'Παρουσιάστηκε ένα σφάλμα: ',
'error-too-large' => 'Το μέγεθος του αιτήματος είναι πολύ μεγάλο!',
'btn-upload' => 'Ανέβασματα αρχείων',
'btn-uploading' => 'Ανεβασμα...',
'btn-close' => 'Κλείσιμο',
'btn-crop' => 'Κόψιμο',
'btn-cancel' => 'Ακύρωση',
'btn-resize' => 'Αλλαγή μεγέθους',
'resize-ratio' => 'Αναλογία:',
'resize-scaled' => 'Η εικόνα άλλαξε μέγεθος:',
'resize-true' => 'Ναι',
'resize-old-height' => 'Πρωτότυπο ύψος:',
'resize-old-width' => 'Πρωτότυπο πλάτος:',
'resize-new-height' => 'Ύψος:',
'resize-new-width' => 'Μπλάτος:',
'locale-bootbox' => 'el',
];

View File

@@ -6,17 +6,20 @@ return [
'nav-upload' => 'Upload',
'nav-thumbnails' => 'Thumbnails',
'nav-list' => 'List',
'nav-sort' => 'Sort',
'nav-sort-alphabetic'=> 'Sort By Alphabets',
'nav-sort-time' => 'Sort By Time',
'menu-rename' => 'Rename',
'menu-delete' => 'Delete',
'menu-view' => 'View',
'menu-view' => 'Preview',
'menu-download' => 'Download',
'menu-resize' => 'Resize',
'menu-crop' => 'Crop',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Upload File',
'title-upload' => 'Upload File(s)',
'title-view' => 'View File',
'title-root' => 'Files',
'title-shares' => 'Shared Files',
@@ -29,30 +32,34 @@ return [
'type-folder' => 'Folder',
'message-empty' => 'Folder is empty.',
'message-choose' => 'Choose File',
'message-choose' => 'Choose File(s)',
'message-delete' => 'Are you sure you want to delete this item?',
'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.',
'error-rename' => 'File name already in use!',
'error-file-name' => 'File name cannot be empty!',
'error-file-empty' => 'You must choose a file!',
'error-file-exist' => 'A file with this name already exists!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'You cannot delete this folder because it is not empty!',
'error-delete-folder'=> 'You cannot delete this folder because it is not empty!',
'error-folder-name' => 'Folder name cannot be empty!',
'error-folder-exist'=> 'A folder with this name already exists!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',
'error-folder-not-found'=> 'Folder not found! (:folder)',
'error-mime' => 'Unexpected MimeType: ',
'error-size' => 'Over limit size:',
'error-instance' => 'The uploaded file should be an instance of UploadedFile',
'error-invalid' => 'Invalid upload request',
'error-other' => 'An error has occured: ',
'error-too-large' => 'Request entity too large!',
'btn-upload' => 'Upload File',
'btn-upload' => 'Upload File(s)',
'btn-uploading' => 'Uploading...',
'btn-close' => 'Close',
'btn-crop' => 'Crop',
'btn-copy-crop' => 'Copy & Crop',
'btn-cancel' => 'Cancel',
'btn-resize' => 'Resize',
@@ -65,5 +72,4 @@ return [
'resize-new-width' => 'Width:',
'locale-bootbox' => 'en',
'menu-new'=>'New',
];

View File

@@ -40,7 +40,7 @@ return [
'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-delete' => '¡No puedes eliminar esta carpeta porque no está vacía!',
'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-exist'=> '¡Ya existe una carpeta con este nombre!',

View File

@@ -0,0 +1,75 @@
<?php
return [
'nav-back' => 'Atzera',
'nav-new' => 'Karpeta berria',
'nav-upload' => 'Kargatu',
'nav-thumbnails' => 'Koadro txikiak',
'nav-list' => 'Zerrenda',
'nav-sort' => 'Ordenatu',
'nav-sort-alphabetic'=> 'Ordenatu alfabetikoki',
'nav-sort-time' => 'Ordenatu denboraren arabera',
'menu-rename' => 'Aldatu izena',
'menu-delete' => 'Ezabatu',
'menu-view' => 'Aurrebista',
'menu-download' => 'Deskargatu',
'menu-resize' => 'Aldatu tamaina',
'menu-crop' => 'Moztu',
'title-page' => 'Fitxategi-kudeatzailea',
'title-panel' => 'Laravel fitxategi-kudeatzailea',
'title-upload' => 'Kargatu fitxategia(k)',
'title-view' => 'Ikusi fitxategia',
'title-root' => 'Fitxategiak',
'title-shares' => 'Partekatutako fitxategiak',
'title-item' => 'Elementua',
'title-size' => 'Tamaina',
'title-type' => 'Mota',
'title-modified' => 'Aldatua',
'title-action' => 'Ekintza',
'type-folder' => 'Karpeta',
'message-empty' => 'Karpeta hutsik dago.',
'message-choose' => 'Aukeratu fitxategia(k)',
'message-delete' => 'Ziur zaude elementu hau ezabatu nahi duzula?',
'message-name' => 'Karpetaren izena:',
'message-rename' => 'Izen berria:',
'message-extension_not_found' => 'Mesedez, instalatu gd edo imagick hedapena irudiak moztu, tamainaz aldatu eta koadro txikiak sortzeko.',
'error-rename' => 'Fitxategi-izena lehendik badago!',
'error-file-name' => 'Fitxategi-izenak ezin du hutsik egon!',
'error-file-empty' => 'Fitxategi bat aukeratu behar duzu!',
'error-file-exist' => 'Izen hau duen fitxategi bat existitzen da dagoeneko!',
'error-file-size' => 'Fitxategi-tamainak zerbitzariaren muga gainditzen du! (gehienezko tamaina: :max)',
'error-delete-folder'=> 'Ezin duzu karpeta hau ezabatu, ez baitago hutsik!',
'error-folder-name' => 'Karpeta-izenak ezin du hutsik egon!',
'error-folder-exist'=> 'Izen hau duen karpeta bat existitzen da dagoeneko!',
'error-folder-alnum'=> 'Karpeta-izen alfanumerikoak soilik onartzen dira!',
'error-folder-not-found'=> 'Ez da karpeta aurkitu! (:folder)',
'error-mime' => 'Ustekabeko MIME mota: ',
'error-size' => 'Muga gainditzen duen tamaina:',
'error-instance' => 'Kargatutako fitxategiak UploadedFile-en instantzia bat izan behar luke',
'error-invalid' => 'Kargatzeko eskaera baliogabea',
'error-other' => 'Errore bat gertatu da: ',
'error-too-large' => 'Eskaera entitatea handiegia da!',
'btn-upload' => 'Kargatu fitxategia(k)',
'btn-uploading' => 'Kargatzen...',
'btn-close' => 'Itxi',
'btn-crop' => 'Moztu',
'btn-copy-crop' => 'Kopiatu eta moztu',
'btn-cancel' => 'Utzi',
'btn-resize' => 'Aldatu tamainaz',
'resize-ratio' => 'Erlazioa:',
'resize-scaled' => 'Eskalatutako irudia:',
'resize-true' => 'Bai',
'resize-old-height' => 'Jatorrizko altuera:',
'resize-old-width' => 'Jatorrizko zabalera:',
'resize-new-height' => 'Altuera:',
'resize-new-width' => 'Zabalera:',
'locale-bootbox' => 'eu',
];

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' => 'حذف',
@@ -36,16 +39,21 @@ return [
'message-extension_not_found' => '(translation wanted)',
'error-rename' => 'این نام قبلا استفاده شده!',
'error-file-name' => 'نام فایل نباید خالی باشد!',
'error-file-empty' => 'شما باید یک فایل را انتخاب کنید!',
'error-file-exist' => 'یک فایل دیگر با این نام قبلا ایجاد شده است!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'به دلیل خالی نبودن پوشه امکان حذف آن وجود ندارد!',
'error-file-size' => 'محدودیت حجم فایل سرور! (حداکثر حجم: :max)',
'error-delete-folder'=> 'به دلیل خالی نبودن پوشه امکان حذف آن وجود ندارد!',
'error-folder-name' => 'نام پوشه نمی تواند خالی باشد!',
'error-folder-exist'=> 'یک پوشه با این نام قبلا ایجاد شده است!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',
'error-folder-alnum'=> 'فقط اسامی الفبایی برای پوشه مجاز است!',
'error-folder-not-found'=> 'پوشه‌ای یافت نشد! (:folder)',
'error-mime' => 'پسوند غیرمجاز: ',
'error-size' => 'سایز بیش از حد:',
'error-instance' => 'فایل آپلود شده باید نمونه ای از UploadedFile باشد',
'error-invalid' => 'درخواست آپلود غیرمعتبر',
'error-other' => 'خطایی رخ داد: ',
'error-too-large' => 'درخواست موجودیت خیلی طولانیست!',
'btn-upload' => 'آپلود فایل',
'btn-uploading' => 'در حال آپلود',

View File

@@ -1,53 +1,56 @@
<?php
return [
'nav-back' => 'Back',
'nav-back' => 'Retour',
'nav-new' => 'Nouveau dossier',
'nav-upload' => 'Charger',
'nav-upload' => 'Envoyer',
'nav-thumbnails' => 'Vignettes',
'nav-list' => 'Liste',
'nav-sort' => 'Trier',
'nav-sort-alphabetic'=> 'Trier par ordre alphabétique',
'nav-sort-time' => 'Trier par date',
'menu-rename' => 'Renommez',
'menu-rename' => 'Renommer',
'menu-delete' => 'Effacer',
'menu-view' => 'Voir le',
'menu-view' => 'Voir',
'menu-download' => 'Télécharger',
'menu-resize' => 'Redimensionner',
'menu-crop' => 'Récolte',
'menu-crop' => 'Rogner',
'title-page' => 'Gestionnaire de fichiers',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Envoyer un fichier',
'title-upload' => 'Envoyer un/des fichier(s)',
'title-view' => 'Voir le fichier',
'title-root' => 'Fichiers',
'title-shares' => 'Shared Files',
'title-item' => 'Article',
'title-shares' => 'Fichiers partagés',
'title-item' => 'Élement',
'title-size' => 'Taille du fichier',
'title-type' => 'Type de fichier',
'title-modified' => 'Date modifiée',
'title-action' => 'Exécuter laction',
'title-modified' => 'Date de modification',
'title-action' => 'Exécuter',
'type-folder' => 'Dossier',
'message-empty' => 'Dossier est vide',
'message-choose' => 'Choisir un fichier',
'message-choose' => 'Choisir un/des fichier(s)',
'message-delete' => 'Êtes-vous sûr de vouloir supprimer ce fichier ?',
'message-name' => 'Nom du dossier:',
'message-rename' => 'Renommer le dossier:',
'message-extension_not_found' => '(translation wanted)',
'message-name' => 'Nom du dossier :',
'message-rename' => 'Renommer le dossier :',
'message-extension_not_found' => 'Extension inconnue',
'error-rename' => 'Ce nom est déjà pris !',
'error-rename' => 'Nom déjà utilisé',
'error-file-empty' => 'Veuillez choisir un fichier',
'error-file-exist' => 'Un fichier avec ce nom existe déjà !',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => "Vous ne pouvez pas supprimer ce dossier car il n'est pas vide",
'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',
'error-delete-folder'=> "Vous ne pouvez pas supprimer ce dossier car il n'est pas vide",
'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'=> 'Only alphanumeric folder names are allowed!',
'error-mime' => 'Unexpected MimeType: ',
'error-instance' => 'The uploaded file should be an instance of UploadedFile',
'error-invalid' => 'Invalid upload request',
'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-instance' => 'Le fichier doit être une instance de UploadedFile',
'error-invalid' => "Requête d'upload invalide",
'btn-upload' => 'Envoyer le fichier',
'btn-upload' => 'Envoyer le/les fichier(s)',
'btn-uploading' => 'Envoi...',
'btn-close' => 'Fermer',
'btn-crop' => 'Rogner',

View File

@@ -38,7 +38,7 @@ return [
'error-file-empty' => 'עליך לבחור קובץ!',
'error-file-exist' => 'קובץ עם שם זה כבר קיים!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'לא ניתן למחוק תייקיה זו מכיוון שהיא לא ריקה!',
'error-delete-folder'=> 'לא ניתן למחוק תייקיה זו מכיוון שהיא לא ריקה!',
'error-folder-name' => 'נא להזין שם תיקייה!',
'error-folder-exist'=> 'תיקייה עם שם זהה כבר קיימת!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',

View File

@@ -6,6 +6,9 @@ return [
'nav-upload' => 'Feltöltés',
'nav-thumbnails' => 'Miniatűrök',
'nav-list' => 'Lista',
'nav-sort' => 'Rendezés',
'nav-sort-alphabetic'=> 'ABC szerint',
'nav-sort-time' => 'Idő szerint',
'menu-rename' => 'Átnevezés',
'menu-delete' => 'Törlés',
@@ -15,7 +18,7 @@ return [
'menu-crop' => 'Vágás',
'title-page' => 'Fájlkezelő',
'title-panel' => 'Laravel Fájlkezelő',
'title-panel' => 'Fájlkezelő',
'title-upload' => 'Fájl feltöltés',
'title-view' => 'Fájl megtekintés',
'title-root' => 'Fájlok',
@@ -36,21 +39,27 @@ return [
'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.',
'error-rename' => 'A fájl neve használatban!',
'error-file-name' => 'A fájlnév nem lehet üres!',
'error-file-empty' => 'Ki kell választanod egy fájlt!',
'error-file-exist' => 'Egy fájl már létezik ezzel a névvel.',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'Nem tudod törölni ezt a mappát, mert nem üres!',
'error-file-size' => 'A fájl mérete túl nagy a szerverre nem lehet feltölteni! (Maximális megengedett méret: :max)',
'error-delete-folder'=> 'Nem tudod törölni ezt a mappát, mert nem üres!',
'error-folder-name' => 'A mappa neve nem lehet üres!',
'error-folder-exist'=> 'Egy mappa már létezik ezzel a névvel!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',
'error-folder-alnum'=> 'Csak alfanumerikus karakterek lehetnek a mappa nevében!',
'error-folder-not-found'=> 'Nem található a(z) (:folder) nevű mappa!',
'error-mime' => 'Váratlan fájltípusok (MimeType): ',
'error-size' => 'Túl nagy méretű:',
'error-instance' => 'A feltöltött fájlnak egy UploadedFile kérelemnek kellene lennie',
'error-invalid' => 'Érvénytelen kérés a feltöltéssel kapcsolatban.',
'error-other' => 'Hiba történt: ',
'error-too-large' => 'Túl nagyméretű a fájl!',
'btn-upload' => 'Fájl feltöltés',
'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-resize' => 'Átméretezés',

View File

@@ -0,0 +1,75 @@
<?php
return [
'nav-back' => 'უკან',
'nav-new' => 'ახალი საქაღალდე',
'nav-upload' => 'ატვირთვა',
'nav-thumbnails' => 'ესკიზები',
'nav-list' => 'სია',
'nav-sort' => 'სორტირება',
'nav-sort-alphabetic' => 'სორტირება ანბანის მიხედვით',
'nav-sort-time' => 'სორტირება დროის მიხედვით',
'menu-rename' => 'სახელის შეცვლა',
'menu-delete' => 'წაშლა',
'menu-view' => 'ნახვა',
'menu-download' => 'გადმოწერა',
'menu-resize' => 'ზომის შეცვლა',
'menu-crop' => 'ამოჭრა',
'title-page' => 'ფაილების მენეჯერი',
'title-panel' => 'ფაილების მენეჯერი',
'title-upload' => 'ფაილ(ებ)ის ატვირთვა',
'title-view' => 'ფაილის ნახვა',
'title-root' => 'ფაილები',
'title-shares' => 'გაზიარებული ფაილები',
'title-item' => 'Item',
'title-size' => 'ზომა',
'title-type' => 'ტიპი',
'title-modified' => 'დარედაქტირდა',
'title-action' => 'ქმედება',
'type-folder' => 'საქაღალდე',
'message-empty' => 'საქაღალდე ცარიელია.',
'message-choose' => 'ფაილ(ებ)ის არჩევა',
'message-delete' => 'ნამდვილად გსურთ აღნიშნულის წაშლა?',
'message-name' => 'საქაღალდის დასახელება:',
'message-rename' => 'სახელის შეცვლა:',
'message-extension_not_found' => 'გთხოვთ დააყენოთ gd ან imagick გაფართოებები რათა ამოჭრათ, ზომა შეუცვალოთ და გააკეთოთ გამოსახულების ესკიზი.',
'error-rename' => 'ფაილი იდენტური დასახელებით უკვე არსებობს!',
'error-file-name' => 'ფაილის დასახელება არ შეიძლება იყოს ცარიელი!',
'error-file-empty' => 'თქვენ უნდა აირჩიოთ ფაილი!',
'error-file-exist' => 'ფაილი იდენტური სახელით უკვე არსებობს!',
'error-file-size' => 'ფაილის ზომა მეტია დასაშვებზე! (მაქსიმალური ზომა: :max)',
'error-delete-folder' => 'საქაღალდის წაშლა შეუძლებელია, რადგან არ არის ცარიელი!',
'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-cancel' => 'გაუქმება',
'btn-resize' => 'ზომის შეცვლა',
'resize-ratio' => 'პროპორცია:',
'resize-scaled' => 'სკალირებული გამოსახულება:',
'resize-true' => 'კი',
'resize-old-height' => 'ორიგინალის სიმაღლე:',
'resize-old-width' => 'ორიგინალის სიგანე:',
'resize-new-height' => 'სიმაღლე:',
'resize-new-width' => 'სიგანე:',
'locale-bootbox' => 'ka',
];

View File

@@ -1,68 +1,73 @@
<?php
return [
'nav-back' => 'Terug',
'nav-new' => 'Nieuwe Map',
'nav-upload' => 'Upload',
'nav-thumbnails' => 'Thumbnails',
'nav-list' => 'Lijst',
'nav-back' => 'Terug',
'nav-new' => 'Nieuwe Map',
'nav-upload' => 'Upload',
'nav-thumbnails' => 'Thumbnails',
'nav-list' => 'Lijst',
'nav-sort' => 'Sorteren',
'nav-sort-alphabetic' => 'Sorteer op naam',
'nav-sort-time' => 'Sorteer op tijd',
'menu-rename' => 'Hernoemen',
'menu-delete' => 'Verwijderen',
'menu-view' => 'View',
'menu-download' => 'Download',
'menu-resize' => 'Formaat Aanpassen',
'menu-crop' => 'Bijsnijden',
'menu-rename' => 'Hernoemen',
'menu-delete' => 'Verwijderen',
'menu-view' => 'Bekijken',
'menu-download' => 'Download',
'menu-resize' => 'Formaat aanpassen',
'menu-crop' => 'Bijsnijden',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Bestand Uploaden',
'title-view' => 'Bestand Bekijken',
'title-root' => 'Bestanden',
'title-shares' => 'Openbare Map',
'title-item' => 'Item',
'title-size' => 'Grootte',
'title-type' => 'Type',
'title-modified' => 'Gemodificeerd',
'title-action' => 'Actie',
'title-page' => 'File Manager',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Bestand uploaden',
'title-view' => 'Bestand bekijken',
'title-root' => 'Bestanden',
'title-shares' => 'Openbare map',
'title-item' => 'Item',
'title-size' => 'Grootte',
'title-type' => 'Type',
'title-modified' => 'Gewijzigd',
'title-action' => 'Actie',
'type-folder' => 'Map',
'type-folder' => 'Map',
'message-empty' => 'De map is leeg.',
'message-choose' => 'Kies bestand',
'message-delete' => 'Weet u zeker dat u dit bestand wilt verwijderen?',
'message-name' => 'Mapnaam:',
'message-rename' => 'Hernoemen naar:',
'message-extension_not_found' => 'Please install gd or imagick extension to crop, resize, and make thumbnails of images.',
'message-empty' => 'De map is leeg.',
'message-choose' => 'Kies bestand',
'message-delete' => 'Weet u zeker dat u dit bestand wilt verwijderen?',
'message-name' => 'Mapnaam:',
'message-rename' => 'Hernoemen naar:',
'message-extension_not_found' => 'Installeer de GD of Imagick extensie om afbeeldingen te kunnen bewerken.',
'error-rename' => 'Bestandsnaam is al in gebruik!',
'error-file-empty' => 'U dient een bestand te kiezen!',
'error-file-exist' => 'Een bestand met deze naam bestaat al!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'U kunt deze map niet verwijderen omdat deze nog bestanden bevat!',
'error-folder-name' => 'Mapnaam mag niet leeg zijn!',
'error-folder-exist'=> 'Een map met deze naam bestaat al!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',
'error-mime' => 'Onverwacht MimeType: ',
'error-instance' => 'Het geuploade bestand moet een instantie zijn van UploadedFile',
'error-invalid' => 'Ongeldig upload verzoek',
'error-other' => 'Er heeft een fout opgetreden: ',
'error-too-large' => 'De verzoek entiteit is te groot!',
'error-rename' => 'Bestandsnaam is al in gebruik!',
'error-file-empty' => 'U dient een bestand te kiezen!',
'error-file-exist' => 'Een bestand met deze naam bestaat al!',
'error-file-size' => 'Bestandsgrootte overschrijdt de server limiet! (maximale grootte: :max)',
'error-delete-folder' => 'U kunt deze map niet verwijderen omdat deze nog bestanden bevat!',
'error-folder-name' => 'Mapnaam mag niet leeg zijn!',
'error-folder-exist' => 'Een map met deze naam bestaat al!',
'error-folder-alnum' => 'Alleen alfanumerieke map namen zijn toegestaan!',
'error-mime' => 'Onverwacht MimeType: ',
'error-instance' => 'Het geuploade bestand moet een instantie zijn van UploadedFile',
'error-invalid' => 'Ongeldig upload verzoek',
'error-other' => 'Er is een fout opgetreden: ',
'error-size' => 'U heeft de maximale bestandsgrootte overschreden:',
'error-too-large' => 'De verzoek entiteit is te groot!',
'btn-upload' => 'Bestand uploaden',
'btn-uploading' => 'Uploaden...',
'btn-close' => 'Sluiten',
'btn-crop' => 'Bijsnijden',
'btn-cancel' => 'Annuleren',
'btn-resize' => 'Formaat aanpassen',
'btn-upload' => 'Bestand uploaden',
'btn-uploading' => 'Uploaden...',
'btn-close' => 'Sluiten',
'btn-crop' => 'Bijsnijden',
'btn-copy-crop' => 'Kopiëren & Bijsnijden',
'btn-cancel' => 'Annuleren',
'btn-resize' => 'Formaat aanpassen',
'resize-ratio' => 'Ratio:',
'resize-scaled' => 'Afbeelding geschaald:',
'resize-true' => 'Ja',
'resize-old-height' => 'Originele Hoogte:',
'resize-old-width' => 'Originele Breedte:',
'resize-new-height' => 'Hoogte:',
'resize-new-width' => 'Breedte:',
'resize-ratio' => 'Ratio:',
'resize-scaled' => 'Afbeelding geschaald:',
'resize-true' => 'Ja',
'resize-old-height' => 'Originele hoogte:',
'resize-old-width' => 'Originele breedte:',
'resize-new-height' => 'Hoogte:',
'resize-new-width' => 'Breedte:',
'locale-bootbox' => 'nl',
'locale-bootbox' => 'nl',
];

View File

@@ -0,0 +1,68 @@
<?php
return [
'nav-back' => 'Powrót',
'nav-new' => 'Nowy Folder',
'nav-upload' => 'Wgraj plik',
'nav-thumbnails' => 'Miniaturki',
'nav-list' => 'Lista',
'menu-rename' => 'Zmień nazwę',
'menu-delete' => 'Usuń',
'menu-view' => 'Wyświetl',
'menu-download' => 'Pobierz',
'menu-resize' => 'Zmień rozmiar',
'menu-crop' => 'Przytnij',
'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-item' => 'Nazwa',
'title-size' => 'Rozmiar',
'title-type' => 'Typ',
'title-modified' => 'Utworzono',
'title-action' => 'Akcje',
'type-folder' => 'Folder',
'message-empty' => 'Przepraszamy, ten folder jest pusty.',
'message-choose' => 'Wybierz plik',
'message-delete' => 'Czy na pewno chcesz usunąć ten plik?',
'message-name' => 'Nazwa folderu:',
'message-rename' => 'Zmień nazwę:',
'message-extension_not_found' => 'Niestety, nie znaleziono wymaganych rozszerzeń. Zainstaluj gd lub imagick aby manipulować grafiką',
'error-rename' => 'Niestety, istnieje już plik o takiej nazwie!',
'error-file-empty' => 'You must choose a file!',
'error-file-exist' => 'Niestety, istnieje już plik o takiej nazwie!',
'error-file-size' => 'Przekroczono maksymalny rozmiar wgrywanych plików! (maximum size: :max)',
'error-delete-folder'=> 'Nie możesz usunąć tego folderu, ponieważ nie jest pusty!',
'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-mime' => 'Nierozpoznawany MimeType: ',
'error-instance' => 'Wgrywany obiekt powinien być instanją UploadedFile',
'error-invalid' => 'Nieprawidłowe zapytanie',
'error-other' => 'Napotkano następujący błąd: ',
'error-too-large' => 'Przekroczono dozwolony czas operacji!',
'btn-upload' => 'Wgraj plik',
'btn-uploading' => 'Wgrywanie...',
'btn-close' => 'Zamknij',
'btn-crop' => 'Przytnij',
'btn-cancel' => 'Anuluj',
'btn-resize' => 'Zmień rozmiar',
'resize-ratio' => 'Stosunek:',
'resize-scaled' => 'Zmieniono rozmiar:',
'resize-true' => 'tak',
'resize-old-height' => 'Orginalna wysokość:',
'resize-old-width' => 'Orginalna szerokość:',
'resize-new-height' => 'Wysokość:',
'resize-new-width' => 'Szerokość:',
'locale-bootbox' => 'pl',
];

View File

@@ -1,7 +1,7 @@
<?php
return [
'nav-back' => 'Back',
'nav-back' => 'Voltar',
'nav-new' => 'Nova Pasta',
'nav-upload' => 'Enviar',
'nav-thumbnails' => 'Miniatura',
@@ -33,17 +33,17 @@ return [
'message-delete' => 'Você está certo que quer deletar 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-file-empty' => 'Você deve escolher um arquivo!',
'error-file-exist' => 'Um arquivo com este nome já existe!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'Você não pode deletar esta pasta, pois ela não está vazia!',
'error-file-size' => 'Tamanho do arquivo excedeu o limite permitido pelo servidor! (Tamanho máximo: :max)',
'error-delete-folder'=> 'Você não pode deletar esta pasta, pois ela 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-folder-alnum'=> 'Only alphanumeric folder names are allowed!',
'error-mime' => 'Unexpected MimeType: ',
'error-folder-alnum'=> 'Permitido somente caracteres alfanuméricos para nomes de pastas!',
'error-mime' => 'MimeType inesperado: ',
'error-instance' => 'The uploaded file should be an instance of UploadedFile',
'error-invalid' => 'Invalid upload request',

View File

@@ -0,0 +1,66 @@
<?php
return [
'nav-back' => 'Voltar',
'nav-new' => 'Nova Pasta',
'nav-upload' => 'Upload',
'nav-thumbnails' => 'Miniatura',
'nav-list' => 'Lista',
'menu-rename' => 'Renomear',
'menu-delete' => 'Apagar',
'menu-view' => 'Ver',
'menu-download' => 'Download',
'menu-resize' => 'Redimensionar',
'menu-crop' => 'Cortar',
'title-page' => 'Gestor de Arquivos',
'title-panel' => 'Gestor de Arquivos',
'title-upload' => 'Envio de Arquivo',
'title-view' => 'Ver Arquivo',
'title-root' => 'Arquivos',
'title-shares' => 'Arquivos Partilhados',
'title-item' => 'Item',
'title-size' => 'Tamanho',
'title-type' => 'Tipo',
'title-modified' => 'Modificado',
'title-action' => 'Ação',
'type-folder' => 'Pasta',
'message-empty' => 'A pasta está vazia.',
'message-choose' => 'Escolha um arquivo',
'message-delete' => 'Tem a certeza que quer pagar este arquivo?',
'message-name' => 'Nome da pasta:',
'message-rename' => 'Renomear para:',
'message-extension_not_found' => '(translation wanted)',
'error-rename' => 'Nome de arquivo já está em uso!',
'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-folder-alnum'=> 'Apenas valores alfanuméricos são permitidos para o nome da pasta!',
'error-mime' => 'Tipo de ficheiro não suportado: ',
'error-instance' => 'O ficheiro carregado deve ser uma instância de UploadedFile',
'error-invalid' => 'Pedido de upload inválido',
'btn-upload' => 'Enviar Arquivo',
'btn-uploading' => 'A enviar...',
'btn-close' => 'Fechar',
'btn-crop' => 'Cortar',
'btn-cancel' => 'Cancelar',
'btn-resize' => 'Redimensionar',
'resize-ratio' => 'Proporção:',
'resize-scaled' => 'Imagem dimensionada:',
'resize-true' => 'Sim',
'resize-old-height' => 'Altura Original:',
'resize-old-width' => 'Largura Original:',
'resize-new-height' => 'Altura:',
'resize-new-width' => 'Largura:',
'locale-bootbox' => 'pt',
];

View File

@@ -0,0 +1,71 @@
<?php
return [
'nav-back' => 'Înapoi',
'nav-new' => 'Folder Nou',
'nav-upload' => 'Încarcă',
'nav-thumbnails' => 'Miniatură',
'nav-list' => 'Listă',
'menu-rename' => 'Redenumește',
'menu-delete' => 'Șterge',
'menu-view' => 'Previzualizează',
'menu-download' => 'Descarcă',
'menu-resize' => 'Redimensionează',
'menu-crop' => 'Taie',
'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-item' => 'Element',
'title-size' => 'Dimensiune',
'title-type' => 'Tip',
'title-modified' => 'Modificat',
'title-action' => 'Acțiune',
'type-folder' => 'Folder',
'message-empty' => 'Folderul este gol.',
'message-choose' => 'Alege fișier(e)',
'message-delete' => 'Ești sigur că vrei să ștergi acest element?',
'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.',
'error-rename' => 'Nume fișier este deja folosit!',
'error-file-name' => 'Numele fișierului nu poate fi gol!',
'error-file-empty' => 'Trebuie să alegi un fișier!',
'error-file-exist' => 'Există deja un fișier cu acest nume!',
'error-file-size' => 'Dimeniunea fișierului depășeste limita maximă a serverului! (limită maximă: :max)',
'error-delete-folder'=> 'Nu poți șterge acest folder pentru că nu este gol!',
'error-folder-name' => 'Numele folderului nu poate fi gol!',
'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-size' => 'Dimensiune peste limită:',
'error-instance' => 'Fișierul încărcat trebuie să fie o instanță a UploadedFile',
'error-invalid' => 'Cerere invalidă de upload',
'error-other' => 'A apărut o eroare: ',
'error-too-large' => 'Entitate request prea mare!',
'btn-upload' => 'Încarcă fișier(e)',
'btn-uploading' => 'Încarcare...',
'btn-close' => 'Închide',
'btn-crop' => 'Taie',
'btn-cancel' => 'Anulează',
'btn-resize' => 'Redimensionează',
'resize-ratio' => 'Rație:',
'resize-scaled' => 'Imagine scalată:',
'resize-true' => 'Da',
'resize-old-height' => 'Înălțime originală:',
'resize-old-width' => 'Lățime originală:',
'resize-new-height' => 'Înălțime:',
'resize-new-width' => 'Lățime:',
'locale-bootbox' => 'ro',
];

View File

@@ -37,11 +37,11 @@ return [
'error-rename' => 'Имя файла уже используется!',
'error-file-empty' => 'Вы должны выбрать файл!',
'error-file-exist' => 'Файл с этим именем уже существует!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'Вы не можете удалить эту папку, потому что она не пустая!',
'error-file-size' => 'Размер файла превышает разрешенный сервером размер! (максимальный размер: :max)',
'error-delete-folder'=> 'Вы не можете удалить эту папку, потому что она не пустая!',
'error-folder-name' => 'Имя папки не может быть пустым!',
'error-folder-exist'=> 'Папка с таким названием уже существует!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',
'error-folder-alnum'=> 'Название папки должно содержать только цифры и латинские буквы!',
'error-mime' => 'Неподдерживаемый MimeType: ',
'error-instance' => 'Загруженный файл должен быть экземпляром UploadedFile',
'error-invalid' => 'Неверный запрос загрузки',

View File

@@ -1,11 +1,14 @@
<?php
return [
'nav-back' => 'Back',
'nav-back' => 'Geri',
'nav-new' => 'Yeni Klasör',
'nav-upload' => 'Yükle',
'nav-thumbnails' => 'Küçük Resim',
'nav-list' => 'Liste',
'nav-sort' => 'Sırala',
'nav-sort-alphabetic'=> 'A-Z Sırala',
'nav-sort-time' => 'Zamana Göre Sırala',
'menu-rename' => 'Ad değiştir',
'menu-delete' => 'Sil',
@@ -33,29 +36,35 @@ return [
'message-delete' => 'Bu dosyayı silmek istediğinizden emin misiniz?',
'message-name' => 'Klasör adı:',
'message-rename' => 'Yeni ad:',
'message-extension_not_found' => '(translation wanted)',
'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',
'error-rename' => 'Dosya adı kullanımda!',
'error-file-name' => 'Dosya adı boş bırakılamaz!',
'error-file-empty' => 'Bir dosya seçmelisiniz!',
'error-file-exist' => 'Bu adda bir dosya zaten var!',
'error-file-size' => 'File size exceeds server limit! (maximum size: :max)',
'error-delete' => 'Klasör boş olmadığından, klasörü silemezsiniz!',
'error-file-size' => 'Dosya boyutu sunucu limitini aşıyor! (maximum boyut: :max)',
'error-delete-folder'=> 'Klasör boş olmadığından, klasörü silemezsiniz!',
'error-folder-name' => 'Klasör adı yazılmalıdır!',
'error-folder-exist'=> 'Bu adda bir klasör zaten var!',
'error-folder-alnum'=> 'Only alphanumeric folder names are allowed!',
'error-mime' => 'Unexpected MimeType: ',
'error-instance' => 'The uploaded file should be an instance of UploadedFile',
'error-invalid' => 'Invalid upload request',
'error-folder-alnum'=> 'Yalnızca alfasayısal klasör adlarına izin verilir!',
'error-folder-not-found'=> 'Klasör bulunamadı! (:folder)',
'error-mime' => 'Beklenmeyen Mime Türü: ',
'error-size' => 'Boyut sınırın üstünde:',
'error-instance' => 'Yüklenen dosya, UploadedFile örneğinde olmalıdır',
'error-invalid' => 'Geçersiz yükleme isteği',
'error-other' => 'Bir hata oluştu: ',
'error-too-large' => 'Girilen veri çok fazla!',
'btn-upload' => 'Yükle',
'btn-uploading' => 'Yükleniyor...',
'btn-close' => 'Kapat',
'btn-crop' => 'Kırp',
'btn-copy-crop' => 'Kopyala & Kes',
'btn-cancel' => 'İptal',
'btn-resize' => 'Boyutlandır',
'resize-ratio' => 'Oran:',
'resize-scaled' => 'Boyutlandırıldı mı:',
'resize-scaled' => 'Boyutlandırıldı:',
'resize-true' => 'Evet',
'resize-old-height' => 'Orijinal Yükseklik:',
'resize-old-width' => 'Orijinal Genişlik:',

View File

@@ -0,0 +1,71 @@
<?php
return [
'nav-back' => 'Назад',
'nav-new' => 'Нова папка',
'nav-upload' => 'Завантажити',
'nav-thumbnails' => 'Мініатюри',
'nav-list' => 'Список',
'menu-rename' => 'Перейменувати',
'menu-delete' => 'Вилучити',
'menu-view' => 'Перегляд',
'menu-download' => 'Завантажити',
'menu-resize' => 'Змінити розмір',
'menu-crop' => 'Обрізати',
'title-page' => 'Менеджер файлів',
'title-panel' => 'Laravel FileManager',
'title-upload' => 'Завантаження файлу',
'title-view' => 'Перегляд файлу',
'title-root' => 'Файли',
'title-shares' => 'Спільні файли',
'title-item' => 'Номер',
'title-size' => 'Розмір',
'title-type' => 'Тип',
'title-modified' => 'Змінений',
'title-action' => 'Дія',
'type-folder' => 'Папка',
'message-empty' => 'Папка порожня.',
'message-choose' => 'Виберіть файл(-и)',
'message-delete' => 'Ви впевнені, що хочете вилучити цей елемент?',
'message-name' => 'Назва папки:',
'message-rename' => 'Перейменувати в:',
'message-extension_not_found' => 'Інсталюйте, будь ласка, розширення GD чи ImageMagick щоб мати можливість кадрувати, змінювати розміри чи створювати ескізи зображень.',
'error-rename' => 'Ім\'я файлу вже використовується!',
'error-file-name' => 'Ім\'я файлу не може бути порожнім!',
'error-file-empty' => 'Ви повинні вибрати файл!',
'error-file-exist' => 'Файл з таким ім\'ям вже існує!',
'error-file-size' => 'Розмір файлу перевищує обмеження сервера! (максимальний розмір: :max)',
'error-delete-folder'=> 'Ви не можете вилучити цю папку, оскільки вона не порожня!',
'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-cancel' => 'Скасувати',
'btn-resize' => 'Змінити розмір',
'resize-ratio' => 'Співвідношення:',
'resize-scaled' => 'Масштабоване зображення:',
'resize-true' => 'Так',
'resize-old-height' => 'Оригінальна висота:',
'resize-old-width' => 'Оригінальна ширина:',
'resize-new-height' => 'Висота:',
'resize-new-width' => 'Ширина:',
'locale-bootbox' => 'uk',
];

View File

@@ -0,0 +1,75 @@
<?php
return [
'nav-back' => 'Quay lại',
'nav-new' => 'Tạo thư mục mới',
'nav-upload' => 'Tải lên',
'nav-thumbnails' => 'Ảnh đại diện',
'nav-list' => 'Danh sách',
'nav-sort' => 'Sắp xếp',
'nav-sort-alphabetic'=> 'Sắp xếp theo thứ tự Alphabet',
'nav-sort-time' => 'Sắp xếp theo thời gian',
'menu-rename' => 'Đổi tên',
'menu-delete' => 'Xoá',
'menu-view' => 'Xem trước',
'menu-download' => 'Tải xuống',
'menu-resize' => 'Thay đổi kích thước',
'menu-crop' => 'Cắt hình',
'title-page' => 'Trình 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-item' => 'Mục',
'title-size' => 'Kích thước',
'title-type' => 'Loại',
'title-modified' => 'Đã chỉnh sửa',
'title-action' => 'Hành động',
'type-folder' => 'Thư mục',
'message-empty' => 'Thư mục trống.',
'message-choose' => 'Chọn tập tin',
'message-delete' => 'Bạn có chắc chắn muốn xoá 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.',
'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 tập tin đạt tối đa! (kích thước tối đa: :max)',
'error-delete-folder'=> 'Bạn không thể xoá 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-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' => 'Tập tin được tải lên phải là một kiểu UploadedFile',
'error-invalid' => 'Yêu cầu tải lên không hợp lệ',
'error-other' => 'Có lỗi xảy ra: ',
'error-too-large' => 'Kích thước yêu cầu quá lơn!',
'btn-upload' => 'Tải 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-resize' => 'Thay đổi kích thước',
'resize-ratio' => 'Tỷ lệ:',
'resize-scaled' => 'Hình ảnh thu nhỏ:',
'resize-true' => 'Đồng ý',
'resize-old-height' => 'Chiều cao ban đầu:',
'resize-old-width' => 'Chiều rộng ban đầu:',
'resize-new-height' => 'Chiều cao:',
'resize-new-width' => 'Chiều rộng:',
'locale-bootbox' => 'vi',
];

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' => '删除',
@@ -36,21 +39,27 @@ return [
'message-extension_not_found' => '请安装 gd 或 imagick 以使用缩放、裁剪、及缩图功能',
'error-rename' => '名称重复,请重新输入!',
'error-file-name' => '文件名不能为空!',
'error-file-empty' => '请选择档案!',
'error-file-exist' => '相同档名的档案已存在!',
'error-file-size' => '档案过大,无法上传! (档案大小上限: :max)',
'error-delete' => '文件夹未清空,无法删除!',
'error-delete-folder'=> '文件夹未清空,无法删除!',
'error-folder-name' => '请输入文件夹名称!',
'error-folder-exist'=> '相同名称的文件夹已存在!',
'error-folder-alnum'=> '文件夹名称只能包含英数字',
'error-folder-not-found'=> '找不到文件夹 :folder',
'error-mime' => 'Mime 格式错误 : ',
'error-size' => '大小超出限制:',
'error-instance' => '上传档案的 instance 应为 UploadedFile',
'error-invalid' => '验证失败,上传未成功',
'error-other' => '发生错误: ',
'error-too-large' => '请求内容太大!',
'btn-upload' => '上传',
'btn-uploading' => '上传中...',
'btn-close' => '关闭',
'btn-crop' => '裁剪',
'btn-copy-crop' => '复制并裁剪',
'btn-cancel' => '取消',
'btn-resize' => '缩放',

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' => '刪除',
@@ -36,16 +39,20 @@ return [
'message-extension_not_found' => '請安裝 gd 或 imagick 以使用縮放、裁剪、及縮圖功能',
'error-rename' => '名稱重複,請重新輸入!',
'error-file-name' => '請輸入檔案名稱!',
'error-file-empty' => '請選擇檔案!',
'error-file-exist' => '相同檔名的檔案已存在!',
'error-file-size' => '檔案過大,無法上傳! (檔案大小上限: :max)',
'error-delete' => '資料夾未清空,無法刪除!',
'error-delete-folder'=> '資料夾未清空,無法刪除!',
'error-folder-name' => '請輸入資料夾名稱!',
'error-folder-exist'=> '相同名稱的資料夾已存在!',
'error-folder-alnum'=> '資料夾名稱只能包含英數字!',
'error-folder-not-found'=> '找不到資料夾: :folder',
'error-mime' => 'Mime 格式錯誤 : ',
'error-instance' => '上傳檔案的 instance 應為 UploadedFile',
'error-invalid' => '驗證失敗,上傳未成功',
'error-other' => '發生錯誤: ',
'error-too-large' => '請求內容太大!',
'btn-upload' => '上傳',
'btn-uploading' => '上傳中...',

View File

@@ -1,41 +0,0 @@
<?php
namespace Unisharp\Laravelfilemanager\middleware;
use Closure;
class MultiUser
{
public function handle($request, Closure $next)
{
if (\Config::get('lfm.allow_multi_user') === true) {
$slug = \Config::get('lfm.user_field');
\Auth::user()->user_field = \Auth::user()->$slug;
$new_working_dir = '/' . \Auth::user()->user_field;
$previous_dir = $request->input('working_dir');
if ($previous_dir == null) {
$request->merge(['working_dir' => $new_working_dir]);
} elseif (! $this->validDir($previous_dir)) {
$request->replace(['working_dir' => $new_working_dir]);
}
}
return $next($request);
}
private function validDir($previous_dir)
{
if (starts_with($previous_dir, '/' . \Config::get('lfm.shared_folder_name'))) {
return true;
}
if (starts_with($previous_dir, '/' . (string)\Auth::user()->user_field)) {
return true;
}
return false;
}
}

View File

@@ -1,8 +1,12 @@
<?php
$middleware = array_merge(\Config::get('lfm.middlewares'), ['\Unisharp\Laravelfilemanager\middleware\MultiUser']);
$prefix = \Config::get('lfm.prefix', 'laravel-filemanager');
$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';
$namespace = '\UniSharp\LaravelFilemanager\Controllers';
// make sure authenticated
Route::group(compact('middleware', 'prefix', 'as', 'namespace'), function () {
@@ -10,74 +14,92 @@ Route::group(compact('middleware', 'prefix', 'as', 'namespace'), function () {
// Show LFM
Route::get('/', [
'uses' => 'LfmController@show',
'as' => 'show'
'as' => 'show',
]);
// Show integration error messages
Route::get('/errors', [
'uses' => 'LfmController@getErrors',
'as' => 'getErrors',
]);
// upload
Route::any('/upload', [
'uses' => 'UploadController@upload',
'as' => 'upload'
'as' => 'upload',
]);
// list images & files
Route::get('/jsonitems', [
'uses' => 'ItemsController@getItems',
'as' => 'getItems'
'as' => 'getItems',
]);
// folders
Route::get('/newfolder', [
'uses' => 'FolderController@getAddfolder',
'as' => 'getAddfolder'
'as' => 'getAddfolder',
]);
Route::get('/deletefolder', [
'uses' => 'FolderController@getDeletefolder',
'as' => 'getDeletefolder'
'as' => 'getDeletefolder',
]);
Route::get('/folders', [
'uses' => 'FolderController@getFolders',
'as' => 'getFolders'
'as' => 'getFolders',
]);
// crop
Route::get('/crop', [
'uses' => 'CropController@getCrop',
'as' => 'getCrop'
'as' => 'getCrop',
]);
Route::get('/cropimage', [
'uses' => 'CropController@getCropimage',
'as' => 'getCropimage'
'as' => 'getCropimage',
]);
Route::get('/cropnewimage', [
'uses' => 'CropController@getNewCropimage',
'as' => 'getCropimage',
]);
// rename
Route::get('/rename', [
'uses' => 'RenameController@getRename',
'as' => 'getRename'
'as' => 'getRename',
]);
// scale/resize
Route::get('/resize', [
'uses' => 'ResizeController@getResize',
'as' => 'getResize'
'as' => 'getResize',
]);
Route::get('/doresize', [
'uses' => 'ResizeController@performResize',
'as' => 'performResize'
'as' => 'performResize',
]);
// download
Route::get('/download', [
'uses' => 'DownloadController@getDownload',
'as' => 'getDownload'
'as' => 'getDownload',
]);
// delete
Route::get('/delete', [
'uses' => 'DeleteController@getDelete',
'as' => 'getDelete'
'as' => 'getDelete',
]);
Route::get('/demo', function () {
return view('laravel-filemanager::demo');
});
// 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,18 +1,40 @@
<div class="row fill">
<div class="col-md-8 fill">
<div class="row">
<div class="col-md-8">
<div class="crop-container">
<img src="{{ asset($img) }}" class="img img-responsive">
<img src="{{ $img->url . '?timestamp=' . $img->updated }}" class="img img-responsive">
</div>
</div>
<div class="col-md-4 fill">
<div class="col-md-4">
<div class="text-center">
<div class="img-preview center-block"></div>
<br>
<button class="btn btn-primary" onclick="performCrop()">{{ Lang::get('laravel-filemanager::lfm.btn-crop') }}</button>
<button class="btn btn-info" onclick="loadItems()">{{ Lang::get('laravel-filemanager::lfm.btn-cancel') }}</button>
<form action="{{ route('unisharp.lfm.getCrop') }}" role='form' name='cropForm' id='cropForm' mathod='post'>
<input type="hidden" id="img" name="img" value="{{ $img }}">
<div class="btn-group clearfix">
<label class="btn btn-primary btn-aspectRatio active" onclick="changeAspectRatio(this, 16 / 9)">
16:9
</label>
<label class="btn btn-primary btn-aspectRatio" onclick="changeAspectRatio(this, 4 / 3)">
4:3
</label>
<label class="btn btn-primary btn-aspectRatio" onclick="changeAspectRatio(this, 1)">
1:1
</label>
<label class="btn btn-primary btn-aspectRatio" onclick="changeAspectRatio(this, 2 / 3)">
2:3
</label>
{{--<label class="btn btn-primary" onclick="changeAspectRatio(this, null)">
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>
<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 }}">
<input type="hidden" id="dataX" name="dataX">
<input type="hidden" id="dataY" name="dataY">
@@ -26,41 +48,59 @@
</div>
<script>
$(document).ready(function () {
var $dataX = $('#dataX'),
$dataY = $('#dataY'),
$dataHeight = $('#dataHeight'),
$dataWidth = $('#dataWidth');
$('.crop-container > img').cropper({
//aspectRatio: 16 / 9,
preview: ".img-preview",
strict: false,
crop: function (data) {
// Output the result data for cropping image.
$dataX.val(Math.round(data.x));
$dataY.val(Math.round(data.y));
$dataHeight.val(Math.round(data.height));
$dataWidth.val(Math.round(data.width));
}
var $image = null,
options = {};
$(document).ready(function () {
var $dataX = $('#dataX'),
$dataY = $('#dataY'),
$dataHeight = $('#dataHeight'),
$dataWidth = $('#dataWidth');
$image = $('.crop-container > img');
options = {
aspectRatio: 16 / 9,
preview: ".img-preview",
strict: false,
crop: function (data) {
// Output the result data for cropping image.
$dataX.val(Math.round(data.x));
$dataY.val(Math.round(data.y));
$dataHeight.val(Math.round(data.height));
$dataWidth.val(Math.round(data.width));
}
};
$image.cropper(options);
});
});
function performCrop() {
$.ajax({
type: "GET",
dataType: "text",
url: "{{ route('unisharp.lfm.getCropimage') }}",
data: {
img: '{{ $img }}',
function changeAspectRatio(_this, aspectRatio) {
options.aspectRatio = aspectRatio;
$('.btn-aspectRatio.active').removeClass('active');
$(_this).addClass('active');
$('.img-preview').removeAttr('style');
$image.cropper('destroy').cropper(options);
return false;
}
function performCrop() {
performLfmRequest('cropimage', {
img: $("#img").val(),
working_dir: $("#working_dir").val(),
dataX: $("#dataX").val(),
dataY: $("#dataY").val(),
dataHeight: $("#dataHeight").val(),
dataWidth: $("#dataWidth").val(),
type: $('#type').val()
},
cache: false
}).done(function (data) {
loadItems();
});
}
</script>
}).done(loadItems);
}
function performCropNew() {
performLfmRequest('cropnewimage', {
img: $("#img").val(),
working_dir: $("#working_dir").val(),
dataX: $("#dataX").val(),
dataY: $("#dataY").val(),
dataHeight: $("#dataHeight").val(),
dataWidth: $("#dataWidth").val(),
type: $('#type').val()
}).done(loadItems);
}
</script>

View File

@@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<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="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
@@ -20,8 +21,12 @@
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<h2>Independent usage</h2>
<div class="col-md-6">
<h2>Summernote</h2>
<textarea id="summernote-editor" name="content"></textarea>
</div>
<div class="col-md-6">
<h2>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">
@@ -31,24 +36,42 @@
<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 class="input-group">
<span class="input-group-btn">
<a id="lfm2" data-input="thumbnail2" data-preview="holder2" class="btn btn-primary">
<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>
</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>
</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>
var route_prefix = "{{ url(config('lfm.url_prefix', config('lfm.prefix'))) }}";
</script>
<!-- CKEditor init -->
<script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.11/ckeditor.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.11/adapters/jquery.js"></script>
<script>
$('textarea[name=ce]').ckeditor({
height: 100,
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
filebrowserImageBrowseUrl: route_prefix + '?type=Images',
filebrowserImageUploadUrl: route_prefix + '/upload?type=Images&_token={{csrf_token()}}',
filebrowserBrowseUrl: route_prefix + '?type=Files',
filebrowserUploadUrl: route_prefix + '/upload?type=Files&_token={{csrf_token()}}'
});
</script>
@@ -56,21 +79,18 @@
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
<script>
var editor_config = {
path_absolute : "/",
path_absolute : "",
selector: "textarea[name=tm]",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern"
"link image"
],
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
relative_urls: false,
height: 129,
file_browser_callback : function(field_name, url, type, win) {
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;
var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
var cmsURL = editor_config.path_absolute + route_prefix + '?field_name=' + field_name;
if (type == 'image') {
cmsURL = cmsURL + "&type=Images";
} else {
@@ -91,9 +111,59 @@
tinymce.init(editor_config);
</script>
<script src="/vendor/laravel-filemanager/js/lfm.js"></script>
<script>
$('#lfm').filemanager('image');
{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/js/lfm.js')) !!}
</script>
<script>
$('#lfm').filemanager('image', {prefix: route_prefix});
$('#lfm2').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();
});
</script>
<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;
};
// 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() {
lfm({type: 'image', prefix: '/laravel-filemanager'}, function(url, path) {
context.invoke('insertImage', url);
});
}
});
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
}
})
});
</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More