diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php index afdbdf3a0a54fcfd3e71c7bcf828f456a0a007fd..04b0abe0b23cc1f3efa3adb21973bbaa33bdf333 100644 --- a/conf/dokuwiki.php +++ b/conf/dokuwiki.php @@ -25,6 +25,7 @@ $conf['template'] = 'default'; //see tpl directory $conf['fullpath'] = 0; //show full path of the document or relative to datadir only? 0|1 $conf['recent'] = 20; //how many entries to show in recent $conf['breadcrumbs'] = 10; //how many recent visited pages to show +$conf['youarehere'] = 0; //show "You are here" navigation? 0|1 $conf['typography'] = 1; //convert quotes, dashes and stuff to typographic equivalents? 0|1 $conf['htmlok'] = 0; //may raw HTML be embedded? This may break layout and XHTML validity 0|1 $conf['phpok'] = 0; //may PHP code be embedded? Never do this on the internet! 0|1 diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index f3c7c3dbee21c03e4186d5f4d3e158c2e6c0cf1d..1a43081250cf4c84e2a335b1d1943fa722ee04ec 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 63e90118d320dd247bde7a3a8a096f04ea77460e..5d085605dff6da562488f257268854551198047f 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"'); diff --git a/lib/tpl/default/main.php b/lib/tpl/default/main.php index 01dd60d6607cdb4d4409f4d6eb2d70a41970a789..1f4940327605e362d9792b65925f033e46950b32 100644 --- a/lib/tpl/default/main.php +++ b/lib/tpl/default/main.php @@ -64,6 +64,12 @@ </div> <?php }?> + <?php if($conf['youarehere']){?> + <div class="breadcrumbs"> + <?php tpl_youarehere() ?> + </div> + <?php }?> + </div> <?php flush()?>