Skip to content

Commit

Permalink
edit doc
Browse files Browse the repository at this point in the history
  • Loading branch information
artgris committed Dec 6, 2017
1 parent 12ba123 commit a1400ab
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FileManager is a simple Multilingual File Manager Bundle for Symfony

**Features**
* Upload, delete (multiple), rename, download and sort files
* Create and delete folders
* Create, rename and delete folders
* Manage **Public** and **Private** folders
* **Multilingual** (English, French)
* **Fully responsive design** (bootstrap)
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/book/0-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Creating Your First File Manager
Create a folder **uploads** in **web**.
####Add following min configuration :
#### Add following minimal configuration :
```yaml
# app/config/config.yml
Expand Down
39 changes: 20 additions & 19 deletions Resources/doc/book/1-basic-configuration.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Chapter 1 - Basic Configuration
===============================

There are two methods to configure the bundle:
Two methods are available for setting up this bundle:

* Using basic configuration explain here
* Using basic configuration explained here
* [Using a service for a most advanced configuration](2-service-configuration.md)


### Under `conf` key you have all your different file manager configurations.
### Under the key `conf` you have all your different file manager configurations.

| Option | Type | Required |
| :--- |:--------:|:--------:|
Expand All @@ -17,16 +17,17 @@ Example:
```yml
artgris_file_manager:
conf:
public: ... # ex of conf for a public folder
private: ...
onlypdf: ...
public: ...
myprivatefolder: ...
onlypdf: ...
anystring: ...
...
```

### For each `conf` you have following options:


#### `dir` The directory path
## `dir` directory path

| Option | Type | Required |
| :--- |:--------:|:--------:|
| `dir` | `String` | True |
Expand All @@ -36,7 +37,7 @@ Example with a Public folder :
artgris_file_manager:
conf:
public:
dir: '../web/uploads' # equivalent to '%kernel.root_dir%/../web/uploads'
dir: '../web/uploads' # equivalent with '%kernel.root_dir%/../web/uploads'
```
>Browse the `/manager/?conf=public` URL to get access to this File Manager

Expand All @@ -51,7 +52,7 @@ artgris_file_manager:

>Browse the `/manager/?conf=private` URL to get access to this File Manager

#### `tree` Display Folder Tree
## `tree` Display Folder Tree
| Option | Type | Required | Default value |
| :--- |:--------:|:--------:|:--------:|
| `tree` | `Booleen` | False | True |
Expand All @@ -62,7 +63,7 @@ Example with `tree` = False



#### `view` Display Mode Type
## `view` Display Mode Type

| Option | Type | Required | Possible values | Default value |
| :--- |:--------:|:--------:|:------------------------:|:-------------:|
Expand All @@ -75,7 +76,7 @@ Example with `thumbnail`



#### `type` Basic file restriction
## `type` Basic file restriction

| Option | Type | Required | Possible values | Default value |
| :--- |:--------:|:--------:|:------------------------:|:-------------:|
Expand All @@ -101,7 +102,7 @@ artgris_file_manager:

>If `type` option is not sufficient for you, You can defined your own `regex` rules and `accept` [(HTML input accept attribute)](https://www.w3schools.com/tags/att_input_accept.asp):

#### `regex` and `accept` Advanced file restriction options
## `regex` and `accept` Advanced file restriction options


| Option | Type | Required | Default value |
Expand Down Expand Up @@ -134,7 +135,7 @@ artgris_file_manager:

>It is recommended to combine `regex` option with `accept` option for a better user experience

#### `upload` A non-exhaustive configuration of the File Upload widget [blueimp/jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload)
## `upload` A non-exhaustive configuration of the File Upload widget [blueimp/jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload)
> [Exhaustive options](https://github.com/blueimp/jQuery-File-Upload/blob/master/server/php/UploadHandler.php) can only be defined with [The service configuration](2-service-configuration.md)

| Option | Type | Required |
Expand All @@ -154,7 +155,7 @@ artgris_file_manager:
image_library: 1
...
```
### Under `upload` key you have following options:
### Under the key `upload` you have following options:


| Option | Type | Required | Default value | Description | Possible values |
Expand Down Expand Up @@ -185,7 +186,7 @@ if you need thumbmail, or another format for the original image you have followi
| `max_height` | `Interger` | False | null | Max height after resize/crop (px) |


Example if you want original image + thumbmail 80px/80px
Example with original image + thumbmail 80px x 80px

```yml
artgris_file_manager:
Expand All @@ -198,7 +199,7 @@ artgris_file_manager:

> this configuration create a thumbnail folder under current path with thumbnails

Example if you only an image with 100px/100px
Example with 100px x 100px image

```yml
artgris_file_manager:
Expand All @@ -209,7 +210,7 @@ artgris_file_manager:
image_versions: {'': {max_width: 100, max_height: 100}}
```

Complexe example with multiple image size:
Complexe example with multiple image sizes:

This example saved 4 images:

Expand All @@ -228,7 +229,7 @@ artgris_file_manager:
```


#### Full example:
#### Complete example:

```yml
artgris_file_manager:
Expand Down
15 changes: 7 additions & 8 deletions Resources/doc/book/2-service-configuration.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Chapter 2 - Service Configuration
=================================

If basic configuration is not sufficient for you and you need more control, using the service configuration below
If basic configuration is not enough for you and you need more control, then use the following service configuration:

you only need one option:

for this conf you just need one option:


#### `service` The service that will return configuration
## `service` The service that will return configuration
| Option | Type | Required |
| :--- |:--------:|:--------:|
| `service` | `String` | True |
Expand All @@ -22,7 +21,7 @@ artgris_file_manager:
```
This service need to implement CustomConfServiceInterface
This service need to implement `CustomConfServiceInterface`

```php
<?php
Expand Down Expand Up @@ -73,7 +72,7 @@ Example:
path('file_manager', {module:'tiny', type:'image', conf:'perso', extra: {'user':'miamolex', 'allow': true}})


Here i add 2 extra parameters, that i retrieve in my Service:
Here, I add 2 extra parameters, which I recover in my Service:

```php
public function getConf($extra = []) {
Expand All @@ -83,7 +82,7 @@ public function getConf($extra = []) {
...
```
With service configuration, you can for example defined a folder for each user login
With this `service` configuration, you can define (for example) a folder for each user

```php
<?php
Expand Down Expand Up @@ -139,7 +138,7 @@ custom_service:

## `upload` Exhaustive options (file upload widget)

in the return Array you can include all option of the file upload widget:
You can include all the options of `jQuery File Upload` in `return` (to make it easier than .yml):

[Exhaustive options](https://github.com/blueimp/jQuery-File-Upload/blob/master/server/php/UploadHandler.php)

Expand Down
21 changes: 12 additions & 9 deletions Resources/doc/book/3-access-file-manager.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
Chapter 3 - Access to the File Manager
======================================


After you have defined the configuration, browse the `/manager/?conf=public` URL and you'll get access to the
file manager defined
```yaml
# app/config/config.yml
artgris_file_manager:
conf:
public: # Access URL: /manager/?conf=public
dir: "../web/uploads"
...
myprivatefolder: ... # Access URL: /manager/?conf=myprivatefolder
onlypdf: ... # Access URL: /manager/?conf=onlypdf
anystring: ... # Access URL: /manager/?conf=anystring
```
Here is a list of URL parameters:
Expand All @@ -18,13 +26,8 @@ Here is a list of URL parameters:
| `order` | `String` | False | `asc`, `desc` | | Order by asc or desc |
| `extra` | `Array` | False | | `null` | extra parameters (used by service configuration)






Example:

path('file_manager', {module:'tiny', type:'image', conf:'perso', extra: {'user':'miamolex', 'allow': true}})

# /manager/?module=tiny&type=image&conf=perso&extra[user]=miamolex&extra[allow]=1
# Access URL: /manager/?module=tiny&type=image&conf=perso&extra[user]=miamolex&extra[allow]=1

0 comments on commit a1400ab

Please sign in to comment.