Skip to content

Commit

Permalink
Merge branch 'release/v2.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexusmai committed Mar 24, 2019
2 parents aaeec4e + d3e3084 commit 4ec5e23
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 2 deletions.
63 changes: 63 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,69 @@ Open configuration file - config/file-manager.php

**!!! Be sure to add your middleware to restrict access to the application !!!**

**Don't forget to configure your php and Nginx**

```
// PHP
upload_max_filesize,
post_max_size
// Nginx
client_max_body_size
```

## Disk settings example

- config/filesystems.php

```php
// Filesystem Disks
'disks' => [
// images folder in public path
'images' => [
'driver' => 'local',
'root' => public_path('images'),
'url' => env('APP_URL').'/images',
],

// public folder in storage/app/public
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage', // https://laravel.com/docs/5.7/filesystem#file-urls
'visibility' => 'public',
],

// ftp
'dd-wrt' => [
'driver' => 'ftp',
'host' => 'ftp.dd-wrt.com',
'username' => 'anonymous',
'passive' => true,
'timeout' => 30,
],
],
```

- config/file-manager.php

```php
// You need to enter the disks you want to use in the file manager
'diskList' => ['images', 'public'],
```

>If you want to change default disk at runtime, you can add search params to the URL:
```
// !!! The disk must be in diskList !!!
// one window
http://site-name.com/your-url?leftDisk=public
// two windows
http://site-name.com/your-url?leftDisk=public&rightDisk=images
```

## What's next

[ACL](./acl.md)
Expand Down
61 changes: 61 additions & 0 deletions docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,67 @@ function fmSetLink($url) {
}
```

### Multiple standalone buttons

```html
<!-- HTML -->
<div class="container">
<div class="form-row">
<div class="form-group col-md-6">
<label for="image_label">Image</label>
<div class="input-group">
<input type="text" id="image1" class="form-control" name="image"
aria-label="Image" aria-describedby="button-image">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" id="button-image">Select</button>
</div>
</div>
</div>
<div class="form-group col-md-6">
<label for="image_label">Image2</label>
<div class="input-group">
<input type="text" id="image2" class="form-control" name="image"
aria-label="Image" aria-describedby="button-image">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" id="button-image2">Select</button>
</div>
</div>
</div>
</div>
</div>

<!-- JS -->
<script>
document.addEventListener("DOMContentLoaded", function() {
document.getElementById('button-image').addEventListener('click', (event) => {
event.preventDefault();
inputId = 'image1';
window.open('/file-manager/fm-button', 'fm', 'width=1400,height=800');
});
// second button
document.getElementById('button-image2').addEventListener('click', (event) => {
event.preventDefault();
inputId = 'image2';
window.open('/file-manager/fm-button', 'fm', 'width=1400,height=800');
});
});
// input
let inputId = '';
// set file link
function fmSetLink($url) {
document.getElementById(inputId).value = $url;
}
</script>
```

### Modifications

To change standard views(with file manager), publish them.
Expand Down
4 changes: 2 additions & 2 deletions resources/assets/js/file-manager.js

Large diffs are not rendered by default.

0 comments on commit 4ec5e23

Please sign in to comment.