mirror of
https://github.com/Yetangitu/owncloud-apps.git
synced 2025-10-02 14:49:17 +02:00
Merge pull request #20 from ayamshanov/supportedExtensions_and_folders
Fixed: Folder in OPDS stay be visible when supportedExtensions is con…
This commit is contained in:
commit
d06ed3f898
1 changed files with 10 additions and 8 deletions
|
@ -48,12 +48,14 @@ class Files extends \OCA\Files\Helper
|
||||||
$fileTypes = array_filter(explode(',', strtolower(Config::get('file_types', ''))));
|
$fileTypes = array_filter(explode(',', strtolower(Config::get('file_types', ''))));
|
||||||
$skipList = array_filter(explode(',', strtolower(Config::get('skip_list', 'metadata.opf,cover.jpg'))));
|
$skipList = array_filter(explode(',', strtolower(Config::get('skip_list', 'metadata.opf,cover.jpg'))));
|
||||||
foreach ($fileInfos as $i) {
|
foreach ($fileInfos as $i) {
|
||||||
|
if (strcmp($i->getType(), 'dir') !== 0) {
|
||||||
if ((!empty($fileTypes)) && (!in_array(strtolower(substr(strrchr($i->getName(), "."), 1)), $fileTypes))) {
|
if ((!empty($fileTypes)) && (!in_array(strtolower(substr(strrchr($i->getName(), "."), 1)), $fileTypes))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((!empty($skipList)) && (in_array($i->getName(), $skipList))) {
|
if ((!empty($skipList)) && (in_array($i->getName(), $skipList))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$files[] = self::formatFileInfo($i);
|
$files[] = self::formatFileInfo($i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue