chg: [layout:header] Renamed header-breadcrumb

pull/72/head
mokaddem 2021-09-09 13:11:45 +02:00
parent dd62152702
commit d1efe13711
2 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,7 @@
</a> </a>
</div> </div>
<div class="center-navbar"> <div class="center-navbar">
<?= $this->element('layouts/header/header-center'); ?> <?= $this->element('layouts/header/header-breadcrumb'); ?>
</div> </div>
<div class="right-navbar"> <div class="right-navbar">
<?= $this->element('layouts/header/header-right'); ?> <?= $this->element('layouts/header/header-right'); ?>

View File

@ -1,5 +1,6 @@
<?php <?php
use Cake\Core\Configure; use Cake\Core\Configure;
use Cake\Routing\Router;
$controller = $this->request->getParam('controller'); $controller = $this->request->getParam('controller');
$action = $this->request->getParam('action'); $action = $this->request->getParam('action');
@ -30,7 +31,7 @@
if (!empty($entry['url_vars'])) { if (!empty($entry['url_vars'])) {
$entry['url'] = $this->DataFromPath->buildStringFromDataPath($entry['url'], $entity, $entry['url_vars']); $entry['url'] = $this->DataFromPath->buildStringFromDataPath($entry['url'], $entity, $entry['url_vars']);
} }
$this->Breadcrumbs->add($entry['label'], $entry['url']); $this->Breadcrumbs->add($entry['label'], Router::url($entry['url']));
} }
$lastCrumb = $breadcrumb[count($breadcrumb)-1]; $lastCrumb = $breadcrumb[count($breadcrumb)-1];
@ -46,7 +47,7 @@
} }
$breadcrumbLinks .= sprintf('<a class="btn btn-%s btn-sm text-nowrap" role="button" href="%s">%s</a>', $breadcrumbLinks .= sprintf('<a class="btn btn-%s btn-sm text-nowrap" role="button" href="%s">%s</a>',
$active ? 'secondary' : $navbarVariant, $active ? 'secondary' : $navbarVariant,
$linkEntry['url'], Router::url($linkEntry['url']),
$linkEntry['label'] $linkEntry['label']
); );
} }
@ -56,7 +57,7 @@
if (!empty($actionEntry['url_vars'])) { if (!empty($actionEntry['url_vars'])) {
$actionEntry['url'] = $this->DataFromPath->buildStringFromDataPath($actionEntry['url'], $entity, $actionEntry['url_vars']); $actionEntry['url'] = $this->DataFromPath->buildStringFromDataPath($actionEntry['url'], $entity, $actionEntry['url_vars']);
} }
$breadcrumbAction .= sprintf('<a class="dropdown-item" href="%s">%s</a>', $actionEntry['url'], $actionEntry['label']); $breadcrumbAction .= sprintf('<a class="dropdown-item" href="%s">%s</a>', Router::url($actionEntry['url']), $actionEntry['label']);
} }
} }
} }