chg: [Navigationcomponent] added missing changes from previous commit

cli-modification-summary
iglocska 2022-01-26 14:55:47 +01:00
parent 4b5bccae28
commit b7facf226d
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 9 additions and 7 deletions

View File

@ -17,8 +17,9 @@ require_once(APP . 'Controller' . DS . 'Component' . DS . 'Navigation' . DS . 's
class NavigationComponent extends Component
{
private $user = null;
private $currentUser = null;
public $breadcrumb = null;
public $fullBreadcrumb = null;
public $iconToTableMapping = [
'Individuals' => 'address-book',
'Organisations' => 'building',
@ -42,10 +43,10 @@ class NavigationComponent extends Component
$this->request = $config['request'];
}
public function beforeFilter($event)
public function genBreadcrumbs(\App\Model\Entity\User $user)
{
$this->fullBreadcrumb = $this->genBreadcrumb();
$this->breadcrumb = $this->getBreadcrumb();
$this->currentUser = $user;
$this->breadcrumb = $this->fullBreadcrumb = $this->genBreadcrumb();
}
public function getSideMenu(): array
@ -141,6 +142,7 @@ class NavigationComponent extends Component
require_once(APP . 'Controller' . DS . 'Component' . DS . 'Navigation' . DS . $navigationFile);
$reflection = new \ReflectionClass("BreadcrumbNavigation\\{$navigationClassname}Navigation");
$navigationClasses[$navigationClassname] = $reflection->newInstance($bcf, $request);
$navigationClasses[$navigationClassname]->setCurrentUser($this->currentUser);
}
return $navigationClasses;
}