*/ if(!defined('DW_LF')) define('DW_LF',"\n"); // load language files require_once(DOKU_TPLINC.'lang/en/lang.php'); if(@file_exists(DOKU_TPLINC.'lang/'.$conf['lang'].'/lang.php')) { require_once(DOKU_TPLINC.'lang/'.$conf['lang'].'/lang.php'); } /** * checks if a file called logo.png or logo.jpg exists * and uses it as logo, uses the dokuwiki logo by default * * @author Michael Klier */ function tpl_logo() { global $conf; $out = ''; switch(true) { case(@file_exists(DOKU_TPLINC.'images/logo.jpg')): $logo = DOKU_TPL.'images/logo.jpg'; break; case(@file_exists(DOKU_TPLINC.'images/logo.jpeg')): $logo = DOKU_TPL.'images/logo.jpeg'; break; case(@file_exists(DOKU_TPLINC.'images/logo.png')): $logo = DOKU_TPL.'images/logo.png'; break; default: $logo = DOKU_TPL.'images/dokuwiki-128.png'; break; } $out .= ''; $out .= ' ' . DW_LF; print ($out); } /** * generates the sidebar contents * * @author Michael Klier */ function tpl_sidebar() { global $lang; global $ID; global $INFO; $svID = cleanID($ID); $navpn = tpl_getConf('pagename'); $path = explode(':',$svID); $found = false; $sb = ''; if(tpl_getConf('closedwiki') && empty($INFO['userinfo'])) { print '' . $lang['toolbox'] . '' . DW_LF; print '' . DW_LF; return; } // main navigation print '' . $lang['navigation'] . '' . DW_LF; print '' . DW_LF; print '' . $lang['index'] . '' . DW_LF; print '' . DW_LF; // generate the searchbox print '' . strtolower($lang['btn_search']) . '' . DW_LF; print '' . DW_LF; // generate the toolbox print '' . $lang['toolbox'] . '' . DW_LF; print '' . DW_LF; } /** * removes the TOC of the sidebar-pages and shows a edit-button if user has enough rights * * @author Michael Klier */ function p_sidebar_xhtml($sb) { $data = p_wiki_xhtml($sb,'',false); if(auth_quickaclcheck($sb) >= AUTH_EDIT) { $data .= '
' . html_btn('secedit',$sb,'',array('do'=>'edit','rev'=>'','post')) . '
'; } return preg_replace('/
.*?(<\/div>\n<\/div>)/s', '', $data); } /** * puts text into our sidebar using lang/en/$ns.txt */ function ts_sidebar($ns){ global $conf; $sb_path = 'lang/en'; if (@file_exists(DOKU_TPLINC.'lang/'.$conf['lang'].'/'.$ns.'.txt')) $sb_path = '../../../lib/tpl/tribalshout/lang/'.$conf['lang']; elseif (@file_exists(DOKU_TPLINC.'lang/en/'.$ns.'.txt')) $sb_path = '../../../lib/tpl/tribalshout/lang/en'; print p_locale_xhtml($sb_path.'/'.$ns); } /** * Like the action buttons but links * * Available links are * * article - links to the main page itself * discussion - links to Talk: * * @author Andreas Gohr * @author Matthias Grimm * @see tpl_button * adapted by davek */ function ts_tpl_actionlink($type,$pre='',$suf=''){ global $ID; global $INFO; global $REV; global $ACT; global $conf; global $lang; global $auth; // check disabled actions and fix the badly named ones $ctype = $type; if($type == 'history') $ctype='revisions'; if(!actionOK($ctype)) return false; switch($type){ case 'article': //$ID = ereg_replace('^talk:','Talk:',$ID); if (ereg('^talk:', $ID)) tpl_link(wl(ereg_replace('^talk:','',$ID)),$pre.$lang['btn_article'].$suf,'class="action article" accesskey="v" rel="nofollow"'); else tpl_link(wl($ID),$pre.$lang['btn_article'].$suf,'class="action article" accesskey="v" rel="nofollow"'); return true; case 'discussion': if (ereg('^talk:', $ID)) { tpl_link(wl($ID),$pre.$lang['btn_discussion'].$suf,'class="action discussion" style="margin-right:40px;" accesskey="d" rel="nofollow"'); } else { tpl_link(wl('talk:'.$ID),$pre.$lang['btn_discussion'].$suf,'class="action" style="margin-right:40px;" accesskey="d" rel="nofollow"'); } return true; default: print '[unknown link type]'; return true; } }