From 6bd812df210e8b6d49f488e04f68f83ca8f1e610 Mon Sep 17 00:00:00 2001 From: Nigel McNie Date: Sat, 27 Aug 2005 14:11:54 +0200 Subject: small changes to tpl_youarehere() There were a bug where the $conf['startpage'] link is shown twice, and I changed the behaviour on finding a link to a page that doesn't exist. darcs-hash:20050827121154-d87d2-d49833b3229523f5b5ae9354fe8d3aff24f983da.gz --- inc/template.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/inc/template.php b/inc/template.php index 4ce5041e9..5a51d5eba 100644 --- a/inc/template.php +++ b/inc/template.php @@ -536,32 +536,40 @@ function tpl_breadcrumbs(){ * It only makes sense with a deep site structure. * * @author Andreas Gohr + * @author Nigel McNie * @link http://wiki.splitbrain.org/wiki:tipsandtricks:hierarchicalbreadcrumbs - * @todo May behave starngely in RTL languages + * @todo May behave strangely in RTL languages */ function tpl_youarehere(){ global $conf; global $ID; global $lang; - + $parts = explode(':', $ID); + // Perhaps a $lang['tree'] could be defined? "Trace" isn't too appropriate + //print $lang['tree'].': '; print $lang['breadcrumb'].': '; - //always print the startpage + //always print the startpage if( $a_part[0] != $conf['start'] ) tpl_link(wl($conf['start']),$conf['start'],'title="'.$conf['start'].'"'); - $page = ''; + $page = ''; foreach ($parts as $part){ - print ' » '; + // Skip startpage if already done + if ($part == $conf['start']) continue; + + print ' » '; $page .= $part; if(file_exists(wikiFN($page))){ tpl_link(wl($page),$part,'title="'.$page.'"'); }else{ - print $page; + // Print the link, but mark as not-existing, as for other non-existing links + tpl_link(wl($page),$part,'title="'.$page.'" class="wikilink2"'); + //print $page; } $page .= ':'; -- cgit v1.2.3