made include hooks more flexible (especially for farms: put included file into conf directory)

This commit is contained in:
Anika Henke 2011-01-03 20:53:49 +00:00
parent b49f0667ba
commit 383a53f459
2 changed files with 21 additions and 5 deletions

View file

@ -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 <anika@selfthinker.org>
*/
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);
}