Add UIBlocks to twig

This commit is contained in:
Eric
2021-01-18 15:27:20 +01:00
parent ace0657b7d
commit 79d0b9543a
2 changed files with 8 additions and 8 deletions

View File

@@ -329,20 +329,20 @@ JS
$oTabsBlock = new Panel(Dict::S('UI:Tabs:Preferences'), array(), 'grey', 'ibo-tabs');
$oTabsForm = new Form();
$oTabsForm->AddSubBlock(InputFactory::MakeForHidden('operation', 'apply_tab_config'));
$oTabsForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('operation', 'apply_tab_config'));
$sTabsScrollableValue = appUserPreferences::GetPref('tab_scrollable', false);;
$oTabsScrollable = InputFactory::MakeForSelectWithLabel('tab_scrollable', Dict::S('UI:Tabs:Scrollable:Label'));
$oTabsScrollable->GetInput()->AddOption(InputFactory::MakeForSelectOption('true', Dict::S('UI:Tabs:Scrollable:Scrollable'), true === $sTabsScrollableValue));
$oTabsScrollable->GetInput()->AddOption(InputFactory::MakeForSelectOption('false', Dict::S('UI:Tabs:Scrollable:Classic'), false === $sTabsScrollableValue));
$oTabsScrollable = InputUIBlockFactory::MakeForSelectWithLabel('tab_scrollable', Dict::S('UI:Tabs:Scrollable:Label'));
$oTabsScrollable->GetInput()->AddOption(InputUIBlockFactory::MakeForSelectOption('true', Dict::S('UI:Tabs:Scrollable:Scrollable'), true === $sTabsScrollableValue));
$oTabsScrollable->GetInput()->AddOption(InputUIBlockFactory::MakeForSelectOption('false', Dict::S('UI:Tabs:Scrollable:Classic'), false === $sTabsScrollableValue));
$oTabsForm->AddSubBlock($oTabsScrollable);
// - Cancel button
$oTabsCancelButton = ButtonFactory::MakeForSecondaryAction(Dict::S('UI:Button:Cancel'));
$oTabsCancelButton = ButtonUIBlockFactory::MakeForSecondaryAction(Dict::S('UI:Button:Cancel'));
$oTabsCancelButton->SetOnClickJsCode("window.location.href = '$sURL'");
$oTabsForm->AddSubBlock($oTabsCancelButton);
// - Submit button
$oTabsSubmitButton = ButtonFactory::MakeForPrimaryAction(Dict::S('UI:Button:Apply'), null, null, true);
$oTabsSubmitButton = ButtonUIBlockFactory::MakeForPrimaryAction(Dict::S('UI:Button:Apply'), null, null, true);
$oTabsForm->AddSubBlock($oTabsSubmitButton);
$oTabsBlock->AddSubBlock($oTabsForm);

View File

@@ -208,7 +208,7 @@ EOF
}
}
$oQuerySubmit = ButtonFactory::MakeForPrimaryAction(
$oQuerySubmit = ButtonUIBlockFactory::MakeForPrimaryAction(
Dict::S('UI:Button:Evaluate'),
null,
null,
@@ -323,7 +323,7 @@ EOF
$oSyntaxErrorPanel->AddSubBlock(new Html($sSyntaxErrorText));
$sEscapedExpression = utils::EscapeHtml(addslashes($sFixedExpression));
$oUseSuggestedQueryButton = ButtonFactory::MakeForDestructiveAction('Use this query');
$oUseSuggestedQueryButton = ButtonUIBlockFactory::MakeForDestructiveAction('Use this query');
$oUseSuggestedQueryButton->SetOnClickJsCode(<<<JS
let \$oQueryTextarea = $('textarea[name=expression]');
\$oQueryTextarea.val('$sEscapedExpression').focus();