From be311400c9f72b2f55a46be1bb4b40ce62151211 Mon Sep 17 00:00:00 2001 From: ryuring Date: Mon, 9 Oct 2023 17:50:03 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A6=E3=83=8B=E3=83=83=E3=83=88=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/baser-core/src/View/Helper/BcAuthHelper.php | 10 ++++------ .../tests/TestCase/View/Helper/BcToolbarHelperTest.php | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/baser-core/src/View/Helper/BcAuthHelper.php b/plugins/baser-core/src/View/Helper/BcAuthHelper.php index 207a0fe83b..33dc5feaa8 100644 --- a/plugins/baser-core/src/View/Helper/BcAuthHelper.php +++ b/plugins/baser-core/src/View/Helper/BcAuthHelper.php @@ -38,7 +38,7 @@ class BcAuthHelper extends Helper * Helper * @var array */ - public $helpers = ['BcBaser']; + public $helpers = ['BaserCore.BcBaser']; /** * 現在認証プレフィックスを取得する @@ -163,13 +163,11 @@ public function getCurrentName() { $currentPrefixSetting = $this->getCurrentPrefixSetting(); if (!empty($currentPrefixSetting['name']) && $this->getCurrentPrefix() !== 'Front') { - $name = $currentPrefixSetting['name']; - } elseif (isset($this->BcBaser->siteConfig['formal_name'])) { - $name = $this->BcBaser->siteConfig['formal_name']; + return $currentPrefixSetting['name']; } else { - $name = ''; + $siteName = $this->BcBaser->getSiteName(); + return $siteName ? $siteName : ''; } - return $name; } /** diff --git a/plugins/baser-core/tests/TestCase/View/Helper/BcToolbarHelperTest.php b/plugins/baser-core/tests/TestCase/View/Helper/BcToolbarHelperTest.php index d371cecaf8..1f35e4f75a 100644 --- a/plugins/baser-core/tests/TestCase/View/Helper/BcToolbarHelperTest.php +++ b/plugins/baser-core/tests/TestCase/View/Helper/BcToolbarHelperTest.php @@ -319,7 +319,7 @@ public function testGetLogoLink() public function testGetLogoText() { // フロントで管理画面利用不可 - $this->assertEquals('baserCMS', $this->BcToolbar->getLogoText()); + $this->assertEquals('メインサイト', $this->BcToolbar->getLogoText()); // フロントで管理画面利用可能 $this->loginAdmin($this->getRequest('/baser/admin')); $this->assertEquals('ダッシュボード', $this->BcToolbar->getLogoText()); @@ -342,7 +342,7 @@ public function testGetLogoLinkOptions() { // フロントで管理画面利用不可 $this->assertEquals([ - 'title' => 'baserCMS', + 'title' => 'メインサイト', 'class' => 'bca-toolbar__logo-link', 'escapeTitle' => false ], $this->BcToolbar->getLogoLinkOptions());