mirror of
https://github.com/Yetangitu/owncloud-apps.git
synced 2025-10-02 14:49:17 +02:00
v0.4: title/subtitle configurable, templates split into parts, several fixes
This commit is contained in:
parent
62ef3b9d4d
commit
74f25cfe7c
17 changed files with 142 additions and 131 deletions
|
@ -24,9 +24,9 @@ The OPDS root feed links to a hierarchical navigation feed mirroring the directo
|
|||
|
||||
The feed is in compliance with the OPDS 1.1 specification according to the online OPDS validator (http://opds-validator.appspot.com/).
|
||||
|
||||
In the personal settings page there are options to enable/disable the feed (it is disabled by default), set the feed root directory (the default is /Library), enter a list of extensions to which the feed should be limited (by default this field is empty so it publishes all files descending from the feed root) and clear the personal bookshelf.
|
||||
In the personal settings page there are options to enable/disable the feed (it is disabled by default), set the feed title, set the feed root directory (the default is /Library), enter a list of extensions to which the feed should be limited (by default this field is empty so it publishes all files descending from the feed root) and clear the personal bookshelf.
|
||||
|
||||
The admin settings page contains options to change file preview preferences (which should probably be in core or in a separate app as this changes a system-wide setting ('enabledPreviewProviders')). Also on the admin settings page is an option to change the cover image and thumbnail dimensions.
|
||||
The admin settings page contains options to set the feed subtitle, change file preview preferences (which should probably be in core or in a separate app as this changes a system-wide setting ('enabledPreviewProviders')) and change the cover image and thumbnail dimensions.
|
||||
|
||||
The OPDS feed is disabled when the app is installed, enable it in the personal settings page under the header 'OPDS'. Every user has his/her own feed, which feed you get depends on which credentials you enter.
|
||||
|
||||
|
|
BIN
dist/files_opds-0.4.tar.gz
vendored
Normal file
BIN
dist/files_opds-0.4.tar.gz
vendored
Normal file
Binary file not shown.
|
@ -10,17 +10,21 @@
|
|||
|
||||
namespace OCA\Files_Opds;
|
||||
|
||||
$l = new \OC_L10N('files_opds');
|
||||
|
||||
\OCP\Util::addScript('files_opds', 'admin');
|
||||
\OCP\Util::addStyle('files_opds', 'settings');
|
||||
$defaults = new \OC_Defaults();
|
||||
|
||||
$formats = array(
|
||||
["epub" => Config::getPreview('OC\Preview\Epub') ? 1 : 0 ],
|
||||
["pdf" => Config::getPreview('OC\Preview\PDF') ? 1 : 0],
|
||||
["openoffice" => Config::getPreview('OC\Preview\OpenOffice') ? 1 : 0],
|
||||
["opendocument" => Config::getPreview('OC\Preview\OpenDocument') ? 1 : 0],
|
||||
["msoffice" => Config::getPreview('OC\Preview\MSOfficeDoc') ? 1 : 0]
|
||||
);
|
||||
|
||||
$tmpl = new \OCP\Template('files_opds', 'admin');
|
||||
$tmpl->assign('feedSubtitle', Config::getApp('feed-subtitle', $l->t("%s OPDS catalog", $defaults->getName())));
|
||||
$tmpl->assign('previewFormats', $formats);
|
||||
$tmpl->assign('cover-x', Config::getApp('cover-x', '200'));
|
||||
$tmpl->assign('cover-y', Config::getApp('cover-y', '200'));
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace OCA\Files_Opds;
|
|||
|
||||
\OCP\JSON::callCheck();
|
||||
\OCP\JSON::checkLoggedIn();
|
||||
$defaults = new \OC_Defaults();
|
||||
|
||||
$l = new \OC_L10N('files_opds');
|
||||
|
||||
|
@ -23,11 +24,13 @@ if (isset($_POST['opdsCoverX'])) {
|
|||
$opdsCoverY = isset($_POST['opdsCoverY']) ? (int) $_POST['opdsCoverY'] : 200;
|
||||
$opdsThumbX = isset($_POST['opdsThumbX']) ? (int) $_POST['opdsThumbX'] : 36;
|
||||
$opdsThumbY = isset($_POST['opdsThumbY']) ? (int) $_POST['opdsThumbY'] : 36;
|
||||
$opdsFeedSubtitle = isset($_POST['opdsFeedSubtitle']) ? $_POST['opdsFeedSubtitle'] : $l->t("%s OPDS catalog", $defaults->getName());
|
||||
|
||||
Config::setApp('cover-x', $opdsCoverX);
|
||||
Config::setApp('cover-y', $opdsCoverY);
|
||||
Config::setApp('thumb-x', $opdsThumbX);
|
||||
Config::setApp('thumb-y', $opdsThumbX);
|
||||
Config::setApp('feed_subtitle', $opdsFeedSubtitle);
|
||||
} else {
|
||||
// set preview preferences
|
||||
$opdsPreviewEpub = $_POST['opdsPreviewEpub'];
|
||||
|
|
|
@ -20,6 +20,7 @@ $l = new \OC_L10N('files_opds');
|
|||
$opdsEnable = isset($_POST['opdsEnable']) ? $_POST['opdsEnable'] : 'false';
|
||||
$rootPath = isset($_POST['rootPath']) ? $_POST['rootPath'] : null;
|
||||
$fileTypes = isset($_POST['fileTypes']) ? $_POST['fileTypes'] : '';
|
||||
$feedTitle = isset($_POST['feedTitle']) ? $_POST['feedTitle'] : $l->t("%s's Library", \OCP\User::getDisplayName());
|
||||
|
||||
if (!is_null($rootPath)){
|
||||
if (\OC\Files\Filesystem::file_exists($rootPath) === false ){
|
||||
|
@ -38,6 +39,7 @@ if (!is_null($rootPath)){
|
|||
}
|
||||
Config::set('enable', $opdsEnable);
|
||||
Config::set('file_types', $fileTypes);
|
||||
Config::set('feed_title', $feedTitle);
|
||||
Config::set('id', Util::genUuid());
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<name>OPDS catalog</name>
|
||||
<description>Personal OPDS catalog</description>
|
||||
<licence>AGPL</licence>
|
||||
<version>0.3.1</version>
|
||||
<version>0.4</version>
|
||||
<author>Frank de Lange</author>
|
||||
<requiremin>7.0</requiremin>
|
||||
<shipped>true</shipped>
|
||||
|
|
|
@ -4,19 +4,19 @@ $(document).ready(function(){
|
|||
save : function() {
|
||||
var epub = document.getElementById('opds-preview-epub').checked ? 'true' : 'false';
|
||||
var pdf = document.getElementById('opds-preview-pdf').checked ? 'true' : 'false';
|
||||
var openoffice = document.getElementById('opds-preview-openoffice').checked ? 'true' : 'false';
|
||||
var opendocument = document.getElementById('opds-preview-opendocument').checked ? 'true' : 'false';
|
||||
var msoffice = document.getElementById('opds-preview-msoffice').checked ? 'true' : 'false';
|
||||
var data = {
|
||||
opdsPreviewEpub : epub,
|
||||
opdsPreviewPdf : pdf,
|
||||
opdsPreviewOpenOffice : openoffice,
|
||||
opdsPreviewOpenDocument : opendocument,
|
||||
opdsPreviewMsOffice : msoffice
|
||||
};
|
||||
OC.msg.startSaving('#opds-admin .msg');
|
||||
$.post(OC.filePath('files_opds', 'ajax', 'admin.php'), data, opdsAdminSettings.afterSave);
|
||||
},
|
||||
afterSave : function(data){
|
||||
OC.msg.finishedSaving('#opds .msg', data);
|
||||
OC.msg.finishedSaving('#opds-admin .msg', data);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -26,23 +26,24 @@ $(document).ready(function(){
|
|||
opdsCoverX : $('#opds-cover-x').val(),
|
||||
opdsCoverY : $('#opds-cover-y').val(),
|
||||
opdsThumbX : $('#opds-thumb-x').val(),
|
||||
opdsThumbY : $('#opds-thumb-y').val()
|
||||
opdsThumbY : $('#opds-thumb-y').val(),
|
||||
opdsFeedSubtitle : $('#opds-feed-subtitle').val()
|
||||
};
|
||||
OC.msg.startSaving('#opds-admin .msg');
|
||||
$.post(OC.filePath('files_opds', 'ajax', 'admin.php'), data, opdsAdminCoverSettings.afterSave);
|
||||
},
|
||||
afterSave : function(data){
|
||||
OC.msg.finishedSaving('#opds .msg', data);
|
||||
OC.msg.finishedSaving('#opds-admin .msg', data);
|
||||
}
|
||||
};
|
||||
|
||||
$('#opds-preview-epub').on("change", opdsAdminSettings.save);
|
||||
$('#opds-preview-pdf').on("change", opdsAdminSettings.save);
|
||||
$('#opds-preview-openoffice').on("change", opdsAdminSettings.save);
|
||||
$('#opds-preview-opendocument').on("change", opdsAdminSettings.save);
|
||||
$('#opds-preview-msoffice').on("change", opdsAdminSettings.save);
|
||||
|
||||
$('#opds-cover-x,#opds-cover-y,#opds-thumb-x,#opds-thumb-y').blur(opdsAdminCoverSettings.save);
|
||||
$('#opds-cover-x,#opds-cover-y,#opds-thumb-x,#opds-thumb-y').keypress(function( event ) {
|
||||
$('#opds-cover-x,#opds-cover-y,#opds-thumb-x,#opds-thumb-y,#opds-feed-subtitle').blur(opdsAdminCoverSettings.save);
|
||||
$('#opds-cover-x,#opds-cover-y,#opds-thumb-x,#opds-thumb-y,#opds-feed-subtitle').keypress(function( event ) {
|
||||
if (event.which == 13) {
|
||||
event.preventDefault();
|
||||
opdsAdminCoverSettings.save();
|
||||
|
|
|
@ -24,7 +24,8 @@ $(document).ready(function(){
|
|||
var data = {
|
||||
opdsEnable : opdsEnable,
|
||||
rootPath : $('#opds-root-path').val(),
|
||||
fileTypes : $('#opds-file-types').val()
|
||||
fileTypes : $('#opds-file-types').val(),
|
||||
feedTitle : $('#opds-feed-title').val()
|
||||
};
|
||||
OC.msg.startSaving('#opds-personal .msg');
|
||||
$.post(OC.filePath('files_opds', 'ajax', 'personal.php'), data, opdsSettings.afterSave);
|
||||
|
@ -33,8 +34,8 @@ $(document).ready(function(){
|
|||
OC.msg.finishedSaving('#opds-personal .msg', data);
|
||||
}
|
||||
};
|
||||
$('#opds-root-path,#opds-file-types').blur(opdsSettings.save);
|
||||
$('#opds-root-path,#opds-file-types').keypress(function( event ) {
|
||||
$('#opds-root-path,#opds-file-types,#opds-feed-title').blur(opdsSettings.save);
|
||||
$('#opds-root-path,#opds-file-types,#opds-feed-title').keypress(function( event ) {
|
||||
if (event.which == 13) {
|
||||
event.preventDefault();
|
||||
opdsSettings.save();
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
namespace OCA\Files_Opds;
|
||||
|
||||
|
||||
/**
|
||||
* Feed class for OPDS
|
||||
*/
|
||||
|
@ -64,7 +65,9 @@ class Feed
|
|||
$tmpl->assign('id', $id);
|
||||
$tmpl->assign('dir', $dir);
|
||||
$tmpl->assign('user', \OCP\User::getDisplayName());
|
||||
$tmpl->assign('ocname', $defaults->getName());
|
||||
$tmpl->assign('feed_title', Config::get('feed_title',\OCP\User::getDisplayName() . "'s Library"));
|
||||
$tmpl->assign('feed_subtitle', Config::getApp('feed_subtitle', $defaults->getName() . " OPDS catalog"));
|
||||
$tmpl->assign('feed_updated', time());
|
||||
$tmpl->printPage();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class Files extends \OCA\Files\Helper
|
|||
$entry = array();
|
||||
|
||||
$entry['id'] = $i['fileid'];
|
||||
$entry['mtime'] = $i['mtime'] * 1000;
|
||||
$entry['mtime'] = $i['mtime'];
|
||||
$entry['name'] = $i->getName();
|
||||
$entry['type'] = $i['type'];
|
||||
if ($i['type'] === 'file') {
|
||||
|
|
|
@ -18,6 +18,7 @@ $tmpl->assign('opdsEnable-checked', ($opdsEnable === 'true') ? 'checked="checked
|
|||
$tmpl->assign('opdsEnable-value', ($opdsEnable === 'true') ? '1' : '0');
|
||||
$tmpl->assign('rootPath', Config::get('root_path', '/Library'));
|
||||
$tmpl->assign('fileTypes', Config::get('file_types', ''));
|
||||
$tmpl->assign('feedTitle', Config::get('feed_title', $l->t("%s's Library", \OCP\User::getDisplayName())));
|
||||
$tmpl->assign('bookshelf-count', Bookshelf::count());
|
||||
$tmpl->assign('feedUrl', \OC_Helper::linkToAbsolute('','index.php') . '/apps/files_opds/');
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
$l = new \OC_L10N('files_opds');
|
||||
|
||||
function checkBox($format) {
|
||||
foreach($format as $name => $enabled) {
|
||||
echo '<input type="checkbox" id="opds-preview-' . $name . '" name="opds-preview-' . $name . '" ' . ($enabled == 1 ? 'checked >' : '>');
|
||||
|
@ -19,9 +21,14 @@ function checkBox($format) {
|
|||
|
||||
?>
|
||||
|
||||
<div class="section" id="opds">
|
||||
<h2><?php p($l->t('OPDS')); ?></h2>
|
||||
<h3>Enable preview for:<span class="msg"></span></h3>
|
||||
<div class="section" id="opds-admin">
|
||||
<h2><?php p($l->t('OPDS')); ?><span class="msg"></span></h2>
|
||||
<div>
|
||||
<label for="opds-feed-subtitle"><?php p($l->t('Feed subtitle:')) ?></label>
|
||||
<input type="text" id="opds-feed-subtitle" title="<?php p($l->t("Enter subtitle for OPDS catalog.")); ?>" value="<?php p($_['feedSubtitle']) ?>" />
|
||||
</div>
|
||||
<br>
|
||||
<p><?php p($l->t('Enable preview for:')); ?></p>
|
||||
<div class="indent">
|
||||
<?php foreach ($_['previewFormats'] as $format): ?>
|
||||
<div>
|
||||
|
@ -31,14 +38,14 @@ function checkBox($format) {
|
|||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<p>Cover size</p>
|
||||
<p><?php p($l->t('Cover size')); ?></p>
|
||||
<label for="opds-cover-x"><?php p($l->t('width')) ?></label>
|
||||
<input type="text" id="opds-cover-x" title="<?php p($l->t("Enter cover image width in pixels")); ?>" value="<?php p($_['cover-x']) ?>" />
|
||||
<label for="opds-cover-y"><?php p($l->t('height')) ?></label>
|
||||
<input type="text" id="opds-cover-y" title="<?php p($l->t("Enter cover image height in pixels")); ?>" value="<?php p($_['cover-y']) ?>" />
|
||||
</div>
|
||||
<div>
|
||||
<p>Cover thumbnail size</p>
|
||||
<p><?php p($l->t('Cover thumbnail size')); ?></p>
|
||||
<label for="opds-thumb-x"><?php p($l->t('width')) ?></label>
|
||||
<input type="text" id="opds-thumb-x" title="<?php p($l->t("Enter thumbnail width in pixels")); ?>" value="<?php p($_['thumb-x']) ?>" />
|
||||
<label for="opds-thumb-y"><?php p($l->t('height')) ?></label>
|
||||
|
|
|
@ -25,8 +25,8 @@ echo '<?xml version="1.0" encoding="UTF-8"?>';
|
|||
xmlns:dcterms="http://purl.org/dc/terms/"
|
||||
xmlns:opds="http://opds-spec.org/2010/catalog">
|
||||
<id>id:<?php p($_['feed_id']); ?></id>
|
||||
<title><?php p($l->t("%s's library", array($_['user']))); ?></title>
|
||||
<subtitle><?php p($l->t("%s OPDS Catalog", array($_['ocname']))); ?></subtitle>
|
||||
<title><?php p($_['feed_title']); ?></title>
|
||||
<subtitle><?php p($_['feed_subtitle']); ?></subtitle>
|
||||
<updated><?php p(date("Y-m-d\TH:i:sP", $_['feed_updated'])); ?></updated>
|
||||
<author>
|
||||
<name><?php p($_['user']); ?></name>
|
||||
|
@ -38,103 +38,24 @@ echo '<?xml version="1.0" encoding="UTF-8"?>';
|
|||
<link rel="self"
|
||||
href="?id=<?php p($_['id']); ?>"
|
||||
type="application/atom+xml;profile=opds-catalog;kind=navigation"/>
|
||||
<?php if ($_['id'] == 'root'): ?>
|
||||
<entry>
|
||||
<title><?php p($l->t("Browse catalog")); ?></title>
|
||||
<updated><?php p(date("Y-m-d\TH:i:sP", $_['feed_updated'])); ?></updated>
|
||||
<content type="text"><?php p($l->t("Browse the catalog in alphabetical order")); ?></content>
|
||||
<link type="application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
href="?id=directory"/>
|
||||
<id>id:by_directory</id>
|
||||
</entry>
|
||||
<entry>
|
||||
<title><?php p($l->t("%s's bookshelf", array($_['user']))); ?></title>
|
||||
<updated><?php p(date("Y-m-d\TH:i:sP", $_['feed_updated'])); ?></updated>
|
||||
<content type="text"><?php p($l->t("This bookshelf contains %s books", array($_['bookshelf-count']))); ?></content>
|
||||
<link type="application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
href="?id=bookshelf"/>
|
||||
<id>id:by_bookshelf</id>
|
||||
</entry>
|
||||
<?php elseif ($_['id'] == 'bookshelf'): ?>
|
||||
|
||||
<?php foreach ($_['bookshelf'] as $file): ?>
|
||||
<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>
|
||||
<dc:language><?php p($file['meta']['language']); ?></dc:language>
|
||||
<?php foreach (json_decode($file['meta']['author'],true) as $author): ?>
|
||||
<author>
|
||||
<name><?php p($author); ?></name>
|
||||
</author>
|
||||
<dc:identifier>urn:isbn:<?php p($file['meta']['isbn']); ?></dc:identifier>
|
||||
<dc:publisher><?php p($file['meta']['publisher']); ?></dc:publisher>
|
||||
<dc:issued><?php p($file['meta']['date']); ?></dc:issued>
|
||||
<?php endforeach; ?>
|
||||
<link type="<?php p($file['mimetype']); ?>"
|
||||
rel="alternate"
|
||||
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']); ?>"
|
||||
rel="http://opds-spec.org/image"
|
||||
type="image/jpeg" />
|
||||
<link href="?tid=<?php p($file['id']); ?>"
|
||||
rel="http://opds-spec.org/image/thumbnail"
|
||||
type="image/jpeg" />
|
||||
<summary type="text"><?php p(formatMetadata($file['humansize'],$file['mimetype'],$file['name'])); ?></summary>
|
||||
<content type="text"><?php p("Size: " . $file['humansize'] . "\n\n"); ?><?php p($file['meta']['description']); ?></content>
|
||||
</entry>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<?php foreach ($_['files'] as $file): ?>
|
||||
<?php if ($file['type'] == 'dir'): ?>
|
||||
<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>
|
||||
<link type="application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
rel="alternate"
|
||||
href="?id=<?php p($file['id']); ?>"/>
|
||||
<link type="application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
rel="subsection"
|
||||
href="?id=<?php p($file['id']); ?>"/>
|
||||
<content type="text"></content>
|
||||
</entry>
|
||||
<?php else: ?>
|
||||
<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>
|
||||
<dc:language><?php p($file['meta']['language']); ?></dc:language>
|
||||
<?php foreach (json_decode($file['meta']['author'],true) as $author): ?>
|
||||
<author>
|
||||
<name><?php p($author); ?></name>
|
||||
</author>
|
||||
<dc:identifier>urn:isbn:<?php p($file['meta']['isbn']); ?></dc:identifier>
|
||||
<dc:publisher><?php p($file['meta']['publisher']); ?></dc:publisher>
|
||||
<dc:issued><?php p($file['meta']['date']); ?></dc:issued>
|
||||
<?php endforeach; ?>
|
||||
<link type="<?php p($file['mimetype']); ?>"
|
||||
rel="alternate"
|
||||
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']); ?>"
|
||||
rel="http://opds-spec.org/image"
|
||||
type="image/jpeg" />
|
||||
<link href="?tid=<?php p($file['id']); ?>"
|
||||
rel="http://opds-spec.org/image/thumbnail"
|
||||
type="image/jpeg" />
|
||||
<summary type="text"><?php p(formatMetadata($file['humansize'],$file['mimetype'],$file['name'])); ?></summary>
|
||||
<content type="text"><?php p("Size: " . $file['humansize'] . "\n\n"); ?><?php p($file['meta']['description']); ?></content>
|
||||
</entry>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?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 {
|
||||
print_unescaped($this->inc('part.feed.acquisition', [ 'file' => $file ]));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</feed>
|
||||
|
||||
|
|
32
files_opds/templates/part.feed.acquisition.php
Normal file
32
files_opds/templates/part.feed.acquisition.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<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>
|
||||
<dc:language><?php p($_['file']['meta']['language']); ?></dc:language>
|
||||
<?php foreach (json_decode($_['file']['meta']['author'],true) as $author): ?>
|
||||
<author>
|
||||
<name><?php p($author); ?></name>
|
||||
</author>
|
||||
<dc:identifier>urn:isbn:<?php p($_['file']['meta']['isbn']); ?></dc:identifier>
|
||||
<dc:publisher><?php p($_['file']['meta']['publisher']); ?></dc:publisher>
|
||||
<dc:issued><?php p($_['file']['meta']['date']); ?></dc:issued>
|
||||
<?php endforeach; ?>
|
||||
<link type="<?php p($_['file']['mimetype']); ?>"
|
||||
rel="alternate"
|
||||
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']); ?>"
|
||||
rel="http://opds-spec.org/image"
|
||||
type="image/jpeg" />
|
||||
<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 else: ?>
|
||||
<summary type="text"><?php p(formatMetadata($_['file']['humansize'],$_['file']['mimetype'],$_['file']['name'])); ?></summary>
|
||||
<?php endif; ?>
|
||||
</entry>
|
12
files_opds/templates/part.feed.navigation.php
Normal file
12
files_opds/templates/part.feed.navigation.php
Normal file
|
@ -0,0 +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>
|
||||
<link type="application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
rel="alternate"
|
||||
href="?id=<?php p($_['file']['id']); ?>"/>
|
||||
<link type="application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
rel="subsection"
|
||||
href="?id=<?php p($_['file']['id']); ?>"/>
|
||||
<content type="text"></content>
|
||||
</entry>
|
16
files_opds/templates/part.feed.root.php
Normal file
16
files_opds/templates/part.feed.root.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<entry>
|
||||
<title><?php p($l->t("Browse catalog")); ?></title>
|
||||
<updated><?php p(date("Y-m-d\TH:i:sP", $_['feed_updated'])); ?></updated>
|
||||
<content type="text"><?php p($l->t("Browse the catalog in alphabetical order")); ?></content>
|
||||
<link type="application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
href="?id=directory"/>
|
||||
<id>id:by_directory</id>
|
||||
</entry>
|
||||
<entry>
|
||||
<title><?php p($l->t("%s's bookshelf", array($_['user']))); ?></title>
|
||||
<updated><?php p(date("Y-m-d\TH:i:sP", $_['feed_updated'])); ?></updated>
|
||||
<content type="text"><?php p($l->t("This bookshelf contains %s books", array($_['bookshelf-count']))); ?></content>
|
||||
<link type="application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
href="?id=bookshelf"/>
|
||||
<id>id:by_bookshelf</id>
|
||||
</entry>
|
|
@ -12,20 +12,28 @@
|
|||
|
||||
?>
|
||||
|
||||
<div class="section" id="opds">
|
||||
<h2><?php p($l->t('OPDS')); ?></h2>
|
||||
<div class="section" id="opds-personal">
|
||||
<h2><?php p($l->t('OPDS')); ?><span class="msg"></span></h2>
|
||||
<div>
|
||||
<input id="opds-enable" name="opds-enable" value="<?php p($_['opdsEnable-value']) ?>" <?php p($_['opdsEnable-checked']) ?> type="checkbox">
|
||||
<label for="opds-enable"><?php p($l->t('enable OPDS catalog')) ?></label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="opds-root-path"><?php p($l->t('Root directory:')) ?></label>
|
||||
<input type="text" id="opds-root-path" title="<?php p($l->t("Enter root directory for OPDS catalog.")); ?>" value="<?php p($_['rootPath']) ?>" /><span class="msg"></span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="opds-file-types"><?php p($l->t('Supported extensions:')) ?></label>
|
||||
<input type="text" id="opds-file-types" title="<?php p($l->t("Enter list of comma-separated extensions (eg. pdf,epub,doc,txt). Leave blank to publish all file types.")); ?>" value="<?php p($_['fileTypes']) ?>" />
|
||||
</div>
|
||||
<br>
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="opds-feed-title"><?php p($l->t('Feed title:')) ?></label></td>
|
||||
<td><input type="text" id="opds-feed-title" title="<?php p($l->t("Enter title for OPDS catalog.")); ?>" value="<?php p($_['feedTitle']) ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="opds-root-path"><?php p($l->t('Root directory:')) ?></label></td>
|
||||
<td><input type="text" id="opds-root-path" title="<?php p($l->t("Enter root directory for OPDS catalog.")); ?>" value="<?php p($_['rootPath']) ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="opds-file-types"><?php p($l->t('Supported extensions:')) ?></label></td>
|
||||
<td><input type="text" id="opds-file-types" title="<?php p($l->t("Enter list of comma-separated extensions (eg. pdf,epub,doc,txt). Leave blank to publish all file types.")); ?>" value="<?php p($_['fileTypes']) ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<div>
|
||||
<input type="button" id="opds-clear-bookshelf" value="<?php p($l -> t('Clear Bookshelf')); ?>" />
|
||||
<input type="button" id="opds-really-clear-bookshelf" title="<?php p($l->t("Clear list of downloaded books from bookshelf. This only clears the list, it does not delete any books.")); ?>" value="<?php p($l -> t('Yes, I really want to clear my personal bookshelf')); ?>" hidden />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue