chg: [navigation:users] Restored breadcrumb navigation to access user profile settings

cli-modification-summary
Sami Mokaddem 2022-01-27 08:41:31 +01:00
parent 2e7aabf704
commit 789bd9926f
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 12 additions and 15 deletions

View File

@ -25,20 +25,17 @@ class UsersNavigation extends BaseNavigation
$request = $this->request;
$passedData = $this->request->getParam('pass');
$currentUser = $this->currentUser;
$ownUser = (!empty($passedData[0]) && $passedData[0] === $currentUser['id']);
if ($ownUser) {
$this->bcf->addLink('Users', 'view', 'UserSettings', 'index', function ($config) use ($bcf, $request, $passedData, $currentUser) {
if (!empty($passedData[0])) {
$user_id = $passedData[0];
$linkData = [
'label' => __('Account settings', h($user_id)),
'url' => sprintf('/users/settings/%s', h($user_id))
];
return $linkData;
}
return [];
});
}
$this->bcf->addLink('Users', 'view', 'UserSettings', 'index', function ($config) use ($bcf, $request, $passedData, $currentUser) {
if (!empty($passedData[0])) {
$user_id = $passedData[0];
$linkData = [
'label' => __('Account settings', h($user_id)),
'url' => sprintf('/users/settings/%s', h($user_id))
];
return $linkData;
}
return [];
});
$this->bcf->addLink('Users', 'view', 'UserSettings', 'index', function ($config) use ($bcf, $request, $passedData) {
if (!empty($passedData[0])) {
$user_id = $passedData[0];

View File

@ -52,7 +52,7 @@ if(!empty($editingAnotherUser)) {
<?php if (!empty($editingAnotherUser)): ?>
<?=
$this->Bootstrap->alert([
'text' => __('Currently editing the account setting of another user.'),
'text' => __('Currently editing the account settings of another user.'),
'variant' => 'warning',
'dismissible' => false
])