mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 00:58:48 +02:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user