From 9a5e86caead8e2fab9fcc6a5a61df11ed60efa10 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Thu, 14 Jan 2021 10:06:47 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03617=20User=20pref=20keys=20:=20add=20pr?= =?UTF-8?q?efix=20and=20normalize=20naming=204=20keys=20existing=20:=20*?= =?UTF-8?q?=20notification=20help=20message=20=3D>=20UI-Collapsible=5F=5Fn?= =?UTF-8?q?otifications=5F=5Fhome=20*=20run=5Fquery=20"more=20info"=20sect?= =?UTF-8?q?ion=20=3D>=20UI-Collapsible=5F=5Frun=5Fquery=5F=5Fmore-info=20*?= =?UTF-8?q?=20RenderAllUiBlocks=20test=20page=20alert=20and=20section=20ex?= =?UTF-8?q?amples=20=3D>=20UI-Collapsible=5F=5FRenderAllUiBlocks=5F=5Faler?= =?UTF-8?q?t=20and=20UI-Collapsible=5F=5FRenderAllUiBlocks=5F=5Fsection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/notifications.php | 2 +- sources/application/UI/Base/Component/Alert/Alert.php | 2 +- .../Base/Component/CollapsibleSection/CollapsibleSection.php | 2 +- test/VisualTest/Backoffice/RenderAllUiBlocks.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/notifications.php b/pages/notifications.php index 0ae36cb9a..ef4102ce9 100644 --- a/pages/notifications.php +++ b/pages/notifications.php @@ -44,7 +44,7 @@ $sAlertContent = Dict::S('UI:NotificationsMenu:HelpContent'); $oConfigurationHelp = new CollapsibleSection($sAlertTitle, [new Html($sAlertContent)]); $oConfigurationHelp ->SetOpenedByDefault(true) - ->EnableSaveCollapsibleState('notifications-home'); + ->EnableSaveCollapsibleState('notifications__home'); $oPageContentLayout->AddMainBlock($oConfigurationHelp); $oP->AddTabContainer('Tabs_0'); diff --git a/sources/application/UI/Base/Component/Alert/Alert.php b/sources/application/UI/Base/Component/Alert/Alert.php index 3017753f4..c61963498 100644 --- a/sources/application/UI/Base/Component/Alert/Alert.php +++ b/sources/application/UI/Base/Component/Alert/Alert.php @@ -128,7 +128,7 @@ class Alert extends UIBlock public function EnableSaveCollapsibleState($sSectionStateStorageKey) { $this->bIsSaveCollapsibleStateEnabled = true; - $this->sSectionStateStorageKey = $sSectionStateStorageKey; + $this->sSectionStateStorageKey = 'UI-Collapsible__'.$sSectionStateStorageKey; return $this; } diff --git a/sources/application/UI/Base/Component/CollapsibleSection/CollapsibleSection.php b/sources/application/UI/Base/Component/CollapsibleSection/CollapsibleSection.php index 56be2a168..30cbe6f34 100644 --- a/sources/application/UI/Base/Component/CollapsibleSection/CollapsibleSection.php +++ b/sources/application/UI/Base/Component/CollapsibleSection/CollapsibleSection.php @@ -63,7 +63,7 @@ class CollapsibleSection extends UIContentBlock public function EnableSaveCollapsibleState($sSectionStateStorageKey) { $this->bIsSaveCollapsibleStateEnabled = true; - $this->sSectionStateStorageKey = $sSectionStateStorageKey; + $this->sSectionStateStorageKey = 'UI-Collapsible__'.$sSectionStateStorageKey; return $this; } diff --git a/test/VisualTest/Backoffice/RenderAllUiBlocks.php b/test/VisualTest/Backoffice/RenderAllUiBlocks.php index 84e36889f..87ffc5dbc 100644 --- a/test/VisualTest/Backoffice/RenderAllUiBlocks.php +++ b/test/VisualTest/Backoffice/RenderAllUiBlocks.php @@ -86,7 +86,7 @@ $oAlertNonClosable = AlertFactory::MakeNeutral('Alert not closable, not collapsa ->SetIsCollapsible(false); $oPageContentLayout->AddMainBlock($oAlertNonClosable); $oAlertSaveCollapsibleState = AlertFactory::MakeNeutral('Alert with collapsible state saving', $sContent) - ->EnableSaveCollapsibleState('RenderAllUiBlocks-alert'); + ->EnableSaveCollapsibleState('RenderAllUiBlocks__alert'); $oPageContentLayout->AddMainBlock($oAlertSaveCollapsibleState); $oPageContentLayout->AddMainBlock(new Html('
')); @@ -178,7 +178,7 @@ $oCollapsibleSection = new CollapsibleSection('Section title', [new Html($sSecti $oPage->AddUiBlock($oCollapsibleSection); $oCollapsibleSectionSaveState = new CollapsibleSection('Section save state', [new Html($sSectionContent)]); -$oCollapsibleSectionSaveState->EnableSaveCollapsibleState('RenderAllUiBlocks-collapsible-section'); +$oCollapsibleSectionSaveState->EnableSaveCollapsibleState('RenderAllUiBlocks__section'); $oPage->AddUiBlock($oCollapsibleSectionSaveState); $oPage->output();