From 383a53f459aaeed3cad97bfbcf22d22a7be87de9 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 3 Jan 2011 20:53:49 +0000 Subject: [PATCH] made include hooks more flexible (especially for farms: put included file into conf directory) --- main.php | 10 +++++----- tpl_functions.php | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/main.php b/main.php index d47f8d3..09eb125 100644 --- a/main.php +++ b/main.php @@ -19,7 +19,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER <?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>] - + @@ -32,7 +32,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
- +
@@ -113,7 +113,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
- +
@@ -123,7 +123,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
- +
@@ -154,7 +154,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
- +
diff --git a/tpl_functions.php b/tpl_functions.php index 7848132..cadf400 100644 --- a/tpl_functions.php +++ b/tpl_functions.php @@ -93,3 +93,19 @@ function _tpl_getFavicon() { return ml('favicon.ico'); return DOKU_TPL.'images/favicon.ico'; } + +/** + * Include additional html file from conf directory if it exists, otherwise use + * file in the template's root directory. + * + * @author Anika Henke + */ +function _tpl_include($fn) { + $confFile = DOKU_CONF.$fn; + $tplFile = dirname(__FILE__).'/'.$fn; + + if (file_exists($confFile)) + include($confFile); + else if (file_exists($tplFile)) + include($tplFile); +}