<?
if(!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();
if(empty($arResult)){
	return '';
}

$currentPagePath = GetPagePath();
$strReturn = '<ul class="breadcrumb" id="navigation" itemscope itemtype="http://schema.org/BreadcrumbList">';
$position = 1;
for($index = 0, $itemSize = count($arResult); $index < $itemSize; ++$index){
	$title = htmlspecialcharsex($arResult[$index]['TITLE']);
	$bCurrent = $arResult[$index]['LINK'] == $currentPagePath || $arResult[$index]['LINK'].'index.php' == $currentPagePath;
	if(!$bCurrent){
		if(strlen($arResult[$index]["LINK"])){
			$strReturn .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="'.$arResult[$index]["LINK"].'" title="'.$title.'" itemprop="item"><span itemprop="name">'.$title.'</span></a><meta itemprop="position" content="'.$position.'" /></li>';
		}
	}
	else{
		$strReturn .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="active"><link href="'.$arResult[$index]['LINK'].'" itemprop="item" /><span itemprop="name">'.$title.'</span><meta itemprop="position" content="'.$position.'" /></li>';
		break;
	}
	++$position;
}

$strReturn .= '</ul>';
return $strReturn;?>