diff -r ecb636490702 -r a85af9c28355 includes/pageprocess.php
--- a/includes/pageprocess.php Sat Mar 08 19:39:43 2008 -0500
+++ b/includes/pageprocess.php Tue Mar 11 17:09:20 2008 -0400
@@ -1846,47 +1846,32 @@
';
if ( $show_home )
{
- if ( count($breadcrumb_data) > 1 )
+ // Display the "home" link first.
+ $pathskey = $paths->nslist[ $this->namespace ] . $this->page_id;
+ if ( $pathskey !== getConfig('main_page') )
+ echo '';
+ echo $lang->get('onpage_btn_breadcrumbs_home');
+ if ( $pathskey !== getConfig('main_page') )
+ echo '';
+ }
+ foreach ( $breadcrumb_data as $i => $crumb )
+ {
+ $cumulative = implode('/', array_slice($breadcrumb_data, 0, ( $i + 1 )));
+ if ( $show_home && $cumulative === getConfig('main_page') )
+ continue;
+ if ( $show_home || $i > 0 )
+ echo ' » ';
+ $title = ( isPage($cumulative) ) ? get_page_title($cumulative) : get_page_title($crumb);
+ if ( $i + 1 == count($breadcrumb_data) )
{
- echo '' . $lang->get('onpage_btn_breadcrumbs_home') . ' »';
+ echo htmlspecialchars($title);
}
else
{
- echo $lang->get('onpage_btn_breadcrumbs_home');
+ $exists = ( isPage($cumulative) ) ? '' : ' class="wikilink-nonexistent"';
+ echo '' . htmlspecialchars($title) . '';
}
}
- foreach ( $breadcrumb_data as $i => $higherpage )
- {
- $higherpage = $paths->nslist[$this->namespace] . sanitize_page_id(implode('/', array_slice($breadcrumb_data, 0, ($i+1))));
- if ( $higherpage === getConfig('main_page') )
- continue;
- if ( ($i + 1) == count($breadcrumb_data) )
- {
- $title = ( $higherpage === getConfig('main_page') ) ? $lang->get('onpage_btn_breadcrumbs_home') : get_page_title($higherpage, false);
- if ( !$this->page_exists )
- {
- $title = explode('/', $title);
- $title = array_reverse($title);
- $title = $title[0];
- }
- echo htmlspecialchars($title);
- break;
- }
- else if ( isPage($higherpage) )
- {
- $title = get_page_title($higherpage, false);
- echo '' . htmlspecialchars($title) . '';
- }
- else
- {
- $title = get_page_title($higherpage, false);
- $title = explode('/', $title);
- $title = array_reverse($title);
- $title = $title[0];
- echo '' . htmlspecialchars($title) . '';
- }
- echo ' » ';
- }
echo '
';