partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit f0cf5102d182a386765d71617cc178525722fba8
parent f965cde280644f9f38136a18fbd02bb4eca0f0be
Author: Felicitus <felicitus@felicitus.org>
Date:   Fri, 13 Jul 2012 01:56:05 +0200

Load external font with https if PartKeepr is called using https.

Diffstat:
Msrc/frontend/index.php | 6++++++
Msrc/frontend/templates/index.tpl | 3++-
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/frontend/index.php b/src/frontend/index.php @@ -95,4 +95,10 @@ if ($renderParams["debug_all"]) { $renderParams["scripts"] = unserialize(file_get_contents(PartKeepr::getRootDirectory() . "/partkeepr.jsfiles")); } +if (isset($_SERVER['HTTPS'])) { + $renderParams["https"] = true; +} else { + $renderParams["https"] = false; +} + echo $template->render($renderParams); \ No newline at end of file diff --git a/src/frontend/templates/index.tpl b/src/frontend/templates/index.tpl @@ -5,7 +5,8 @@ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>PartKeepr</title> - <link href='http://fonts.googleapis.com/css?family=Ubuntu:400,700italic' rel='stylesheet' type='text/css'> + + <link href="{% if https %}https{% else %}http{% endif %}://fonts.googleapis.com/css?family=Ubuntu:400,700italic" rel="stylesheet" type="text/css"> <!-- Include the ExtJS CSS Theme --> <link rel="stylesheet" type="text/css" href="css/partkeepr-theme.css"/>