public function makeUrls()
{
if ($this->path) {
$this->parsePath();
}
if ($this->arItems) {
$items = ModelsFactory::getModel('sections')->find($this->arItems)->keyBy('id');
$this->breadcrumbs = '<ol class="breadcrumb">';
$cnt = count($this->arItems);
for ($i = 1; $i <= $cnt; $i++) {
$item = $this->arItems[$i];
if ($item === "") {
continue;
}
$url = '/';
$name = 'Главная';
if ($item > 0) {
$url = $GLOBALS['app']->getContainer()->router->pathFor('page.s' . $item);
$name = $items[$item]->name;
}
$this->breadcrumbs .= '<li><a href="' . $url . '">' . $name . '</a></li>';
}
if (!$this->activeLastItem && $this->addCurrentItem) {
$this->breadcrumbs .= '<li class="active">' . $this->arLastItem['name'] . '</li>';
}
if ($this->activeLastItem && $this->addCurrentItem) {
$this->breadcrumbs .= '<li><a href="' . $this->arLastItem['url'] . '">' . $this->arLastItem['name'] . '</a></li>';
}
$this->breadcrumbs .= '</ol>';
}
$this->isBuild = true;
}