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
@ -56,7 +57,7 @@ class NavigationComponent extends Component
return $sidemenu;
}
public function addUserBookmarks($sidemenu): array
{
$bookmarks = $this->getUserBookmarks();
@ -81,7 +82,7 @@ class NavigationComponent extends Component
}, $bookmarks);
return $links;
}
public function getBreadcrumb(): array
{
$controller = $this->request->getParam('controller');
@ -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;
}
@ -284,7 +286,7 @@ class BreadcrumbFactory
$this->addLink($controller, 'view', $controller, 'edit');
$this->addLink($controller, 'edit', $controller, 'view');
$this->addSelfLink($controller, 'edit');
$this->addAction($controller, 'view', $controller, 'add');
$this->addAction($controller, 'view', $controller, 'delete');
$this->addAction($controller, 'edit', $controller, 'add');