From cb92560425e7ed49cd31eea8577a30c05717f446 Mon Sep 17 00:00:00 2001 From: nuxsmin Date: Mon, 1 Oct 2018 23:33:09 +0200 Subject: [PATCH] * [FIX] Fixed issue when displaying username on session bar when it isn't available. Closes #1048. Thanks to @vmario89 for the feedback. Signed-off-by: nuxsmin --- app/modules/web/Controllers/ControllerBase.php | 8 ++++---- .../web/Controllers/Helpers/LayoutHelper.php | 9 ++++----- .../material-blue/views/_partials/fixed-header.inc | 14 +++++++------- .../material-blue/views/_partials/footer.inc | 12 ++++++------ .../views/account/account-permissions.inc | 12 ++++++------ .../themes/material-blue/views/config/backup.inc | 4 ++-- .../material-blue/views/config/encryption.inc | 2 +- .../themes/material-blue/views/itemshow/user.inc | 2 +- .../views/notification/notification.inc | 2 +- 9 files changed, 32 insertions(+), 33 deletions(-) diff --git a/app/modules/web/Controllers/ControllerBase.php b/app/modules/web/Controllers/ControllerBase.php index 1f57ba6a..9488520c 100644 --- a/app/modules/web/Controllers/ControllerBase.php +++ b/app/modules/web/Controllers/ControllerBase.php @@ -116,10 +116,10 @@ abstract class ControllerBase { $this->view->assign('timeStart', $this->router->request()->server()->get('REQUEST_TIME_FLOAT')); $this->view->assign('queryTimeStart', microtime()); - $this->view->assign('userId', $this->userData->getId()); - $this->view->assign('userGroupId', $this->userData->getUserGroupId()); - $this->view->assign('userIsAdminApp', $this->userData->getIsAdminApp()); - $this->view->assign('userIsAdminAcc', $this->userData->getIsAdminAcc()); + $this->view->assign('ctx_userId', $this->userData->getId()); + $this->view->assign('ctx_userGroupId', $this->userData->getUserGroupId()); + $this->view->assign('ctx_userIsAdminApp', $this->userData->getIsAdminApp()); + $this->view->assign('ctx_userIsAdminAcc', $this->userData->getIsAdminAcc()); $this->view->assign('themeUri', $this->view->getTheme()->getThemeUri()); $this->view->assign('isDemo', $this->configData->isDemoEnabled()); $this->view->assign('icons', $this->theme->getIcons()); diff --git a/app/modules/web/Controllers/Helpers/LayoutHelper.php b/app/modules/web/Controllers/Helpers/LayoutHelper.php index 6500d522..cec2174b 100644 --- a/app/modules/web/Controllers/Helpers/LayoutHelper.php +++ b/app/modules/web/Controllers/Helpers/LayoutHelper.php @@ -239,11 +239,10 @@ final class LayoutHelper extends HelperBase $userType = $icons->getIconAccAdmin(); } - $this->view->assign('context_userType', $userType); - $this->view->assign('context_userId', $userData->getId()); - $this->view->assign('context_userLogin', mb_strtoupper($userData->getLogin())); - $this->view->assign('context_userName', $userData->getName() ?: mb_strtoupper($this->view->userLogin)); - $this->view->assign('context_userGroup', $userData->getUserGroupName()); + $this->view->assign('ctx_userType', $userType); + $this->view->assign('ctx_userLogin', mb_strtoupper($userData->getLogin())); + $this->view->assign('ctx_userName', $userData->getName() ?: mb_strtoupper($userData->getLogin())); + $this->view->assign('ctx_userGroup', $userData->getUserGroupName()); $this->view->assign('showPassIcon', !($this->configData->isLdapEnabled() && $userData->getIsLdap())); $this->view->assign('notifications', 0); } diff --git a/app/modules/web/themes/material-blue/views/_partials/fixed-header.inc b/app/modules/web/themes/material-blue/views/_partials/fixed-header.inc index 53273448..0dbecfde 100644 --- a/app/modules/web/themes/material-blue/views/_partials/fixed-header.inc +++ b/app/modules/web/themes/material-blue/views/_partials/fixed-header.inc @@ -56,7 +56,7 @@
  • lock @@ -120,7 +120,7 @@ title="" data-onclick="appMgmt/show" data-action-route="user/editPass" - data-item-id="" + data-item-id="" data-sk=""> security @@ -132,14 +132,14 @@ data-onclick="user/showSettings" data-action-route="userSettingsManager/index"> account_circle - + + class="mdl-tooltip mdl-tooltip--top"> - getIcon(); ?> + if ($ctx_userType !== null): ?> + getIcon(); ?> getTitle(); ?> + class="mdl-tooltip mdl-tooltip--top">getTitle(); ?> diff --git a/app/modules/web/themes/material-blue/views/_partials/footer.inc b/app/modules/web/themes/material-blue/views/_partials/footer.inc index ccfc85b0..edc5c164 100644 --- a/app/modules/web/themes/material-blue/views/_partials/footer.inc +++ b/app/modules/web/themes/material-blue/views/_partials/footer.inc @@ -1,18 +1,18 @@
  • - +