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

Initial port to OC8, files_opds works, files_reader does not yet work

This commit is contained in:
frankdelange 2015-02-11 02:00:28 +01:00
parent 0d96eb08a4
commit ba221c1d61
8 changed files with 54 additions and 6 deletions

View file

@ -0,0 +1,2 @@
<?php

View file

@ -0,0 +1,23 @@
<?php
/**
* ownCloud - Files_Opds App
*
* @author Frank de Lange
* @copyright 2015 Frank de Lange
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
$this->create('opds_catalog', '/')
->actionInclude('files_opds/index.php');
$this->create('opds_catalog_admin_settings', 'ajax/admin.php')
->actionInclude('files_opds/ajax/admin.php');
$this->create('opds_catalog_personal_settings', 'ajax/personal.php')
->actionInclude('files_opds/ajax/personal.php');
$this->create('opds_catalog_clear_bookshelf', 'ajax/clear_bookshelf.php')
->actionInclude('files_opds/ajax/clear_bookshelf.php');
$this->create('opds_catalog_schedule_rescan', 'ajax/schedule_rescan.php')
->actionInclude('files_opds/ajax/schedule_rescan.php');

View file

@ -58,7 +58,7 @@ $dirInfo = \OC\Files\Filesystem::getFileInfo($dir);
/* If requested resource is a file, serve it, otherwise produce opds feed */
switch ($dirInfo->getType()) {
case 'file':
if ($type) {
if (isset($type)) {
Feed::servePreview($dir,$type);
} else {
Feed::serveFile($dir,$id);

View file

@ -35,7 +35,7 @@ class Feed
*/
public static function serveFile($path, $id) {
\OCP\User::checkLoggedIn();
\OC::$session->close();
\OC::$server->getSession()->close();
Bookshelf::add($id);
$dirName = dirname($path);
$fileName = basename($path);
@ -81,7 +81,7 @@ class Feed
*/
public static function servePreview($path, $type) {
\OCP\User::checkLoggedIn();
\OC::$session->close();
\OC::$server->getSession()->close();
$i = \OC\Files\Filesystem::getFileInfo($path,false);
/* check for predefined cover, if found replace $path with that of cover file */

View file

@ -23,7 +23,7 @@ class Files extends \OCA\Files\Helper
* @param \OCP\Files\FileInfo $i
* @return array formatted file info
*/
public static function formatFileInfo($i) {
public static function formatFileInfo(\OCP\Files\FileInfo $i) {
$entry = array();
$entry['id'] = $i['fileid'];

View file

@ -22,7 +22,11 @@ function checkBox($format) {
?>
<div class="section" id="opds-admin">
<h2><?php p($l->t('OPDS')); ?><span class="msg"></span></h2>
<table>
<tr>
<td><h2><?php p($l->t('OPDS')); ?></h2></td><td>&nbsp;<span class="msg"></span></td>
</tr>
</table>
<table>
<tr>
<td><label for="opds-feed-subtitle"><?php p($l->t('Feed subtitle:')) ?></label></td>

View file

@ -13,7 +13,11 @@
?>
<div class="section" id="opds-personal">
<h2><?php p($l->t('OPDS')); ?><span class="msg"></span></h2>
<table>
<tr>
<td><h2><?php p($l->t('OPDS')); ?></h2></td><td>&nbsp;<span class="msg"></span></td>
</tr>
</table>
<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>

View file

@ -0,0 +1,15 @@
<?php
/**
* ownCloud - Files_Reader App
*
* @author Frank de Lange
* @copyright 2015 Frank de Lange
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
$this->create('files_reader', '/')
->actionInclude('files_reader/viewer.php');