示例#1
0
 /**
  * The function for the head of the HTML catalog
  * @dataProvider providerTemplate
  */
 public function testGenerateHeader($templateName)
 {
     $_SERVER["HTTP_USER_AGENT"] = "Firefox";
     global $config;
     $headcontent = file_get_contents(dirname(__FILE__) . '/../templates/' . $templateName . '/file.html');
     $template = new doT();
     $tpl = $template->template($headcontent, NULL);
     $data = array("title" => $config['cops_title_default'], "version" => VERSION, "opds_url" => $config['cops_full_url'] . "feed.php", "customHeader" => "", "template" => $templateName, "server_side_rendering" => useServerSideRendering(), "current_css" => getCurrentCss(), "favico" => $config['cops_icon'], "getjson_url" => "getJSON.php?" . addURLParameter(getQueryString(), "complete", 1));
     $head = $tpl($data);
     $this->assertContains("<head>", $head);
     $this->assertContains("</head>", $head);
 }
示例#2
0
?>
>Verify Requirements</li>
            <li <?php 
echo getCurrentCss('database');
?>
>Set up Database</li>
            <li <?php 
echo getCurrentCss('configure');
?>
>Configure Site</li>
            <li <?php 
echo getCurrentCss('install');
?>
>Install</li>
            <li <?php 
echo getCurrentCss('finish');
?>
>Finish</li>
        </ul>
        <div id="footer">
            <ul>
                <!--icons borrowed from http://simpleicons.org/-->
                <li><a href="https://www.educask.com" target="_blank"><img
                            src="images/educasklogo-e.png"/></a></li>
                <li><a href="https://www.facebook.com/Educask" target="_blank"><img
                            src="images/facebook.png"/></a></li>
                <li><a href="https://github.com/educask" target="_blank"><img
                            src="images/github.png"/></a></li>
                <li><a href="https://twitter.com/educask" target="_blank"><img
                            src="images/twitter.png"/></a></li>
            </ul>
示例#3
0
文件: index.php 项目: BreizhCat/cops
$page = getURLParam("page", Base::PAGE_INDEX);
$query = getURLParam("query");
$qid = getURLParam("id");
$n = getURLParam("n", "1");
$database = GetUrlParam(DB);
// Access the database ASAP to be sure it's readable, redirect if that's not the case.
// It has to be done before any header is sent.
Base::checkDatabaseAvailability();
if ($config['cops_fetch_protect'] == "1") {
    session_start();
    if (!isset($_SESSION['connected'])) {
        $_SESSION['connected'] = 0;
    }
}
header("Content-Type:text/html;charset=utf-8");
$data = array("title" => $config['cops_title_default'], "version" => VERSION, "opds_url" => $config['cops_full_url'] . "feed.php", "customHeader" => "", "template" => getCurrentTemplate(), "server_side_rendering" => useServerSideRendering(), "current_css" => getCurrentCss(), "favico" => $config['cops_icon'], "getjson_url" => "getJSON.php?" . addURLParameter(getQueryString(), "complete", 1));
if (preg_match("/Kindle/", $_SERVER['HTTP_USER_AGENT'])) {
    $data["customHeader"] = '<style media="screen" type="text/css"> html { font-size: 75%; -webkit-text-size-adjust: 75%; -ms-text-size-adjust: 75%; }</style>';
}
$headcontent = file_get_contents('templates/' . getCurrentTemplate() . '/file.html');
$template = new doT();
$dot = $template->template($headcontent, NULL);
echo $dot($data);
?>
<body>
<?php 
if (useServerSideRendering()) {
    // Get the data
    require_once "JSON_renderer.php";
    $data = JSONRenderer::getJson(true);
    echo serverSideRender($data);
示例#4
0
文件: checkconfig.php 项目: ha-y/cops
header("Content-Type:text/html; charset=UTF-8");
$err = getURLParam("err", -1);
$full = getURLParam("full");
$error = NULL;
switch ($err) {
    case 1:
        $error = "Database error";
        break;
}
?>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>COPS Configuration Check</title>
    <link rel="stylesheet" type="text/css" href="<?php 
echo getUrlWithVersion(getCurrentCss());
?>
" media="screen" />
</head>
<body>
<div class="container">
    <header>
        <div class="headcenter">
            <h1>COPS Configuration Check</h1>
        </div>
    </header>
    <div id="content" style="display: none;"></div>
    <section>
        <?php 
if (!is_null($error)) {
    ?>