Refactor per usare la classe FiltroExt
| | |
| | | |
| | | 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; |
| | | if ($extension != '') { |
| | | $titolo = $this->decodeTitolo($extension); |
| | | if ($titolo != null) { |
| | | $filtro = new FilterExt($titolo, $extension); |
| | | $this->filtro[] = json_decode($filtro->getFilter()); |
| | | } |
| | | } |
| | | return $this; |
| | |
| | | [['fasullo'], '[]'], |
| | | [['gif'], '[{"title":"Image files","extensions":"gif"}]'], |
| | | [['doc'], '[{"title":"Documenti","extensions":"doc"}]'], |
| | | [['DOC'], '[{"title":"Documenti","extensions":"doc"}]'], |
| | | [['DOc', 'gif'],'[{"title":"Documenti","extensions":"doc"},{"title":"Image files","extensions":"gif"}]'], |
| | | [['DOC'], '[{"title":"Documenti","extensions":"DOC"}]'], |
| | | [['txt'], '[{"title":"Documenti","extensions":"txt"}]'], |
| | | [['DOc', 'gif'],'[{"title":"Documenti","extensions":"DOc"},{"title":"Image files","extensions":"gif"}]'], |
| | | ]; |
| | | } |
| | | |