summaryrefslogtreecommitdiff
path: root/lib/tpl/dokuwiki/tpl_functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tpl/dokuwiki/tpl_functions.php')
-rw-r--r--lib/tpl/dokuwiki/tpl_functions.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/tpl/dokuwiki/tpl_functions.php b/lib/tpl/dokuwiki/tpl_functions.php
new file mode 100644
index 000000000..c024f33e7
--- /dev/null
+++ b/lib/tpl/dokuwiki/tpl_functions.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Template Functions
+ *
+ * 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
+if (!defined('DOKU_INC')) die();
+
+/* @todo: add this function to the core and delete this file */
+
+/**
+ * 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);
+}