summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNigel McNie <oracle.shinoda@gmail.com>2005-08-27 14:11:54 +0200
committerNigel McNie <oracle.shinoda@gmail.com>2005-08-27 14:11:54 +0200
commit6bd812df210e8b6d49f488e04f68f83ca8f1e610 (patch)
treebd1eb08ff5696ed492f1a64b08677af8d5a058d6
parentf137f476d5aaf309d4cf14c3ca125140d1ec5127 (diff)
downloadrpg-6bd812df210e8b6d49f488e04f68f83ca8f1e610.tar.gz
rpg-6bd812df210e8b6d49f488e04f68f83ca8f1e610.tar.bz2
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
-rw-r--r--inc/template.php20
1 files 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 <andi@splitbrain.org>
+ * @author Nigel McNie <oracle.shinoda@gmail.com>
* @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 ' &raquo; ';
+ // Skip startpage if already done
+ if ($part == $conf['start']) continue;
+
+ print ' &raquo; ';
$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 .= ':';