From a21fd4b9fa168f867852150b109fcd7da2e59996 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 7 Nov 2010 13:15:33 +0000 Subject: made favicon.ico more flexible (use from data/media only if it exists, otherwise from tpl) --- tpl_functions.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tpl_functions.php') diff --git a/tpl_functions.php b/tpl_functions.php index 0dfee9595..d258ed38b 100644 --- a/tpl_functions.php +++ b/tpl_functions.php @@ -4,6 +4,8 @@ * * This file provides template specific custom functions that are * not provided by the DokuWiki core. + * It is common practice to start each function with an underscore + * to make sure it won't interfere with future core functions. */ // must be run from within DokuWiki @@ -64,3 +66,15 @@ function _tpl_userpage($userNS='user',$link=0,$wrapper=false) { if ($wrapper) echo ""; } + +/** + * Use favicon.ico from data/media root directory if it exists, otherwise use + * the one in the template's image directory. + * + * @author Anika Henke + */ +function _tpl_getFavicon() { + if (file_exists(mediaFN('favicon.ico'))) + return ml('favicon.ico'); + return DOKU_TPL.'images/favicon.ico'; +} -- cgit v1.2.3