1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-05 15:32:56 +02:00

Fix template for NC14

This commit is contained in:
root 2018-10-07 00:02:54 +02:00
parent 3fe30c1200
commit d804bbf37d
3 changed files with 34 additions and 29 deletions

View file

@ -48,7 +48,9 @@ switch ($_['type']) {
case 'bookshelf': case 'bookshelf':
foreach ($_['bookshelf'] as $file) { foreach ($_['bookshelf'] as $file) {
print_unescaped($this->inc('part.feed.acquisition', [ 'file' => $file ])); foreach( $file as $key => $value )
$newfile["file_".$key] = $value;
print_unescaped($this->inc('part.feed.acquisition', $newfile ));
} }
break; break;
@ -60,10 +62,13 @@ switch ($_['type']) {
case 'directory': case 'directory':
default: default:
foreach ($_['files'] as $file) { foreach ($_['files'] as $file) {
foreach( $file as $key => $value )
$newfile["file_".$key] = $value;
if ($file['type'] == 'dir') { if ($file['type'] == 'dir') {
print_unescaped($this->inc('part.feed.navigation', [ 'file' => $file ])); print_unescaped($this->inc('part.feed.navigation', $newfile ));
} else { } else {
print_unescaped($this->inc('part.feed.acquisition', [ 'file' => $file ])); print_unescaped($this->inc('part.feed.acquisition', $newfile ));
} }
} }
break; break;

View file

@ -1,38 +1,38 @@
<entry> <entry>
<title><?php p($_['file']['meta']['title']); ?></title> <title><?php p($_['file_meta']['title']); ?></title>
<updated><?php p(date("Y-m-d\TH:i:sP",strtotime($_['file']['meta']['updated']))); ?></updated> <updated><?php p(date("Y-m-d\TH:i:sP",strtotime($_['file_meta']['updated']))); ?></updated>
<id>id:<?php p($_['file']['id']); ?></id> <id>id:<?php p($_['file_id']); ?></id>
<dcterms:extent><?php p($_['file']['humansize']); ?></dcterms:extent> <dcterms:extent><?php p($_['file_humansize']); ?></dcterms:extent>
<?php $authors = json_decode($_['file']['meta']['author'],true); if(is_array($authors)): foreach ($authors as $author): ?> <?php $authors = json_decode($_['file_meta']['author'],true); if(is_array($authors)): foreach ($authors as $author): ?>
<author> <author>
<name><?php p($author); ?></name> <name><?php p($author); ?></name>
</author> </author>
<?php endforeach; endif; ?> <?php endforeach; endif; ?>
<?php if($_['file']['meta']['isbn']): ?> <?php if($_['file_meta']['isbn']): ?>
<dc:identifier>urn:isbn:<?php p($_['file']['meta']['isbn']); ?></dc:identifier> <dc:identifier>urn:isbn:<?php p($_['file_meta']['isbn']); ?></dc:identifier>
<?php endif; ?> <?php endif; ?>
<?php if($_['file']['meta']['publisher']): ?> <?php if($_['file_meta']['publisher']): ?>
<dc:publisher><?php p($_['file']['meta']['publisher']); ?></dc:publisher> <dc:publisher><?php p($_['file_meta']['publisher']); ?></dc:publisher>
<?php endif; ?> <?php endif; ?>
<?php if($_['file']['meta']['language']): ?> <?php if($_['file_meta']['language']): ?>
<dc:language><?php p($_['file']['meta']['language']); ?></dc:language> <dc:language><?php p($_['file_meta']['language']); ?></dc:language>
<?php endif; ?> <?php endif; ?>
<dc:issued><?php p(date("Y-m-d\TH:i:sP",strtotime($_['file']['meta']['date']))); ?></dc:issued> <dc:issued><?php p(date("Y-m-d\TH:i:sP",strtotime($_['file_meta']['date']))); ?></dc:issued>
<link type="<?php p($_['file']['mimetype']); ?>" <link type="<?php p($_['file_mimetype']); ?>"
rel="alternate" rel="alternate"
href="?id=<?php p($_['file']['id']); ?>"/> href="?id=<?php p($_['file_id']); ?>"/>
<link type="<?php p($_['file']['mimetype']); ?>" <link type="<?php p($_['file_mimetype']); ?>"
rel="http://opds-spec.org/acquisition/open-access" rel="http://opds-spec.org/acquisition/open-access"
href="?id=<?php p($_['file']['id']); ?>"/> href="?id=<?php p($_['file_id']); ?>"/>
<link href="?pid=<?php p($_['file']['id']); ?>" <link href="?pid=<?php p($_['file_id']); ?>"
rel="http://opds-spec.org/image" rel="http://opds-spec.org/image"
type="image/jpeg" /> type="image/jpeg" />
<link href="?tid=<?php p($_['file']['id']); ?>" <link href="?tid=<?php p($_['file_id']); ?>"
rel="http://opds-spec.org/image/thumbnail" rel="http://opds-spec.org/image/thumbnail"
type="image/jpeg" /> type="image/jpeg" />
<?php if ($_['file']['meta']['description']): ?> <?php if ($_['file_meta']['description']): ?>
<content type="text"><?php p($_['file']['meta']['description']); p("\n\n"); ?><?php p(formatMetadata($_['file']['humansize'],$_['file']['mimetype'],$_['file']['name'])); ?></content> <content type="text"><?php p($_['file_meta']['description']); p("\n\n"); ?><?php p(formatMetadata($_['file_humansize'],$_['file_mimetype'],$_['file_name'])); ?></content>
<?php else: ?> <?php else: ?>
<summary type="text"><?php p(formatMetadata($_['file']['humansize'],$_['file']['mimetype'],$_['file']['name'])); ?></summary> <summary type="text"><?php p(formatMetadata($_['file_humansize'],$_['file_mimetype'],$_['file_name'])); ?></summary>
<?php endif; ?> <?php endif; ?>
</entry> </entry>

View file

@ -1,12 +1,12 @@
<entry> <entry>
<title><?php p($_['file']['name']); ?></title> <title><?php p($_['file_name']); ?></title>
<updated><?php p(date("Y-m-d\TH:i:sP", $_['file']['mtime'])); ?></updated> <updated><?php p(date("Y-m-d\TH:i:sP", $_['file_mtime'])); ?></updated>
<id>id:<?php p($_['file']['id']); ?></id> <id>id:<?php p($_['file_id']); ?></id>
<link type="application/atom+xml;profile=opds-catalog;kind=navigation" <link type="application/atom+xml;profile=opds-catalog;kind=navigation"
rel="alternate" rel="alternate"
href="?id=<?php p($_['file']['id']); ?>"/> href="?id=<?php p($_['file_id']); ?>"/>
<link type="application/atom+xml;profile=opds-catalog;kind=navigation" <link type="application/atom+xml;profile=opds-catalog;kind=navigation"
rel="subsection" rel="subsection"
href="?id=<?php p($_['file']['id']); ?>"/> href="?id=<?php p($_['file_id']); ?>"/>
<content type="text"></content> <content type="text"></content>
</entry> </entry>