diff options
author | Anika Henke <anika@selfthinker.org> | 2012-02-05 15:06:09 +0000 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2012-02-05 15:06:09 +0000 |
commit | 753b6d5c72fb0639a1c94401f7089011e353d1e1 (patch) | |
tree | 698ca2101df2a8e862b3aa0e59ee31c3f1104132 /tpl_functions.php | |
parent | d07ea3739d8e6580641e84d4f3b14df6e0c9fd70 (diff) | |
parent | 79b3df949fb269d4c1e78a382efc163d514e2434 (diff) | |
download | rpg-753b6d5c72fb0639a1c94401f7089011e353d1e1.tar.gz rpg-753b6d5c72fb0639a1c94401f7089011e353d1e1.tar.bz2 |
Merge branch 'master' of c:/UniServer/www/dokuwiki/lib/tpl/dokuwiki-2011 into new_default
Conflicts:
README
css/_admin.css
css/_diff.css
css/_edit.css
css/_footnotes.css
css/_forms.css
css/_imgdetail.css
css/_links.css
css/_modal.css
css/_recent.css
css/_search.css
css/_toc.css
css/basic.css
css/content.css
css/design.css
css/includes.css
css/print.css
css/rtl.css
css/structure.css
detail.php
images/bullet.png
images/closed.png
images/favicon.ico
images/link_icon.gif
images/mail_icon.gif
images/open.png
images/windows.gif
main.php
mediamanager.php
style.ini
tpl_functions.php
Diffstat (limited to 'tpl_functions.php')
-rw-r--r-- | tpl_functions.php | 111 |
1 files changed, 1 insertions, 110 deletions
diff --git a/tpl_functions.php b/tpl_functions.php index 54b143fc9..c024f33e7 100644 --- a/tpl_functions.php +++ b/tpl_functions.php @@ -11,116 +11,7 @@ // must be run from within DokuWiki if (!defined('DOKU_INC')) die(); -/** - * Create link/button to discussion page and back - * - * @author Anika Henke <anika@selfthinker.org> - */ -function _tpl_discussion($discussionPage,$title,$backTitle,$link=0,$wrapper=0) { - global $ID; - - $discussPage = str_replace('@ID@',$ID,$discussionPage); - $discussPageRaw = str_replace('@ID@','',$discussionPage); - $isDiscussPage = strpos($ID,$discussPageRaw)!==false; - $backID = str_replace($discussPageRaw,'',$ID); - - if ($wrapper) echo "<$wrapper>"; - - if ($isDiscussPage) { - if ($link) - tpl_pagelink($backID,$backTitle); - else - echo html_btn('back2article',$backID,'',array(),'get',0,$backTitle); - } else { - if ($link) - tpl_pagelink($discussPage,$title); - else - echo html_btn('discussion',$discussPage,'',array(),'get',0,$title); - } - - if ($wrapper) echo "</$wrapper>"; -} - -/** - * Create link/button to user page - * - * @author Anika Henke <anika@selfthinker.org> - */ -function _tpl_userpage($userPage,$title,$link=0,$wrapper=0) { - if (!$_SERVER['REMOTE_USER']) return; - - global $conf; - $userPage = str_replace('@USER@',$_SERVER['REMOTE_USER'],$userPage); - - if ($wrapper) echo "<$wrapper>"; - - if ($link) - tpl_pagelink($userPage,$title); - else - echo html_btn('userpage',$userPage,'',array(),'get',0,$title); - - if ($wrapper) echo "</$wrapper>"; -} - -/** - * Create link/button to register page - * DW versions > 2011-02-20 can use the core function tpl_action('register') - * - * @author Anika Henke <anika@selfthinker.org> - */ -function _tpl_register($link=0,$wrapper=0) { - global $conf; - global $lang; - global $ID; - $lang_register = !empty($lang['btn_register']) ? $lang['btn_register'] : $lang['register']; - - if ($_SERVER['REMOTE_USER'] || !$conf['useacl'] || !actionOK('register')) return; - - if ($wrapper) echo "<$wrapper>"; - - if ($link) - tpl_link(wl($ID,'do=register'),$lang_register,'class="action register" rel="nofollow"'); - else - echo html_btn('register',$ID,'',array('do'=>'register'),'get',0,$lang_register); - - if ($wrapper) echo "</$wrapper>"; -} - -/** - * Wrapper around custom template actions - * - * @author Anika Henke <anika@selfthinker.org> - */ -function _tpl_action($type,$link=0,$wrapper=0) { - switch ($type) { - case 'discussion': - if (tpl_getConf('discussionPage')) { - _tpl_discussion(tpl_getConf('discussionPage'),tpl_getLang('discussion'),tpl_getLang('back_to_article'),$link,$wrapper); - } - break; - case 'userpage': - if (tpl_getConf('userPage')) { - _tpl_userpage(tpl_getConf('userPage'),tpl_getLang('userpage'),$link,$wrapper); - } - break; - case 'register': - _tpl_register($link,$wrapper); - break; - } -} - -/** - * Use favicon.ico from data/media root directory if it exists, otherwise use - * the one in the template's image directory. - * DW versions > 2010-11-12 can use the core function tpl_getFavicon() - * - * @author Anika Henke <anika@selfthinker.org> - */ -function _tpl_getFavicon() { - if (file_exists(mediaFN('favicon.ico'))) - return ml('favicon.ico'); - return DOKU_TPL.'images/favicon.ico'; -} +/* @todo: add this function to the core and delete this file */ /** * Include additional html file from conf directory if it exists, otherwise use |