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");
|
|
|
|
|
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-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-05-28 08:05:05 +03:00
|
|
|
|
$currentPage = Page::getPage ($page, $qid, $query);
|
|
|
|
|
$currentPage->InitializeContent ();
|
|
|
|
|
echo $OPDSRender->render ($currentPage);
|
|
|
|
|
return;
|
2012-05-28 08:01:33 +03:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
?>
|