mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 14:58:43 +02:00
Add a Factory for 'Cancel' buttons, make 'Cancel' buttons alternative, make buttons uppercase
This commit is contained in:
@@ -2589,7 +2589,7 @@ CSS
|
||||
$oToolbarTop = new Toolbar();
|
||||
$oToolbarTop->SetCSSClasses(['ibo-toolbar', 'ibo-toolbar-top']);
|
||||
|
||||
$oCancelButton = ButtonUIBlockFactory::MakeForSecondaryAction(Dict::S('UI:Button:Cancel'));
|
||||
$oCancelButton = ButtonUIBlockFactory::MakeForCancel();
|
||||
$oCancelButton->AddCSSClasses(['action', 'cancel']);
|
||||
$oToolbarTop->AddSubBlock($oCancelButton);
|
||||
$oApplyButton = ButtonUIBlockFactory::MakeForPrimaryAction($sApplyButton, null, null, true);
|
||||
|
||||
@@ -389,7 +389,8 @@ $ibo-button-colors: (
|
||||
|
||||
.ibo-button {
|
||||
cursor: pointer;
|
||||
@extend %ibo-font-ral-med-150;
|
||||
@extend %ibo-font-ral-sembol-100;
|
||||
text-transform: uppercase;
|
||||
padding: $ibo-button--padding-y $ibo-button--padding-x;
|
||||
border: $ibo-button--border;
|
||||
border-radius: $ibo-button--border-radius;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
namespace Combodo\iTop\Application\UI\Base\Component\Button;
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
|
||||
use Dict;
|
||||
|
||||
/**
|
||||
* Class ButtonUIBlockFactory
|
||||
@@ -259,6 +260,28 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
|
||||
$bIsSubmit, $sId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a Button component for a cancel, should be used only for UI navigation, not destructive action
|
||||
*
|
||||
* @param string|null $sLabel
|
||||
* @param string|null $sName See Button::$sName
|
||||
* @param string|null $sValue See Button::$sValue
|
||||
* @param bool $bIsSubmit See Button::$sType
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\Button\Button
|
||||
*/
|
||||
public static function MakeForCancel(
|
||||
string $sLabel = null,
|
||||
string $sName = null,
|
||||
string $sValue = null,
|
||||
bool $bIsSubmit = false,
|
||||
?string $sId = null
|
||||
): Button {
|
||||
$sLabel = $sLabel ?? Dict::S('UI:Button:Cancel');
|
||||
return static::MakeForAction($sLabel, Button::ENUM_COLOR_NEUTRAL, Button::ENUM_ACTION_TYPE_ALTERNATIVE, $sValue, $sName,
|
||||
$bIsSubmit, $sId);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// Link buttons, mostly used outside forms, to redirect somewhere whilst keeping a button aspect
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user