From 0cf1383db0481ba690f38a08a51a3c7619ac49b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 6 Feb 2014 21:26:20 +0100 Subject: [PATCH] Begin the templating --- base.php | 15 ++++++++++----- index.php | 3 ++- util.js | 14 +++++++------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/base.php b/base.php index d04a77e..96e074d 100644 --- a/base.php +++ b/base.php @@ -18,11 +18,12 @@ function useServerSideRendering () { function serverSideRender ($data) { // Get the templates - $header = file_get_contents('templates/default/header.html'); - $footer = file_get_contents('templates/default/footer.html'); - $main = file_get_contents('templates/default/main.html'); - $bookdetail = file_get_contents('templates/default/bookdetail.html'); - $page = file_get_contents('templates/default/page.html'); + $theme = getCurrentTemplate (); + $header = file_get_contents('templates/' . $theme . '/header.html'); + $footer = file_get_contents('templates/' . $theme . '/footer.html'); + $main = file_get_contents('templates/' . $theme . '/main.html'); + $bookdetail = file_get_contents('templates/' . $theme . '/bookdetail.html'); + $page = file_get_contents('templates/' . $theme . '/page.html'); // Generate the function for the template $template = new doT (); @@ -76,6 +77,10 @@ function getCurrentCss () { return "styles/style-" . getCurrentOption ("style") . ".css"; } +function getCurrentTemplate () { + return "default"; +} + function getUrlWithVersion ($url) { return $url . "?v=" . VERSION; } diff --git a/index.php b/index.php index e23f2e9..1220c12 100644 --- a/index.php +++ b/index.php @@ -79,7 +79,8 @@