BUGFIX Fixed DebugView Breadcrumbs to not include query string as separate link, and don't append an arrow after the last element

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64072 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-10-10 13:05:37 +00:00
parent d4c92e29b4
commit daaf05530c

View File

@ -51,17 +51,18 @@ class DebugView {
*/
public function Breadcrumbs() {
$basePath = str_replace(Director::protocolAndHost(), '', Director::absoluteBaseURL());
$parts = explode('/', str_replace($basePath, '', $_SERVER['REQUEST_URI']));
$relPath = parse_url(str_replace($basePath, '', $_SERVER['REQUEST_URI']), PHP_URL_PATH);
$parts = explode('/', $relPath);
$base = Director::absoluteBaseURL();
$path = "";
$pathPart = "";
$pathLinks = array();
foreach($parts as $part) {
if ($part != '') {
$pathPart .= "$part/";
$path .= "<a href=\"$base$pathPart\">$part</a>&rarr;&nbsp;";
$pathLinks[] = "<a href=\"$base$pathPart\">$part</a>";
}
}
return $path;
return implode('&rarr;&nbsp;', $pathLinks);
}
/**