From 21740123f47a2326f2aea712a24d0a9c4436cc5e Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 18 Jan 2021 12:09:07 +0100 Subject: [PATCH] Add UIBlocks to twig (generic parser and node) # Conflicts: # pages/run_query.php # test/VisualTest/Backoffice/RenderAllUiBlocks.php --- application/applicationcontext.class.inc.php | 4 +- application/cmdbabstract.class.inc.php | 86 ++++++------ application/dashboard.class.inc.php | 4 +- application/displayblock.class.inc.php | 131 +++++++++++------- application/menunode.class.inc.php | 6 +- application/ui.linkswidget.class.inc.php | 4 +- datamodels/2.x/itop-config/config.php | 38 ++--- .../view/SelectUpdateFile.html.twig | 57 ++++---- lib/composer/autoload_classmap.php | 36 ++--- lib/composer/autoload_static.php | 36 ++--- pages/UI.php | 18 +-- pages/preferences.php | 57 ++++---- pages/run_query.php | 6 +- sources/Controller/AjaxRenderController.php | 4 +- .../TwigBase/Controller/Controller.php | 1 + .../UI/Component/Alert/UIAlertNode.php | 72 ---------- .../UI/Component/Alert/UIAlertParser.php | 50 ------- .../Component/DataTable/UIDataTableNode.php | 48 ------- .../Component/DataTable/UIDataTableParser.php | 41 ------ .../UI/Component/Field/UIFieldNode.php | 57 -------- .../UI/Component/Field/UIFieldParser.php | 50 ------- .../UI/Component/FieldSet/UIFieldSetNode.php | 39 ------ .../Component/FieldSet/UIFieldSetParser.php | 47 ------- .../TwigBase/UI/Component/Form/UIFormNode.php | 39 ------ .../UI/Component/Form/UIFormParser.php | 47 ------- .../TwigBase/UI/Component/Html/UIHtmlNode.php | 3 +- .../UI/Component/Input/UIInputNode.php | 65 --------- .../UI/Component/Input/UIInputParser.php | 43 ------ .../UI/Component/Title/UITitleNode.php | 50 ------- .../UI/Component/Title/UITitleParser.php | 41 ------ .../TwigBase/UI/Layout/UIContentBlockNode.php | 40 ------ .../UI/Layout/UIContentBlockParser.php | 47 ------- .../TwigBase/UI/UIBlockExtension.php | 47 ++++--- .../application/TwigBase/UI/UIBlockHelper.php | 37 ----- .../application/TwigBase/UI/UIBlockNode.php | 114 +++++++++++++++ .../application/TwigBase/UI/UIBlockParser.php | 77 ++++++++++ .../UI/Base/AbstractUIBlockFactory.php | 25 ++++ ...ertFactory.php => AlertUIBlockFactory.php} | 25 ++-- ...onFactory.php => ButtonUIBlockFactory.php} | 15 +- ...actory.php => DataTableUIBlockFactory.php} | 17 ++- ...eldFactory.php => FieldUIBlockFactory.php} | 12 +- .../Base/Component/FieldBadge/FieldBadge.php | 4 +- .../FieldSet/FieldSetUIBlockFactory.php | 22 +++ .../UI/Base/Component/Form/Form.php | 4 +- .../Component/Form/FormUIBlockFactory.php | 22 +++ ...putFactory.php => InputUIBlockFactory.php} | 5 +- ...tleFactory.php => TitleUIBlockFactory.php} | 5 +- .../CaseLogEntryForm/CaseLogEntryForm.php | 6 +- .../CaseLogEntryFormFactory.php | 6 +- .../Base/Layout/TabContainer/TabContainer.php | 10 +- .../UI/Base/Layout/UIContentBlock.php | 6 +- .../Layout/UIContentBlockUIBlockFactory.php | 22 +++ .../application/UI/Base/iUIBlockFactory.php | 16 +++ .../BlockIndirectLinksEdit.php | 10 +- .../BlockObjectPickerDialog.php | 10 +- sources/application/WebPage/WebPage.php | 4 +- sources/application/WebPage/iTopWebPage.php | 17 ++- .../search/searchform.class.inc.php | 17 +-- .../Backoffice/RenderAllUiBlocks.php | 72 +++++----- 59 files changed, 712 insertions(+), 1182 deletions(-) delete mode 100644 sources/application/TwigBase/UI/Component/Alert/UIAlertNode.php delete mode 100644 sources/application/TwigBase/UI/Component/Alert/UIAlertParser.php delete mode 100644 sources/application/TwigBase/UI/Component/DataTable/UIDataTableNode.php delete mode 100644 sources/application/TwigBase/UI/Component/DataTable/UIDataTableParser.php delete mode 100644 sources/application/TwigBase/UI/Component/Field/UIFieldNode.php delete mode 100644 sources/application/TwigBase/UI/Component/Field/UIFieldParser.php delete mode 100644 sources/application/TwigBase/UI/Component/FieldSet/UIFieldSetNode.php delete mode 100644 sources/application/TwigBase/UI/Component/FieldSet/UIFieldSetParser.php delete mode 100644 sources/application/TwigBase/UI/Component/Form/UIFormNode.php delete mode 100644 sources/application/TwigBase/UI/Component/Form/UIFormParser.php delete mode 100644 sources/application/TwigBase/UI/Component/Input/UIInputNode.php delete mode 100644 sources/application/TwigBase/UI/Component/Input/UIInputParser.php delete mode 100644 sources/application/TwigBase/UI/Component/Title/UITitleNode.php delete mode 100644 sources/application/TwigBase/UI/Component/Title/UITitleParser.php delete mode 100644 sources/application/TwigBase/UI/Layout/UIContentBlockNode.php delete mode 100644 sources/application/TwigBase/UI/Layout/UIContentBlockParser.php delete mode 100644 sources/application/TwigBase/UI/UIBlockHelper.php create mode 100644 sources/application/TwigBase/UI/UIBlockNode.php create mode 100644 sources/application/TwigBase/UI/UIBlockParser.php create mode 100644 sources/application/UI/Base/AbstractUIBlockFactory.php rename sources/application/UI/Base/Component/Alert/{AlertFactory.php => AlertUIBlockFactory.php} (79%) rename sources/application/UI/Base/Component/Button/{ButtonFactory.php => ButtonUIBlockFactory.php} (97%) rename sources/application/UI/Base/Component/DataTable/{DataTableFactory.php => DataTableUIBlockFactory.php} (97%) rename sources/application/UI/Base/Component/Field/{FieldFactory.php => FieldUIBlockFactory.php} (82%) create mode 100644 sources/application/UI/Base/Component/FieldSet/FieldSetUIBlockFactory.php create mode 100644 sources/application/UI/Base/Component/Form/FormUIBlockFactory.php rename sources/application/UI/Base/Component/Input/{InputFactory.php => InputUIBlockFactory.php} (91%) rename sources/application/UI/Base/Component/Title/{TitleFactory.php => TitleUIBlockFactory.php} (89%) create mode 100644 sources/application/UI/Base/Layout/UIContentBlockUIBlockFactory.php create mode 100644 sources/application/UI/Base/iUIBlockFactory.php diff --git a/application/applicationcontext.class.inc.php b/application/applicationcontext.class.inc.php index a39014ffc..2d0dc1439 100644 --- a/application/applicationcontext.class.inc.php +++ b/application/applicationcontext.class.inc.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ -use Combodo\iTop\Application\UI\Base\Component\Input\InputFactory; +use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory; use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock; use Combodo\iTop\Application\UI\Base\UIBlock; @@ -236,7 +236,7 @@ class ApplicationContext { $oContext = new UIContentBlock(); foreach ($this->aValues as $sName => $sValue) { - $oContext->AddSubBlock(InputFactory::MakeForHidden('c[$sName]', utils::HtmlEntities($sValue))); + $oContext->AddSubBlock(InputUIBlockFactory::MakeForHidden('c[$sName]', utils::HtmlEntities($sValue))); } return $oContext; } diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 881487953..25eea15d7 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -18,18 +18,18 @@ */ use Combodo\iTop\Application\Search\SearchForm; -use Combodo\iTop\Application\UI\Base\Component\Alert\AlertFactory; +use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Button\Button; -use Combodo\iTop\Application\UI\Base\Component\Button\ButtonFactory; -use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableFactory; +use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings; +use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Field\Field; -use Combodo\iTop\Application\UI\Base\Component\Field\FieldFactory; +use Combodo\iTop\Application\UI\Base\Component\Field\FieldUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSet; use Combodo\iTop\Application\UI\Base\Component\Form\Form; -use Combodo\iTop\Application\UI\Base\Component\Input\InputFactory; +use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Panel\Panel; -use Combodo\iTop\Application\UI\Base\Component\Title\TitleFactory; +use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Toolbar\Toolbar; use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\Column; use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumn; @@ -268,7 +268,7 @@ EOF $sName .= ' ('.$aLockInfo['owner']->Get('contactid_friendlyname').')'; } $aResult['message'] = Dict::Format('UI:CurrentObjectIsLockedBy_User', $sName); - $aMessages[] = AlertFactory::MakeForDanger('', Dict::Format('UI:CurrentObjectIsLockedBy_User', $sName)); + $aMessages[] = AlertUIBlockFactory::MakeForDanger('', Dict::Format('UI:CurrentObjectIsLockedBy_User', $sName)); } } $sMessageKey = get_class($this).'::'.$this->GetKey(); @@ -281,16 +281,16 @@ EOF $aRanks[] = $aMessageData['rank']; switch ($aMessageData['severity']) { case 'info': - $aMessages[] = AlertFactory::MakeForInformation('', $aMessageData['message']); + $aMessages[] = AlertUIBlockFactory::MakeForInformation('', $aMessageData['message']); break; case 'ok': - $aMessages[] = AlertFactory::MakeForSuccess('', $aMessageData['message']); + $aMessages[] = AlertUIBlockFactory::MakeForSuccess('', $aMessageData['message']); break; case 'warning': - $aMessages[] = AlertFactory::MakeForWarning('', $aMessageData['message']); + $aMessages[] = AlertUIBlockFactory::MakeForWarning('', $aMessageData['message']); break; case 'error': - $aMessages[] = AlertFactory::MakeForDanger('', $aMessageData['message']); + $aMessages[] = AlertUIBlockFactory::MakeForDanger('', $aMessageData['message']); break; } } @@ -424,7 +424,7 @@ EOF // $sTags = ''; // } - $oPage->AddUiBlock(TitleFactory::MakeForObjectDetails($this)); + $oPage->AddUiBlock(TitleUIBlockFactory::MakeForObjectDetails($this)); } /** @@ -973,7 +973,7 @@ EOF $val['value_raw'] = ($bExcludeRawValue === false) ? $this->Get($sAttCode) : ''; // The field is visible, add it to the current column - $oField = FieldFactory::MakeFromParams($val); + $oField = FieldUIBlockFactory::MakeFromParams($val); if ($sFieldsetName[0] != '_') { $oFieldSet->AddSubBlock($oField); } else { @@ -1140,7 +1140,7 @@ HTML $iListId = $aExtraParams['currentId']; } - return DataTableFactory::MakeForResult($oPage, $iListId, $oSet, $aExtraParams); + return DataTableUIBlockFactory::MakeForResult($oPage, $iListId, $oSet, $aExtraParams); } /** * @param \WebPage $oPage @@ -1886,7 +1886,7 @@ HTML // predefined queries N°3227 $sPredefinedBtnId = 'predef_btn_'.$sFieldPrefix.$sAttCode.$sNameSuffix; $sSearchQueryLbl = Dict::S('UI:Edit:SearchQuery'); - $oPredefQueryButton = ButtonFactory::MakeIconLink( + $oPredefQueryButton = ButtonUIBlockFactory::MakeIconLink( 'fas fa-search', $sSearchQueryLbl, null, @@ -1926,7 +1926,7 @@ JS $sTestResId = 'query_res_'.$sFieldPrefix.$sAttCode.$sNameSuffix; //$oPage->GetUniqueId(); $sBaseUrl = utils::GetAbsoluteUrlAppRoot().'pages/run_query.php?expression='; $sTestQueryLbl = Dict::S('UI:Edit:TestQuery'); - $oTestQueryButton = ButtonFactory::MakeIconLink( + $oTestQueryButton = ButtonUIBlockFactory::MakeIconLink( 'fas fa-play', $sTestQueryLbl, null, @@ -2489,7 +2489,7 @@ JS $oPage->set_title(Dict::Format('UI:ModificationPageTitle_Object_Class', $this->GetRawName(), $sClassLabel)); // Set title will take care of the encoding - //$oContentBlock->AddSubBlock(TitleFactory::MakeForObjectDetails($this)); + //$oContentBlock->AddSubBlock(TitleUIBlockFactory::MakeForObjectDetails($this)); // $oPage->add(<< @@ -2551,15 +2551,15 @@ JS if ($sMode === static::ENUM_OBJECT_MODE_EDIT) { // The object already exists in the database, it's a modification - $oForm->AddSubBlock(InputFactory::MakeForHidden('id', $iKey, "{$sPrefix}_id")); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('id', $iKey, "{$sPrefix}_id")); } - $oForm->AddSubBlock(InputFactory::MakeForHidden('operation', $sOperation)); - $oForm->AddSubBlock(InputFactory::MakeForHidden('class', $sClass)); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('operation', $sOperation)); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('class', $sClass)); // Add transaction ID $iTransactionId = isset($aExtraParams['transaction_id']) ? $aExtraParams['transaction_id'] : utils::GetNewTransactionId(); $oPage->SetTransactionId($iTransactionId); - $oForm->AddSubBlock(InputFactory::MakeForHidden('transaction_id', $iTransactionId)); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('transaction_id', $iTransactionId)); // TODO 3.0.0: Is this (the if condition, not the code inside) still necessary? if (isset($aExtraParams['wizard_container']) && $aExtraParams['wizard_container']) { @@ -2570,7 +2570,7 @@ JS $oPage->set_title(Dict::Format('UI:ModificationPageTitle_Object_Class', $this->GetRawName(), $sClassLabel)); // Set title will take care of the encoding - $oForm->AddSubBlock(TitleFactory::MakeForObjectDetails($this)); + $oForm->AddSubBlock(TitleUIBlockFactory::MakeForObjectDetails($this)); // TODO 3.0.0: Refactor DisplayBareHeader and call it here } @@ -2589,10 +2589,10 @@ CSS $oToolbarTop = new Toolbar(); $oToolbarTop->SetCSSClasses('ibo-toolbar ibo-toolbar-top'); - $oCancelButton = ButtonFactory::MakeForSecondaryAction(Dict::S('UI:Button:Cancel')); + $oCancelButton = ButtonUIBlockFactory::MakeForSecondaryAction(Dict::S('UI:Button:Cancel')); $oCancelButton->AddCSSClasses('action cancel'); $oToolbarTop->AddSubBlock($oCancelButton); - $oApplyButton = ButtonFactory::MakeForPrimaryAction($sApplyButton, null, null, true); + $oApplyButton = ButtonUIBlockFactory::MakeForPrimaryAction($sApplyButton, null, null, true); $oApplyButton->AddCSSClasses('action'); $oToolbarTop->AddSubBlock($oApplyButton); @@ -2606,7 +2606,7 @@ CSS $sStimulusCode, $oSetToCheckRights) : UR_ALLOWED_NO; switch ($iActionAllowed) { case UR_ALLOWED_YES: - $oButton = ButtonFactory::MakeForPrimaryAction($aStimuli[$sStimulusCode]->GetLabel(), 'next_action', $sStimulusCode, true); + $oButton = ButtonUIBlockFactory::MakeForPrimaryAction($aStimuli[$sStimulusCode]->GetLabel(), 'next_action', $sStimulusCode, true); $oButton->AddCSSClasses('action'); $oButton->SetColor(Button::ENUM_COLOR_NEUTRAL); $oToolbarTop->AddSubBlock($oButton); @@ -2699,15 +2699,15 @@ EOF } $oPage->SetCurrentTab(''); - $oForm->AddSubBlock(InputFactory::MakeForHidden('class', $sClass)); - $oForm->AddSubBlock(InputFactory::MakeForHidden('transaction_id', $iTransactionId)); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('class', $sClass)); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('transaction_id', $iTransactionId)); foreach ($aExtraParams as $sName => $value) { if (is_scalar($value)) { - $oForm->AddSubBlock(InputFactory::MakeForHidden($sName, $value)); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden($sName, $value)); } } if ($sOwnershipToken !== null) { - $oForm->AddSubBlock(InputFactory::MakeForHidden('ownership_token', utils::HtmlEntities($sOwnershipToken))); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('ownership_token', utils::HtmlEntities($sOwnershipToken))); } $oPage->add($oAppContext->GetForForm()); if ($sButtonsPosition != 'top') { @@ -3035,15 +3035,14 @@ HTML ); // Page title and subtitles - $oPage->AddUiBlock(TitleFactory::MakeForPage($sActionLabel.' - '.$this->GetName())); - if(!empty($sActionDetails)) { - $oPage->AddUiBlock(TitleFactory::MakeForPage($sActionDetails)); + $oPage->AddUiBlock(TitleUIBlockFactory::MakeForPage($sActionLabel.' - '.$this->GetName())); + if (!empty($sActionDetails)) { + $oPage->AddUiBlock(TitleUIBlockFactory::MakeForPage($sActionDetails)); } $sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position'); // Display object detail above if buttons must be displayed on the bottom - if ($sButtonsPosition == 'bottom' && $bDisplayBareProperties) - { + if ($sButtonsPosition == 'bottom' && $bDisplayBareProperties) { // bottom: Displays the ticket details BEFORE the actions $this->DisplayDetails($oPage, false, $sMode); } @@ -3054,15 +3053,14 @@ HTML $oFormContainer->AddSubBlock($oForm); $oForm->SetOnSubmitJsCode("return OnSubmit('apply_stimulus');") - ->AddSubBlock(InputFactory::MakeForHidden('id', $this->GetKey(), 'id')) - ->AddSubBlock(InputFactory::MakeForHidden('class', $sClass)) - ->AddSubBlock(InputFactory::MakeForHidden('operation', 'apply_stimulus')) - ->AddSubBlock(InputFactory::MakeForHidden('stimulus', $sStimulus)) - ->AddSubBlock(InputFactory::MakeForHidden('transaction_id', $iTransactionId)); + ->AddSubBlock(InputUIBlockFactory::MakeForHidden('id', $this->GetKey(), 'id')) + ->AddSubBlock(InputUIBlockFactory::MakeForHidden('class', $sClass)) + ->AddSubBlock(InputUIBlockFactory::MakeForHidden('operation', 'apply_stimulus')) + ->AddSubBlock(InputUIBlockFactory::MakeForHidden('stimulus', $sStimulus)) + ->AddSubBlock(InputUIBlockFactory::MakeForHidden('transaction_id', $iTransactionId)); - if ($sOwnershipToken !== null) - { - $oForm->AddSubBlock(InputFactory::MakeForHidden('ownership_token', utils::HtmlEntities($sOwnershipToken))); + if ($sOwnershipToken !== null) { + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('ownership_token', utils::HtmlEntities($sOwnershipToken))); } // Note: Remove the table is we want fields to occupy the whole width of the container @@ -3073,11 +3071,11 @@ HTML $oAppContext = new ApplicationContext(); $oForm->AddHtml($oAppContext->GetForForm()); - $oCancelButton = ButtonFactory::MakeForSecondaryAction(Dict::S('UI:Button:Cancel'), 'cancel', 'cancel'); + $oCancelButton = ButtonUIBlockFactory::MakeForSecondaryAction(Dict::S('UI:Button:Cancel'), 'cancel', 'cancel'); $oCancelButton->SetOnClickJsCode("BackToDetails('{$sClass}', '{$this->GetKey()}', '', '{$sOwnershipToken}');"); $oForm->AddSubBlock($oCancelButton); - $oSubmitButton = ButtonFactory::MakeForPrimaryAction($sActionLabel, 'submit', 'submit', true); + $oSubmitButton = ButtonUIBlockFactory::MakeForPrimaryAction($sActionLabel, 'submit', 'submit', true); $oForm->AddSubBlock($oSubmitButton); $oPage->add(<<GetTopBarLayout()->GetToolbar(); - $oActionButton = ButtonFactory::MakeLinkNeutral('', '', 'fas fa-ellipsis-v', $sName, '', $sMenuTogglerId); + $oActionButton = ButtonUIBlockFactory::MakeLinkNeutral('', '', 'fas fa-ellipsis-v', $sName, '', $sMenuTogglerId); $oActionButton->AddCSSClasses("ibo-top-bar--toolbar-dashboard-menu-toggler"); $oToolbar->AddSubBlock($oActionButton); diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index 7b2c95dd8..cc1b48129 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -18,11 +18,11 @@ */ use Combodo\iTop\Application\Search\SearchForm; -use Combodo\iTop\Application\UI\Base\Component\Alert\AlertFactory; +use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Badge\BadgeFactory; -use Combodo\iTop\Application\UI\Base\Component\Button\ButtonFactory; +use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Dashlet\DashletFactory; -use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableFactory; +use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Html\Html; use Combodo\iTop\Application\UI\Base\Component\Toolbar\Toolbar; use Combodo\iTop\Application\UI\Base\iUIBlock; @@ -133,51 +133,84 @@ class DisplayBlock 'group_by', /** string group by att code */ 'group_by_expr', /** string group by expression */ 'group_by_label', /** string aggregation column name */ - 'aggregation_function', /** string aggregation function ('count', 'sum', 'avg', 'min', 'max', ...) */ - 'aggregation_attribute', /** string att code used for aggregation */ - 'limit', /** int limit the chart results */ - 'order_by', /** string either 'attribute' group_by attcode or 'function' aggregation_function value */ - 'order_direction', /** string order direction 'asc' or 'desc' */ + 'aggregation_function', + /** string aggregation function ('count', 'sum', 'avg', 'min', 'max', ...) */ + 'aggregation_attribute', + /** string att code used for aggregation */ + 'limit', + /** int limit the chart results */ + 'order_by', + /** string either 'attribute' group_by attcode or 'function' aggregation_function value */ + 'order_direction', + /** string order direction 'asc' or 'desc' */ ], 'csv' => [], 'join' => array_merge([ - 'display_aliases', /** string comma separated list of class aliases to display */ - 'group_by', /** string group by att code */ - ], DataTableFactory::GetAllowedParams()), - 'links' => DataTableFactory::GetAllowedParams(), + 'display_aliases', + /** string comma separated list of class aliases to display */ + 'group_by', + /** string group by att code */ + ], DataTableUIBlockFactory::GetAllowedParams()), + 'links' => DataTableUIBlockFactory::GetAllowedParams(), 'list' => array_merge([ - 'update_history', /** bool add breadcrumb entry */ - 'default', /** array of default attribute values */ - 'menu_actions_target', /** string html link target */ - 'toolkit_menu', /** bool add toolkit menu */ - ], DataTableFactory::GetAllowedParams()), + 'update_history', + /** bool add breadcrumb entry */ + 'default', + /** array of default attribute values */ + 'menu_actions_target', + /** string html link target */ + 'toolkit_menu', + /** bool add toolkit menu */ + ], DataTableUIBlockFactory::GetAllowedParams()), 'list_search' => array_merge([ - 'update_history', /** bool add breadcrumb entry */ - 'result_list_outer_selector', /** string js selector of the search result display */ - 'table_inner_id', /** string html id of the results table */ - 'json', /** string */ - 'hidden_criteria', /** string search criteria not visible */ - 'baseClass', /** string base class */ - 'action', /** string */ - 'open', /** bool open by default the search */ - ], DataTableFactory::GetAllowedParams()), + 'update_history', + /** bool add breadcrumb entry */ + 'result_list_outer_selector', + /** string js selector of the search result display */ + 'table_inner_id', + /** string html id of the results table */ + 'json', + /** string */ + 'hidden_criteria', + /** string search criteria not visible */ + 'baseClass', + /** string base class */ + 'action', + /** string */ + 'open', + /** bool open by default the search */ + ], DataTableUIBlockFactory::GetAllowedParams()), 'search' => array_merge([ - 'baseClass', /** string search root class */ - 'open', /** bool open the search panel by default */ - 'result_list_outer_selector', /** string js selector of the search result display */ - 'search_header_force_dropdown', /** string Search class selection dropdown html code */ - 'action', /** string search URL */ - 'table_inner_id', /** string html id of the results table */ - 'json', /** string */ - 'hidden_criteria', /** string search criteria not visible */ - 'class', /** string class searched */ - ], DataTableFactory::GetAllowedParams()), + 'baseClass', + /** string search root class */ + 'open', + /** bool open the search panel by default */ + 'result_list_outer_selector', + /** string js selector of the search result display */ + 'search_header_force_dropdown', + /** string Search class selection dropdown html code */ + 'action', + /** string search URL */ + 'table_inner_id', + /** string html id of the results table */ + 'json', + /** string */ + 'hidden_criteria', + /** string search criteria not visible */ + 'class', + /** string class searched */ + ], DataTableUIBlockFactory::GetAllowedParams()), 'summary' => [ - 'status[block]', /** string object 'status' att code */ - 'status_codes[block]', /** string comma separated list of object states */ - 'title[block]', /** string title */ - 'label[block]', /** string label */ - 'context_filter', /** int if != 0 filter with user context */ + 'status[block]', + /** string object 'status' att code */ + 'status_codes[block]', + /** string comma separated list of object states */ + 'title[block]', + /** string title */ + 'label[block]', + /** string label */ + 'context_filter', + /** int if != 0 filter with user context */ ], ]; @@ -390,7 +423,7 @@ class DisplayBlock Exception thrown:
{$e->getMessage()} HTML; - $oExceptionAlert = AlertFactory::MakeForFailure('Cannot display results', $sExceptionContent); + $oExceptionAlert = AlertUIBlockFactory::MakeForFailure('Cannot display results', $sExceptionContent); $oHtml->AddSubBlock($oExceptionAlert); } IssueLog::Error('Exception during GetDisplay: '.$e->getMessage()); @@ -1077,7 +1110,7 @@ JS ); $sFormat = isset($aExtraParams['format']) ? $aExtraParams['format'] : 'UI:Pagination:HeaderNoSelection'; $sTitle = Dict::Format($sFormat, $iTotalCount); - $oBlock = DataTableFactory::MakeForStaticData($sTitle, $aAttribs, $aData); + $oBlock = DataTableUIBlockFactory::MakeForStaticData($sTitle, $aAttribs, $aData); } else { // Simply count the number of elements in the set @@ -1159,7 +1192,7 @@ JS } else { $iListId = $aExtraParams['currentId']; } - $oBlock->AddSubBlock(DataTableFactory::MakeForObject($oPage, $iListId, $this->m_oSet, $aExtraParams)); + $oBlock->AddSubBlock(DataTableUIBlockFactory::MakeForObject($oPage, $iListId, $this->m_oSet, $aExtraParams)); } else { // Empty set $oBlock->bEmptySet = true; @@ -1310,7 +1343,7 @@ JS } else { $iListId = $aExtraParams['currentId']; } - $oBlock = DataTableFactory::MakeForRendering($iListId, $oSet, $aExtraParams); + $oBlock = DataTableUIBlockFactory::MakeForRendering($iListId, $oSet, $aExtraParams); $oHtml->AddHtml(""); $oContentBlock->AddSubBlock($oBlock); $oHtml = new Html(); @@ -2048,7 +2081,7 @@ class MenuBlock extends DisplayBlock } else { $sName = 'UI:Menu:Actions'; } - $oActionButton = ButtonFactory::MakeLinkNeutral('', '', 'fas fa-ellipsis-v', $sName, '', $sMenuTogglerId); + $oActionButton = ButtonUIBlockFactory::MakeLinkNeutral('', '', 'fas fa-ellipsis-v', $sName, '', $sMenuTogglerId); // TODO Add Js $oActionsBlock->AddSubBlock($oActionButton) ->AddSubBlock($oPage->GetPopoverMenu($sPopoverMenuId, $aActions)); @@ -2072,14 +2105,14 @@ JS } if ($this->m_sStyle == 'details') { - $oActionButton = ButtonFactory::MakeLinkNeutral("{$sRootUrl}pages/UI.php?operation=search_form&do_search=0&class=$sClass{$sContext}", '', 'fas fa-search', 'UI:SearchFor_Class'); + $oActionButton = ButtonUIBlockFactory::MakeLinkNeutral("{$sRootUrl}pages/UI.php?operation=search_form&do_search=0&class=$sClass{$sContext}", '', 'fas fa-search', 'UI:SearchFor_Class'); $oActionButton->SetTooltip(Dict::Format('UI:SearchFor_Class', MetaModel::GetName($sClass))) ->AddCSSClasses('ibo-action-button'); $oActionsBlock->AddSubBlock($oActionButton); } if (!$oPage->IsPrintableVersion() && ($sRefreshAction != '')) { - $oActionButton = ButtonFactory::MakeAlternativeNeutral('', 'UI:Button:Refresh'); + $oActionButton = ButtonUIBlockFactory::MakeAlternativeNeutral('', 'UI:Button:Refresh'); $oActionButton->SetIconClass('fas fa-sync') ->SetOnClickJsCode($sRefreshAction) ->SetTooltip(Dict::S('UI:Button:Refresh')) @@ -2122,7 +2155,7 @@ JS } $sTarget = isset($aAction['target']) ? $aAction['target'] : ''; - $oActionButton = ButtonFactory::MakeLinkNeutral($sUrl, $sLabel, $sIconClass, $sActionId, $sTarget); + $oActionButton = ButtonUIBlockFactory::MakeLinkNeutral($sUrl, $sLabel, $sIconClass, $sActionId, $sTarget); $oActionButton->AddCSSClasses('ibo-action-button'); $oActionsBlock->AddSubBlock($oActionButton); } diff --git a/application/menunode.class.inc.php b/application/menunode.class.inc.php index 6bb56bc53..b6a6e4058 100644 --- a/application/menunode.class.inc.php +++ b/application/menunode.class.inc.php @@ -17,7 +17,7 @@ * You should have received a copy of the GNU Affero General Public License */ -use Combodo\iTop\Application\UI\Base\Component\Title\TitleFactory; +use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory; require_once(APPROOT.'/application/utils.inc.php'); require_once(APPROOT.'/application/template.class.inc.php'); @@ -1131,7 +1131,7 @@ class OQLMenuNode extends MenuNode //$oPage->add("

$sIcon ".utils::HtmlEntities(Dict::S($sTitle))."

"); $oPage->add("
"); - $oTitle = TitleFactory::MakeForPage($sTitle); + $oTitle = TitleUIBlockFactory::MakeForPage($sTitle); $oPage->AddUiBlock($oTitle); $aParams = array_merge(array('table_id' => $sUsageId), $aExtraParams); @@ -1139,7 +1139,7 @@ class OQLMenuNode extends MenuNode $oBlock->Display($oPage, $sUsageId); $oPage->add("
"); - + if ($bEnableBreadcrumb && ($oPage instanceof iTopWebPage)) { // Breadcrumb //$iCount = $oBlock->GetDisplayedCount(); diff --git a/application/ui.linkswidget.class.inc.php b/application/ui.linkswidget.class.inc.php index b7d86c199..dc81c3b4e 100644 --- a/application/ui.linkswidget.class.inc.php +++ b/application/ui.linkswidget.class.inc.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ -use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableFactory; +use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTableRow\FormTableRow; use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinksEdit\BlockIndirectLinksEdit; use Combodo\iTop\Application\UI\Links\Indirect\BlockObjectPickerDialog\BlockObjectPickerDialog; @@ -351,7 +351,7 @@ JS */ protected function GetFormTableBlock($aConfig, $aData) { - return DataTableFactory::MakeForForm("{$this->m_sAttCode}{$this->m_sNameSuffix}", $aConfig, $aData); + return DataTableUIBlockFactory::MakeForForm("{$this->m_sAttCode}{$this->m_sNameSuffix}", $aConfig, $aData); } diff --git a/datamodels/2.x/itop-config/config.php b/datamodels/2.x/itop-config/config.php index 7e2107ccd..7d88685c7 100644 --- a/datamodels/2.x/itop-config/config.php +++ b/datamodels/2.x/itop-config/config.php @@ -24,12 +24,12 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ -use Combodo\iTop\Application\UI\Base\Component\Alert\AlertFactory; -use Combodo\iTop\Application\UI\Base\Component\Button\ButtonFactory; +use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Form\Form; use Combodo\iTop\Application\UI\Base\Component\Html\Html; -use Combodo\iTop\Application\UI\Base\Component\Input\InputFactory; -use Combodo\iTop\Application\UI\Base\Component\Title\TitleFactory; +use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory; use Combodo\iTop\Config\Validator\iTopConfigAstValidator; use Combodo\iTop\Config\Validator\iTopConfigSyntaxValidator; @@ -91,14 +91,14 @@ try { $sOperation = utils::ReadParam('operation', ''); $iEditorTopMargin = 2; - $oP->AddUiBlock(TitleFactory::MakeForPage(Dict::S('config-edit-title'))); + $oP->AddUiBlock(TitleUIBlockFactory::MakeForPage(Dict::S('config-edit-title'))); if (MetaModel::GetConfig()->Get('demo_mode')) { - $oAlert = AlertFactory::MakeForInformation('', "Sorry, iTop is in demonstration mode: the configuration file cannot be edited."); + $oAlert = AlertUIBlockFactory::MakeForInformation('', "Sorry, iTop is in demonstration mode: the configuration file cannot be edited."); $oP->AddUiBlock($oAlert); } else { if (MetaModel::GetModuleSetting('itop-config', 'config_editor', '') == 'disabled') { - $oAlert = AlertFactory::MakeForWarning('', "iTop interactive edition of the configuration as been disabled. See 'config_editor' => 'disabled' in the configuration file."); + $oAlert = AlertUIBlockFactory::MakeForWarning('', "iTop interactive edition of the configuration as been disabled. See 'config_editor' => 'disabled' in the configuration file."); $oP->AddUiBlock($oAlert); } else { $sConfigFile = APPROOT.'conf/'.utils::GetCurrentEnvironment().'/config-itop.php'; @@ -114,17 +114,17 @@ try { } if ($sOperation == 'revert') { - $oAlert = AlertFactory::MakeForWarning('', Dict::S('config-reverted')); + $oAlert = AlertUIBlockFactory::MakeForWarning('', Dict::S('config-reverted')); $oP->AddUiBlock($oAlert); } if ($sOperation == 'save') { $sTransactionId = utils::ReadParam('transaction_id', '', false, 'transaction_id'); if (!utils::IsTransactionValid($sTransactionId, true)) { - $oAlert = AlertFactory::MakeForFailure('', 'Error: invalid Transaction ID. The configuration was NOT modified.'); + $oAlert = AlertUIBlockFactory::MakeForFailure('', 'Error: invalid Transaction ID. The configuration was NOT modified.'); $oP->AddUiBlock($oAlert); } else { if ($sConfig == $sOriginalConfig) { - $oAlert = AlertFactory::MakeForInformation('', Dict::S('config-no-change')); + $oAlert = AlertUIBlockFactory::MakeForInformation('', Dict::S('config-no-change')); $oP->AddUiBlock($oAlert); } else { try { @@ -150,14 +150,14 @@ try { @chmod($sConfigFile, 0440); // Read-only if (DBPasswordInNewConfigIsOk($sConfig)) { - $oAlert = AlertFactory::MakeForSuccess('', Dict::S('config-saved')); + $oAlert = AlertUIBlockFactory::MakeForSuccess('', Dict::S('config-saved')); } else { - $oAlert = AlertFactory::MakeForInformation('', Dict::S('config-saved-warning-db-password')); + $oAlert = AlertUIBlockFactory::MakeForInformation('', Dict::S('config-saved-warning-db-password')); } $oP->AddUiBlock($oAlert); $sOriginalConfig = str_replace("\r\n", "\n", file_get_contents($sConfigFile)); } catch (Exception $e) { - $oAlert = AlertFactory::MakeForDanger('', $e->getMessage()); + $oAlert = AlertUIBlockFactory::MakeForDanger('', $e->getMessage()); $oP->AddUiBlock($oAlert); } } @@ -170,19 +170,19 @@ try { $oP->AddUiBlock(new Html('

'.Dict::S('config-edit-intro').'

')); $oForm = new Form(); - $oForm->AddSubBlock(InputFactory::MakeForHidden('operation', 'save')); - $oForm->AddSubBlock(InputFactory::MakeForHidden('transaction_id', utils::GetNewTransactionId())); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('operation', 'save')); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('transaction_id', utils::GetNewTransactionId())); // - Cancel button - $oCancelButton = ButtonFactory::MakeForSecondaryAction(Dict::S('config-cancel'), 'cancel_button', null, true, 'cancel_button'); + $oCancelButton = ButtonUIBlockFactory::MakeForSecondaryAction(Dict::S('config-cancel'), 'cancel_button', null, true, 'cancel_button'); $oCancelButton->SetOnClickJsCode("return ResetConfig();"); $oForm->AddSubBlock($oCancelButton); // - Submit button - $oSubmitButton = ButtonFactory::MakeForPrimaryAction(Dict::S('config-apply'), null, Dict::S('config-apply'), true, 'submit_button'); + $oSubmitButton = ButtonUIBlockFactory::MakeForPrimaryAction(Dict::S('config-apply'), null, Dict::S('config-apply'), true, 'submit_button'); $oForm->AddSubBlock($oSubmitButton); - $oForm->AddSubBlock(InputFactory::MakeForHidden('prev_config', $sOriginalConfigEscaped, 'prev_config')); - $oForm->AddSubBlock(InputFactory::MakeForHidden('new_config', $sConfigEscaped)); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('prev_config', $sOriginalConfigEscaped, 'prev_config')); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('new_config', $sConfigEscaped)); $oForm->AddHtml("
"); $oP->AddUiBlock($oForm); diff --git a/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig b/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig index 429ecce76..54972f03a 100644 --- a/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig +++ b/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig @@ -2,50 +2,48 @@ {# @license http://opensource.org/licenses/AGPL-3.0 #} {% apply spaceless %} -{% UIContentBlock {'container_class':'ibo-update-core'} %} +{% UIContentBlock Standard {'sContainerClass':'ibo-update-core'} %} -{% UITitle ForPage {'title':'iTopUpdate:UI:PageTitle'|dict_s} %} +{% UITitle ForPage {'sTitle':'iTopUpdate:UI:PageTitle'|dict_s} %} {% UIHtml %}
 
{% EndUIHtml %} -{% UIContentBlock {'container_class':'display_block display-files'} %} -{% UIFieldSet {'legend':'iTopUpdate:UI:Status'|dict_s} %} +{% UIContentBlock Standard {'sContainerClass':'display_block display-files'} %} +{% UIFieldSet Standard {'sLegend':'iTopUpdate:UI:Status'|dict_s} %} -{% UIAlert ForInformation {'title':'', 'id':'header-requirements', 'is_collapsible':false, 'is_closable':false} %} +{% UIAlert ForInformation {'sId':'header-requirements', 'IsCollapsible':false, 'IsClosable':false} %} {% UIHtml %} {{ 'iTopUpdate:UI:CanCoreUpdate:Loading'|dict_s }} {% EndUIHtml %} {% EndUIAlert %} - {% set sVersion = 'UI:iTopVersion:Long'|dict_format(constant('ITOP_APPLICATION'), constant('ITOP_VERSION'), constant('ITOP_REVISION'), constant('ITOP_BUILD_DATE')) %} - -{% UIField Small {'label':'iTopUpdate:UI:CurrentVersion'|dict_s} %} +{% UIField Standard {'sLabel':'iTopUpdate:UI:CurrentVersion'|dict_s} %} {% UIHtml %} - {{ sVersion }} + {{ 'UI:iTopVersion:Long'|dict_format(constant('ITOP_APPLICATION'), constant('ITOP_VERSION'), constant('ITOP_REVISION'), constant('ITOP_BUILD_DATE')) }} {% EndUIHtml %} {% EndUIField %} -{% UIField Small {'label':'iTopUpdate:UI:DiskFreeSpace'|dict_s} %} +{% UIField Standard {'sLabel':'iTopUpdate:UI:DiskFreeSpace'|dict_s} %} {% UIHtml %} {{ sDiskFreeSpace }} {% EndUIHtml %} {% EndUIField %} -{% UIField Small {'label':'iTopUpdate:UI:ItopDiskSpace'|dict_s, 'value_id':'itop-disk-space'} %} +{% UIField Standard {'sLabel':'iTopUpdate:UI:ItopDiskSpace'|dict_s, 'ValueId':'itop-disk-space'} %} {% UIHtml %} {% EndUIHtml %} {% EndUIField %} -{% UIField Small {'label':'iTopUpdate:UI:DBDiskSpace'|dict_s, 'value_id':'db-disk-space'} %} +{% UIField Standard {'sLabel':'iTopUpdate:UI:DBDiskSpace'|dict_s, 'ValueId':'db-disk-space'} %} {% UIHtml %} {% EndUIHtml %} {% EndUIField %} -{% UIField Small {'label':'iTopUpdate:UI:FileUploadMaxSize'|dict_s} %} +{% UIField Standard {'sLabel':'iTopUpdate:UI:FileUploadMaxSize'|dict_s} %} {% UIHtml %} {{ sFileUploadMaxSize }} {% EndUIHtml %} @@ -53,15 +51,15 @@ {% EndUIFieldSet %} -{% UIFieldSet {'legend':'iTopUpdate:UI:SelectUpdateFile'|dict_s} %} -{% UIForm {} %} -{% UIInput ForHidden {'name':'operation', 'value':'ConfirmUpdate'} %} -{% UIInput ForHidden {'name':'transaction_id', 'value':sTransactionId} %} +{% UIFieldSet Standard {'sLegend':'iTopUpdate:UI:SelectUpdateFile'|dict_s} %} +{% UIForm Standard {} %} +{% UIInput ForHidden {'sName':'operation', 'sValue':'ConfirmUpdate'} %} +{% UIInput ForHidden {'sName':'transaction_id', 'sValue':sTransactionId} %} {% UIHtml %} HTML; -$oPageContentLayout->AddMainBlock(AlertFactory::MakeNeutral('Neutral alert', $sContent)); -$oPageContentLayout->AddMainBlock(AlertFactory::MakeForInformation('Alert for information', $sContent)); -$oPageContentLayout->AddMainBlock(AlertFactory::MakeForSuccess('Alert for success', $sContent)); -$oPageContentLayout->AddMainBlock(AlertFactory::MakeForWarning('Alert for warning', $sContent)); -$oPageContentLayout->AddMainBlock(AlertFactory::MakeForDanger('Alert for danger', $sContent)); -$oPageContentLayout->AddMainBlock(AlertFactory::MakeForFailure('Alert for failure', $sContent)); -$oPageContentLayout->AddMainBlock(AlertFactory::MakeWithBrandingPrimaryColor('Alert with branding primary color', $sContent)); -$oPageContentLayout->AddMainBlock(AlertFactory::MakeWithBrandingSecondaryColor('Alert with branding secondary color', $sContent)); -$oAlertNonClosable = AlertFactory::MakeNeutral('Alert not closable, not collapsable', $sContent) +$oPageContentLayout->AddMainBlock(AlertUIBlockFactory::MakeNeutral('Neutral alert', $sContent)); +$oPageContentLayout->AddMainBlock(AlertUIBlockFactory::MakeForInformation('Alert for information', $sContent)); +$oPageContentLayout->AddMainBlock(AlertUIBlockFactory::MakeForSuccess('Alert for success', $sContent)); +$oPageContentLayout->AddMainBlock(AlertUIBlockFactory::MakeForWarning('Alert for warning', $sContent)); +$oPageContentLayout->AddMainBlock(AlertUIBlockFactory::MakeForDanger('Alert for danger', $sContent)); +$oPageContentLayout->AddMainBlock(AlertUIBlockFactory::MakeForFailure('Alert for failure', $sContent)); +$oPageContentLayout->AddMainBlock(AlertUIBlockFactory::MakeWithBrandingPrimaryColor('Alert with branding primary color', $sContent)); +$oPageContentLayout->AddMainBlock(AlertUIBlockFactory::MakeWithBrandingSecondaryColor('Alert with branding secondary color', $sContent)); +$oAlertNonClosable = AlertUIBlockFactory::MakeNeutral('Alert not closable, not collapsable', $sContent) ->SetIsClosable(false) ->SetIsCollapsible(false); $oPageContentLayout->AddMainBlock($oAlertNonClosable); -$oAlertSaveCollapsibleState = AlertFactory::MakeNeutral('Alert with collapsible state saving', $sContent) - ->EnableSaveCollapsibleState('RenderAllUiBlocks__alert'); +$oAlertSaveCollapsibleState = AlertUIBlockFactory::MakeNeutral('Alert with collapsible state saving', $sContent) + ->EnableSaveCollapsibleState('RenderAllUiBlocks-alert'); $oPageContentLayout->AddMainBlock($oAlertSaveCollapsibleState); $oPageContentLayout->AddMainBlock(new Html('
')); @@ -96,29 +96,29 @@ $oPageContentLayout->AddMainBlock(new Html('
')); ////////// $oButtonsTitle = new Html('

Buttons examples

'); $oPage->AddUiBlock($oButtonsTitle); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeNeutral('Neutral', 'neutral')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeNeutral('Neutral dis.', 'neutral')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForPrimaryAction('Primary')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForPrimaryAction('Primary dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForSecondaryAction('Secondary')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForSecondaryAction('Secondary dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForPositiveAction('Validation')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForPositiveAction('Validation dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForDestructiveAction('Destructive')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForDestructiveAction('Destructive dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeAlternativeNeutral('Alt. neutral', 'alt-neutral')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeAlternativeNeutral('Alt. neutral dis.', 'alt-neutral')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForAlternativePrimaryAction('Alt. primary')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForAlternativePrimaryAction('Alt. primary dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForAlternativeSecondaryAction('Alt. secondary')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForAlternativeSecondaryAction('Alt. secondary dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForAlternativeValidationAction('Alt. validation')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForAlternativeValidationAction('Alt. validation dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForAlternativeDestructiveAction('Alt. destructive')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeForAlternativeDestructiveAction('Alt. destructive dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeLinkNeutral(utils::GetAbsoluteUrlAppRoot(), 'Link neutral')); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeLinkNeutral(utils::GetAbsoluteUrlAppRoot(), 'Link neutral dis.')->SetIsDisabled(true)); -$oPageContentLayout->AddMainBlock(ButtonFactory::MakeIconLink('fas fa-thumbs-up', 'Icon link button')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeNeutral('Neutral', 'neutral')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeNeutral('Neutral dis.', 'neutral')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForPrimaryAction('Primary')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForPrimaryAction('Primary dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForSecondaryAction('Secondary')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForSecondaryAction('Secondary dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForPositiveAction('Validation')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForPositiveAction('Validation dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForDestructiveAction('Destructive')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForDestructiveAction('Destructive dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeAlternativeNeutral('Alt. neutral', 'alt-neutral')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeAlternativeNeutral('Alt. neutral dis.', 'alt-neutral')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForAlternativePrimaryAction('Alt. primary')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForAlternativePrimaryAction('Alt. primary dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForAlternativeSecondaryAction('Alt. secondary')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForAlternativeSecondaryAction('Alt. secondary dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForAlternativeValidationAction('Alt. validation')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForAlternativeValidationAction('Alt. validation dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForAlternativeDestructiveAction('Alt. destructive')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeForAlternativeDestructiveAction('Alt. destructive dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeLinkNeutral(utils::GetAbsoluteUrlAppRoot(), 'Link neutral')); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeLinkNeutral(utils::GetAbsoluteUrlAppRoot(), 'Link neutral dis.')->SetIsDisabled(true)); +$oPageContentLayout->AddMainBlock(ButtonUIBlockFactory::MakeIconLink('fas fa-thumbs-up', 'Icon link button')); $oPageContentLayout->AddMainBlock(new Html('
'));