Changeset 324 for trunk/lib/Navigation.inc.php
- Timestamp:
- Apr 26, 2008 1:25:46 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Navigation.inc.php
r304 r324 205 205 * 206 206 * @access public 207 * 208 * @return mixed Breadcrumbs (string) or false if breadcrumbs param not set. 207 * @return string Breadcrumbs or empty string if breadcrumbs param not set. 209 208 */ 210 209 function getBreadcrumbs() … … 213 212 214 213 if ($this->getParam('breadcrumbs')) { 215 $breadcrumbs = '';214 $breadcrumbs = array(); 216 215 $pathmark = ''; 217 216 $crumb_count = sizeof($this->pages); … … 219 218 if ($crumb_count <= $this->getParam('chop_breadcrumbs')) { 220 219 // Stop gathering crumbs. 221 return $breadcrumbs;220 break; 222 221 } 223 222 if ($crumb_count <= 1) { … … 225 224 if ('' == trim($page['url']) || $crumb_count <= $this->getParam('chop_breadcrumb_links')) { 226 225 // A crumb with no link. 227 $breadcrumbs .= oTxt($pathmark, true) .sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true));226 $breadcrumbs[] = sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)); 228 227 } else if ($crumb_count > $this->getParam('chop_breadcrumb_links')) { 229 228 // A normal linked crumb. 230 $breadcrumbs .= oTxt($pathmark, true) .'<a href="' . $app->oHREF($page['url']) . '">' . sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)) . '</a>';229 $breadcrumbs[] = '<a href="' . $app->oHREF($page['url']) . '">' . sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)) . '</a>'; 231 230 } 232 231 } else { 233 232 if ('' == trim($page['url'])) { 234 233 // A crumb with no link. 235 $breadcrumbs .= oTxt($pathmark . $page['title'], true);234 $breadcrumbs[] = oTxt($pathmark . $page['title'], true); 236 235 } else { 237 236 // A normal linked crumb. 238 $breadcrumbs .= oTxt($pathmark, true) .'<a href="' . $app->oHREF($page['url']) . '">' . oTxt($page['title'], true) . '</a>';237 $breadcrumbs[] = '<a href="' . $app->oHREF($page['url']) . '">' . oTxt($page['title'], true) . '</a>'; 239 238 } 240 239 } … … 242 241 $crumb_count--; 243 242 } 244 return $breadcrumbs;245 } else { 246 return false;243 return join(oTxt($pathmark, true), $breadcrumbs); 244 } else { 245 return ''; 247 246 } 248 247 }
Note: See TracChangeset
for help on using the changeset viewer.