Feature/modals - generic modal API (#373)

Default modal JS Implementation:

Add title option
Add buttons option
Change template cloning
Confirmation Modal:

Add implementation
Do not show again functionality
Web Page:

Add blocks array with twig loop insertion
This commit is contained in:
bdalsass
2022-12-06 10:18:59 +01:00
committed by GitHub
parent 98a53a46f0
commit dbe7fae82e
29 changed files with 322 additions and 345 deletions

View File

@@ -7,8 +7,6 @@
namespace Combodo\iTop\Application\UI\Base\Component\DataTable;
use Combodo\iTop\Application\UI\Base\Component\Dialog\DialogUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
/**
* Trait tTableRowActions
@@ -33,11 +31,11 @@ trait tTableRowActions
* confirmation => {
* message: string,
* message_row_data: string,
* remember_choice_pref_key: string
* do_not_show_again_pref_key: string
* }
* }
*/
protected $aRowActions;
protected $aRowActions = [];
/**
* Set row actions.
@@ -82,31 +80,4 @@ trait tTableRowActions
{
return DataTableUIBlockFactory::MakeActionRowToolbarTemplate($this);
}
/**
* GetRowActionsConfirmDialog.
*
* @return \Combodo\iTop\Application\UI\Base\Component\Html\Html
*/
public function GetRowActionsConfirmDialog()
{
static::$bDialogInitialized = true;
$oDialog = DialogUIBlockFactory::MakeNeutral('', '<div class="ibo-row-action--confirmation--explanation"></div>', 'table-row-action-confirmation-dialog');
$oContent = UIContentBlockUIBlockFactory::MakeStandard();
$oContent->AddCSSClass('ibo-row-action--confirmation--do-not-show-again');
$checkBox = InputUIBlockFactory::MakeStandard('checkbox', 'do_not_show_again', false);
$checkBox->AddCSSClass('ibo-row-action--confirmation--do-not-show-again--checkbox');
$checkBox->SetLabel(\Dict::S('UI:UserPref:DoNotShowAgain'));
$oContent->AddSubBlock($checkBox);
$oDialog->AddSubBlock($oContent);
return $oDialog;
}
public function GetRowActionsConfirmDialogInitializedFlag()
{
return static::$bDialogInitialized;
}
}