1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| <?php
| /**
| * User: Cristiano Magro
| * Date: 08/07/2019
| */
|
| class FilesFilter {
|
| private $filtro = array();
|
| public function toJson()
| {
| return json_encode($this->filtro);
| }
|
| public function addExt($extension = '')
| {
| if ($extension != ''){
| switch(strtolower($extension)) {
| case 'gif':
| $this->filtro[] = json_decode('{"title":"Image files", "extensions":"gif"}', true);
| break;
| case 'doc':
| $this->filtro[] = json_decode('{"title":"Documenti", "extensions":"doc"}', true);
| break;
| }
| }
| return $this;
| }
| }
|
|