diff options
author | Anika Henke <anika@selfthinker.org> | 2011-08-28 19:12:33 +0100 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2011-08-28 19:12:33 +0100 |
commit | 816f4362db471d31c28d1ad42ecce517a929fbe6 (patch) | |
tree | 69e63f3f0a13d2ee75c63700a4d897bc1cd547b1 | |
parent | 6ab9f8659c49cfb82c99bd2ae0006fc7fe868981 (diff) | |
download | rpg-816f4362db471d31c28d1ad42ecce517a929fbe6.tar.gz rpg-816f4362db471d31c28d1ad42ecce517a929fbe6.tar.bz2 |
removed starter template specific functionalities (including user and discussion buttons/links)
-rwxr-xr-x | conf/default.php | 2 | ||||
-rwxr-xr-x | conf/metadata.php | 2 | ||||
-rwxr-xr-x | lang/en/lang.php | 4 | ||||
-rwxr-xr-x | lang/en/settings.php | 2 | ||||
-rwxr-xr-x | main.php | 6 | ||||
-rwxr-xr-x | tpl_functions.php | 111 |
6 files changed, 2 insertions, 125 deletions
diff --git a/conf/default.php b/conf/default.php index 57b7bd581..378e61909 100755 --- a/conf/default.php +++ b/conf/default.php @@ -5,7 +5,5 @@ */ $conf['tagline'] = 'This is the tagline - explaining what this site is about.'; -$conf['discussionPage'] = 'discussion:@ID@'; -$conf['userPage'] = 'user:@USER@:'; $conf['sidebarID'] = 'sidebar'; $conf['hideTools'] = 0; diff --git a/conf/metadata.php b/conf/metadata.php index 88583bcd0..ac0fdf142 100755 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -5,7 +5,5 @@ */ $meta['tagline'] = array('string'); -$meta['discussionPage'] = array('string'); -$meta['userPage'] = array('string'); $meta['sidebarID'] = array('string'); $meta['hideTools'] = array('onoff'); diff --git a/lang/en/lang.php b/lang/en/lang.php index 91b04b177..a19601ef9 100755 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -4,10 +4,6 @@ * */ -$lang['discussion'] = 'Discussion'; -$lang['back_to_article'] = 'Back to article'; -$lang['userpage'] = 'User page'; - /* accessibility headlines */ $lang['user_tools'] = 'User Tools'; $lang['site_tools'] = 'Site Tools'; diff --git a/lang/en/settings.php b/lang/en/settings.php index 356e95234..da01d290f 100755 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -5,7 +5,5 @@ */ $lang['tagline'] = 'Tagline'; -$lang['discussionPage'] = 'Discussion page (leave empty to disable discussions)'; -$lang['userPage'] = 'User page (leave empty to disable user pages)'; $lang['sidebarID'] = 'page name of page included in sidebar'; $lang['hideTools'] = 'Hide tools when not logged in?'; @@ -18,7 +18,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title> <?php tpl_metaheaders() ?> - <link rel="shortcut icon" href="<?php echo _tpl_getFavicon() /* DW versions > 2010-11-12 can use the core function tpl_getFavicon() */ ?>" /> + <link rel="shortcut icon" href="<?php echo tpl_getFavicon() ?>" /> <?php _tpl_include('meta.html') ?> </head> @@ -67,9 +67,8 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER echo '</li>'; } tpl_action('admin', 1, 'li'); - _tpl_action('userpage', 1, 'li'); tpl_action('profile', 1, 'li'); - _tpl_action('register', 1, 'li'); /* DW versions > 2011-02-20 can use the core function tpl_action('register', 1, 'li') */ + tpl_action('register', 1, 'li'); tpl_action('login', 1, 'li'); ?> </ul> @@ -140,7 +139,6 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER <ul> <?php tpl_action('edit', 1, 'li'); - _tpl_action('discussion', 1, 'li'); tpl_action('history', 1, 'li'); tpl_action('backlink', 1, 'li'); tpl_action('subscribe', 1, 'li'); diff --git a/tpl_functions.php b/tpl_functions.php index 54b143fc9..1ea3d0f92 100755 --- a/tpl_functions.php +++ b/tpl_functions.php @@ -12,117 +12,6 @@ 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'; -} - -/** * Include additional html file from conf directory if it exists, otherwise use * file in the template's root directory. * |