1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-02 14:49:17 +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':
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;
@ -60,10 +62,13 @@ switch ($_['type']) {
case 'directory':
default:
foreach ($_['files'] as $file) {
foreach( $file as $key => $value )
$newfile["file_".$key] = $value;
if ($file['type'] == 'dir') {
print_unescaped($this->inc('part.feed.navigation', [ 'file' => $file ]));
print_unescaped($this->inc('part.feed.navigation', $newfile ));
} else {
print_unescaped($this->inc('part.feed.acquisition', [ 'file' => $file ]));
print_unescaped($this->inc('part.feed.acquisition', $newfile ));
}
}
break;

View file

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

View file

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