Beispiel #1
0
 public function testPageAuthorsDetail_WithoutAnyId()
 {
     global $config;
     $page = Base::PAGE_AUTHOR_DETAIL;
     $query = NULL;
     $qid = "1";
     $n = "1";
     $_SERVER['QUERY_STRING'] = "page=" . Base::PAGE_AUTHOR_DETAIL . "&id=1&n=1";
     $_SERVER['REQUEST_URI'] = "index.php?XXXX";
     $currentPage = Page::getPage($page, $qid, $query, $n);
     $currentPage->InitializeContent();
     $currentPage->idPage = NULL;
     $OPDSRender = new OPDSRenderer();
     file_put_contents(TEST_FEED, $OPDSRender->render($currentPage));
     $this->AssertTrue($this->opdsCompleteValidation(TEST_FEED));
 }
Beispiel #2
0
require_once "base.php";
require_once "author.php";
require_once "serie.php";
require_once "tag.php";
require_once "book.php";
require_once "OPDS_renderer.php";
header("Content-Type:application/xml");
$page = getURLParam("page", Base::PAGE_INDEX);
$query = getURLParam("query");
$n = getURLParam("n", "1");
if ($query) {
    $page = Base::PAGE_OPENSEARCH_QUERY;
}
$qid = getURLParam("id");
if ($config['cops_fetch_protect'] == "1") {
    session_start();
    if (!isset($_SESSION['connected'])) {
        $_SESSION['connected'] = 0;
    }
}
$OPDSRender = new OPDSRenderer();
switch ($page) {
    case Base::PAGE_OPENSEARCH:
        echo $OPDSRender->getOpenSearch();
        return;
    default:
        $currentPage = Page::getPage($page, $qid, $query, $n);
        $currentPage->InitializeContent();
        echo $OPDSRender->render($currentPage);
        return;
}