goldsky / FileDownload-R

FileDownload snippet for MODX revolution
12 stars 7 forks source link

Empty folders #42

Closed jonas-veselka closed 8 years ago

jonas-veselka commented 9 years ago

Hi again, is there any option to allow loading listings for empty folders? At least wrapper template with path. Or is it a bug, when I get no data from FD after I navigate to empty subfolder? Thanks

goldsky commented 9 years ago

Actually, I didn't think about this. It seems awkward to have empty folder. I would rather to skip this empty folder completely from the list.

jonas-veselka commented 9 years ago

I'am using FileDownload snippet as a simple file manager on the page for logged users. I've implemented FileUpload snippet too, which I've placed in the template chunk FileWrapperTpl to be able to get path by parsing the placeholder fd.path. If the user creates new folder or deletes the last file, the whole file manager doesn't appear and he can't upload anything in that folder. I fixed this by removing if (empty($contents)) { return; } in the FileDownload snippet, line 728. That's why I asked. I know this isn't standard use, but it would be nice to have the option.