2012-05-28 08:01:33 +03:00
|
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* COPS (Calibre OPDS PHP Server) main script
|
|
|
|
|
*
|
|
|
|
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
|
|
|
|
* @author S<EFBFBD>bastien Lucas <sebastien@slucas.fr>
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
require_once ("config.php");
|
|
|
|
|
require_once ("base.php");
|
|
|
|
|
require_once ("author.php");
|
|
|
|
|
require_once ("serie.php");
|
2012-05-28 08:07:49 +03:00
|
|
|
|
require_once ("tag.php");
|
2012-05-28 08:01:33 +03:00
|
|
|
|
require_once ("book.php");
|
2012-05-28 08:05:05 +03:00
|
|
|
|
require_once ("OPDS_renderer.php");
|
|
|
|
|
|
2012-05-28 08:01:33 +03:00
|
|
|
|
header ("Content-Type:application/xml");
|
2012-05-28 08:05:05 +03:00
|
|
|
|
$page = getURLParam ("page", Base::PAGE_INDEX);
|
|
|
|
|
$query = getURLParam ("query");
|
2012-09-18 16:39:22 +03:00
|
|
|
|
$n = getURLParam ("n", "1");
|
2012-05-28 08:06:12 +03:00
|
|
|
|
if ($query)
|
|
|
|
|
$page = Base::PAGE_OPENSEARCH_QUERY;
|
2012-05-28 08:05:05 +03:00
|
|
|
|
$qid = getURLParam ("id");
|
|
|
|
|
|
|
|
|
|
$OPDSRender = new OPDSRenderer ();
|
|
|
|
|
|
2012-05-28 08:01:33 +03:00
|
|
|
|
switch ($page) {
|
|
|
|
|
case Base::PAGE_OPENSEARCH :
|
2012-05-28 08:05:05 +03:00
|
|
|
|
echo $OPDSRender->getOpenSearch ();
|
2012-05-28 08:01:33 +03:00
|
|
|
|
return;
|
|
|
|
|
default:
|
2012-09-18 16:39:22 +03:00
|
|
|
|
$currentPage = Page::getPage ($page, $qid, $query, $n);
|
2012-05-28 08:05:05 +03:00
|
|
|
|
$currentPage->InitializeContent ();
|
|
|
|
|
echo $OPDSRender->render ($currentPage);
|
|
|
|
|
return;
|
2012-05-28 08:01:33 +03:00
|
|
|
|
break;
|
|
|
|
|
}
|