<?php
/**
* Kleine Funktion zum Erzeugen einer Brotkrümelmavigation
* @author: Jörg Reinholz, fastix WebDesign & Consult, Kassel - http://www.fastix.org/
* @version: 1.0.1
*
* string $sPath # The Path # Not optional.
* boolean $bolLastLink # Returm last element as Link? # Default: false
* string $sPrePath # The path bevore the output # Default: ''
* string $cDelimOut # The delimiter into the output. # Default: '/'
* string $cDelInput # The delimiter into the input. # Default: '/'
**/
function getBreadcrumb( $sPath, $bolLastLink=false, $sPrePath='', $cDelimOut='/', $cDelimInput='/' ) {
$out = '';
$path = trim(trim($sPath, $cDelimInput));
$ar = explode( $cDelimInput, $path );
$step = 0;
$lnk = $sPrePath;
foreach($ar as $s) {
$step++;
if ( $bolLastLink or
count($ar) > $step ) {
$out .= $cDelimOut . '<a href="' . $lnk .'">' . $txt . '</a>';
} else {
$out .= $cDelimOut . $txt;
}
}
$s[] = '\\' ; $r[] = '\\\\';
$s[] = '/' ; $r[] = '\/';
$s[] = '?' ; $r[] = '\?';
$s[] = '+' ; $r[] = '\+';
$s[] = '*' ; $r[] = '\*';
$s[] = '.' ; $r[] = '\.';
$s[] = '(' ; $r[] = '\(';
$s[] = ')' ; $r[] = '\)';
$s[] = '[' ; $r[] = '\[';
$s[] = ']' ; $r[] = '\]';
$s[] = '{' ; $r[] = '\{';
$s[] = '}' ; $r[] = '\}';
}