From 04e22728fad9e5b6c170ade7cc995dab0eb697d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sun, 9 Feb 2014 15:24:54 +0100 Subject: [PATCH] Load the doctype / HTML version / head from a separate file. re #79 --- index.php | 58 ++++++++-------------------------- templates/bootstrap/file.html | 59 +++++++++++++++++++++++++++++++++++ templates/default/file.html | 41 ++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 45 deletions(-) create mode 100644 templates/bootstrap/file.html create mode 100644 templates/default/file.html diff --git a/index.php b/index.php index 002c546..b44f385 100644 --- a/index.php +++ b/index.php @@ -43,52 +43,20 @@ } header ("Content-Type:text/html;charset=utf-8"); -?> - - - - - - - - - - - - COPS - - - - - - - " media="screen" /> - - - - - - - - - " /> - " media="screen" /> - - - - - - + $data = array("title" => $config['cops_title_default'], + "version" => VERSION, + "opds_url" => $config['cops_full_url'] . "feed.php", + "template" => getCurrentTemplate (), + "server_side_rendering" => useServerSideRendering (), + "current_css" => getCurrentCss (), + "favico" => $config['cops_icon'], + "getjson_url" => "getJSON.php?" . addURLParameter (getQueryString (), "complete", 1)); + $headcontent = file_get_contents('templates/' . getCurrentTemplate () . '/file.html'); + $template = new doT (); + $dot = $template->template ($headcontent, NULL); + echo ($dot ($data)); +?> + + + + + + + + + + + + + {{=it.title}} + + + + +{{? it.server_side_rendering == 0}} + + + + + +{{?}} + + + + + + + + + + + + + + + +{{? it.server_side_rendering == 0}} + +{{?}} + \ No newline at end of file diff --git a/templates/default/file.html b/templates/default/file.html new file mode 100644 index 0000000..5316645 --- /dev/null +++ b/templates/default/file.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + {{=it.title}} + + + + +{{? it.server_side_rendering == 0}} + + + + + +{{?}} + + + + + + + + +{{? it.server_side_rendering == 0}} + +{{?}} +