N°3617 User pref keys : add prefix and normalize naming

4 keys existing :
* notification help message => UI-Collapsible__notifications__home
* run_query "more info" section => UI-Collapsible__run_query__more-info
* RenderAllUiBlocks test page alert and section examples => UI-Collapsible__RenderAllUiBlocks__alert and UI-Collapsible__RenderAllUiBlocks__section
This commit is contained in:
Pierre Goiffon
2021-01-14 10:06:47 +01:00
parent 8df2f96dfe
commit 9a5e86caea
4 changed files with 5 additions and 5 deletions

View File

@@ -44,7 +44,7 @@ $sAlertContent = Dict::S('UI:NotificationsMenu:HelpContent');
$oConfigurationHelp = new CollapsibleSection($sAlertTitle, [new Html($sAlertContent)]); $oConfigurationHelp = new CollapsibleSection($sAlertTitle, [new Html($sAlertContent)]);
$oConfigurationHelp $oConfigurationHelp
->SetOpenedByDefault(true) ->SetOpenedByDefault(true)
->EnableSaveCollapsibleState('notifications-home'); ->EnableSaveCollapsibleState('notifications__home');
$oPageContentLayout->AddMainBlock($oConfigurationHelp); $oPageContentLayout->AddMainBlock($oConfigurationHelp);
$oP->AddTabContainer('Tabs_0'); $oP->AddTabContainer('Tabs_0');

View File

@@ -128,7 +128,7 @@ class Alert extends UIBlock
public function EnableSaveCollapsibleState($sSectionStateStorageKey) public function EnableSaveCollapsibleState($sSectionStateStorageKey)
{ {
$this->bIsSaveCollapsibleStateEnabled = true; $this->bIsSaveCollapsibleStateEnabled = true;
$this->sSectionStateStorageKey = $sSectionStateStorageKey; $this->sSectionStateStorageKey = 'UI-Collapsible__'.$sSectionStateStorageKey;
return $this; return $this;
} }

View File

@@ -63,7 +63,7 @@ class CollapsibleSection extends UIContentBlock
public function EnableSaveCollapsibleState($sSectionStateStorageKey) public function EnableSaveCollapsibleState($sSectionStateStorageKey)
{ {
$this->bIsSaveCollapsibleStateEnabled = true; $this->bIsSaveCollapsibleStateEnabled = true;
$this->sSectionStateStorageKey = $sSectionStateStorageKey; $this->sSectionStateStorageKey = 'UI-Collapsible__'.$sSectionStateStorageKey;
return $this; return $this;
} }

View File

@@ -86,7 +86,7 @@ $oAlertNonClosable = AlertFactory::MakeNeutral('Alert not closable, not collapsa
->SetIsCollapsible(false); ->SetIsCollapsible(false);
$oPageContentLayout->AddMainBlock($oAlertNonClosable); $oPageContentLayout->AddMainBlock($oAlertNonClosable);
$oAlertSaveCollapsibleState = AlertFactory::MakeNeutral('Alert with collapsible state saving', $sContent) $oAlertSaveCollapsibleState = AlertFactory::MakeNeutral('Alert with collapsible state saving', $sContent)
->EnableSaveCollapsibleState('RenderAllUiBlocks-alert'); ->EnableSaveCollapsibleState('RenderAllUiBlocks__alert');
$oPageContentLayout->AddMainBlock($oAlertSaveCollapsibleState); $oPageContentLayout->AddMainBlock($oAlertSaveCollapsibleState);
$oPageContentLayout->AddMainBlock(new Html('<hr/>')); $oPageContentLayout->AddMainBlock(new Html('<hr/>'));
@@ -178,7 +178,7 @@ $oCollapsibleSection = new CollapsibleSection('Section title', [new Html($sSecti
$oPage->AddUiBlock($oCollapsibleSection); $oPage->AddUiBlock($oCollapsibleSection);
$oCollapsibleSectionSaveState = new CollapsibleSection('Section save state', [new Html($sSectionContent)]); $oCollapsibleSectionSaveState = new CollapsibleSection('Section save state', [new Html($sSectionContent)]);
$oCollapsibleSectionSaveState->EnableSaveCollapsibleState('RenderAllUiBlocks-collapsible-section'); $oCollapsibleSectionSaveState->EnableSaveCollapsibleState('RenderAllUiBlocks__section');
$oPage->AddUiBlock($oCollapsibleSectionSaveState); $oPage->AddUiBlock($oCollapsibleSectionSaveState);
$oPage->output(); $oPage->output();