1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-02 14:49:17 +02:00

files_opds: yet another 9.0 compatibility fix, change $id-handling to explicitly handle command strings

This commit is contained in:
frankdelange 2016-04-04 22:06:49 +02:00
parent 980502c412
commit 6559dd5528
4 changed files with 34 additions and 15 deletions

View file

@ -41,20 +41,28 @@ echo '<?xml version="1.0" encoding="UTF-8"?>';
<?php
if ($_['id'] == 'root') {
print_unescaped($this->inc('part.feed.root'));
} elseif (($_['id'] == 'bookshelf')) {
foreach ($_['bookshelf'] as $file) {
print_unescaped($this->inc('part.feed.acquisition', [ 'file' => $file ]));
}
} else {
foreach ($_['files'] as $file) {
if ($file['type'] == 'dir') {
print_unescaped($this->inc('part.feed.navigation', [ 'file' => $file ]));
} else {
switch ($_['type']) {
case 'root':
print_unescaped($this->inc('part.feed.root'));
break;
case 'bookshelf':
foreach ($_['bookshelf'] as $file) {
print_unescaped($this->inc('part.feed.acquisition', [ 'file' => $file ]));
}
}
break;
/* intentional fall-through for 'directory' */
case 'directory':
default:
foreach ($_['files'] as $file) {
if ($file['type'] == 'dir') {
print_unescaped($this->inc('part.feed.navigation', [ 'file' => $file ]));
} else {
print_unescaped($this->inc('part.feed.acquisition', [ 'file' => $file ]));
}
}
break;
}
?>
</feed>