diff options
author | Anika Henke <anika@selfthinker.org> | 2010-11-05 00:32:03 +0000 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2010-11-05 00:32:03 +0000 |
commit | f4d27201048c83c893d9476dd80a89bbce29a1c6 (patch) | |
tree | 0ba40ac5a4a1d55b0e43cbcee0c41ae79b48e9bc /tpl_functions.php | |
download | rpg-f4d27201048c83c893d9476dd80a89bbce29a1c6.tar.gz rpg-f4d27201048c83c893d9476dd80a89bbce29a1c6.tar.bz2 |
initial commit
Diffstat (limited to 'tpl_functions.php')
-rw-r--r-- | tpl_functions.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tpl_functions.php b/tpl_functions.php new file mode 100644 index 000000000..58f9ab4f9 --- /dev/null +++ b/tpl_functions.php @@ -0,0 +1,25 @@ +<?php + +// must be run from within DokuWiki +if (!defined('DOKU_INC')) die(); +if (!defined('DOKU_LF')) define('DOKU_LF',"\n"); + +/** + * Create link/button to discussion page and back + */ +function _tpl_discussion($discussNS='discussion:',$link=0) { + global $ID; + global $lang; + if(substr($ID,0,strlen($discussNS))==$discussNS) { + $backID = substr(strstr($ID,':'),1); + if ($link) + tpl_pagelink(':'.$backID,$lang['btn_back']); + else + echo html_btn('back',$backID,'',array()); + } else { + if ($link) + tpl_pagelink($discussNS.$ID,tpl_getLang('btn_discussion')); + else + echo html_btn('discussion',$discussNS.$ID,'',array()); + } +} |