diff options
author | andi <andi@splitbrain.org> | 2005-03-18 18:57:44 +0100 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-03-18 18:57:44 +0100 |
commit | 1734437e2bd33ee82fbc1d6f0310400dc62abea9 (patch) | |
tree | 88b1b9da24240846e6786b42ce497ea041e20ecd /inc/template.php | |
parent | 60bac824c1f338a6ded5a89e79434d9acbc62f0c (diff) | |
download | rpg-1734437e2bd33ee82fbc1d6f0310400dc62abea9.tar.gz rpg-1734437e2bd33ee82fbc1d6f0310400dc62abea9.tar.bz2 |
removed dprecated stuff, added hierarchical breadcrumbs
darcs-hash:20050318175744-9977f-a917cca1f2eed5b85d37af9a7add00465ece9c99.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/inc/template.php b/inc/template.php index 8047a33d0..38af79df7 100644 --- a/inc/template.php +++ b/inc/template.php @@ -262,7 +262,6 @@ function tpl_searchform(){ /** * Print the breadcrumbs trace * - * @todo add a hierachical breadcrumb function * @author Andreas Gohr <andi@splitbrain.org> */ function tpl_breadcrumbs(){ @@ -281,6 +280,45 @@ function tpl_breadcrumbs(){ } /** + * Hierarchical breadcrumbs + * + * This code was suggested as replacement for the usual breadcrumbs + * trail in the Wiki and was modified by me. + * It only makes sense with a deep site structure. + * + * @author Andreas Gohr <andi@splitbrain.org> + * @link http://wiki.splitbrain.org/wiki:tipsandtricks:hierarchicalbreadcrumbs + */ +function tpl_youarehere(){ + global $conf; + global $ID; + global $lang; + + + $parts = explode(':', $ID); + + print $lang['breadcrumb'].': '; + + //always print the startpage + if( $a_part[0] != $conf['start'] ) + tpl_link(wl($conf['start']),$conf['start'],'title="'.$conf['start'].'"'); + + $page = ''; + foreach ($parts as $part){ + print ' » '; + $page .= $part; + + if(file_exists(wikiFN($page))){ + tpl_link(wl($page),$part,'title="'.$page.'"'); + }else{ + print $page; + } + + $page .= ':'; + } +} + +/** * Print info if the user is logged in * * Could be enhanced with a profile link in future? |