diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/lang/en/lang.php | 1 | ||||
-rw-r--r-- | inc/template.php | 29 |
2 files changed, 22 insertions, 8 deletions
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index f3c7c3dbe..1a4308125 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -111,6 +111,7 @@ $lang['yours'] = 'Your Version'; $lang['diff'] = 'show differences to current version'; $lang['line'] = 'Line'; $lang['breadcrumb'] = 'Trace'; +$lang['youarehere'] = 'You are here'; $lang['lastmod'] = 'Last modified'; $lang['by'] = 'by'; $lang['deleted'] = 'removed'; diff --git a/inc/template.php b/inc/template.php index 63e90118d..5d085605d 100644 --- a/inc/template.php +++ b/inc/template.php @@ -535,12 +535,12 @@ function tpl_breadcrumbs(){ /** * Hierarchical breadcrumbs * - * This code was suggested as replacement for the usual breadcrumbs - * trail in the Wiki and was modified by me. + * This code was suggested as replacement for the usual breadcrumbs. * It only makes sense with a deep site structure. * * @author Andreas Gohr <andi@splitbrain.org> * @author Nigel McNie <oracle.shinoda@gmail.com> + * @author Sean Coates <sean@caedmon.net> * @link http://wiki.splitbrain.org/wiki:tipsandtricks:hierarchicalbreadcrumbs * @todo May behave strangely in RTL languages */ @@ -549,16 +549,22 @@ function tpl_youarehere(){ global $ID; global $lang; + //check if enabled + if(!$conf['youarehere']) return; $parts = explode(':', $ID); - // Perhaps a $lang['tree'] could be defined? "Trace" isn't too appropriate - //print $lang['tree'].': '; - print $lang['breadcrumb'].': '; + print $lang['youarehere'].': '; //always print the startpage - if( $a_part[0] != $conf['start'] ) - tpl_link(wl($conf['start']),$conf['start'],'title="'.$conf['start'].'"'); + if( $a_part[0] != $conf['start']){ + if($conf['useheading']){ + $pageName = p_get_first_heading($conf['start']); + }else{ + $pageName = $conf['start']; + } + tpl_link(wl($conf['start']),$pageName,'title="'.$pageName.'"'); + } $page = ''; foreach ($parts as $part){ @@ -569,7 +575,14 @@ function tpl_youarehere(){ $page .= $part; if(file_exists(wikiFN($page))){ - tpl_link(wl($page),$part,'title="'.$page.'"'); + if($conf['useheading']){ + $pageName = p_get_first_heading($page); + $partName = $pageName; + }else{ + $pageName = $page; + $partName = $part; + } + tpl_link(wl($page),$partName,'title="'.$pageName.'"'); }else{ // Print the link, but mark as not-existing, as for other non-existing links tpl_link(wl($page),$part,'title="'.$page.'" class="wikilink2"'); |