* @package Combodo\iTop\Application\UI\Base\Component\Button * @since 3.0.0 */ class ButtonURL extends Button { // Overloaded constants public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/button/buttonurl'; // Specific constants /** @var string ENUM_TARGET_BLANK */ public const ENUM_TARGET_BLANK = '_blank'; /** @var string ENUM_TARGET_SELF */ public const ENUM_TARGET_SELF= '_self'; /** @var string ENUM_TARGET_PARENT */ public const ENUM_TARGET_PARENT= '_parent'; /** @var string ENUM_TARGET_TOP */ public const ENUM_TARGET_TOP= '_top'; /** @var string DEFAULT_TARGET */ public const DEFAULT_TARGET = self::ENUM_TARGET_SELF; /** @var string $sURL */ protected $sURL; /** @var string $sTarget */ protected $sTarget; /** * ButtonURL constructor. * * @param string $sLabel * @param string $sURL * @param string|null $sId * @param string $sTarget * @param string $sTooltip * @param string $sIconClass * @param string $sActionType * @param string $sColor * @param string $sJsCode * @param string $sOnClickJsCode */ public function __construct( string $sLabel, string $sURL, string $sId = null, string $sTarget = self::DEFAULT_TARGET, string $sTooltip = '', string $sIconClass = '', string $sActionType = self::DEFAULT_ACTION_TYPE, string $sColor = self::DEFAULT_COLOR, string $sJsCode = '', string $sOnClickJsCode = '') { parent::__construct($sLabel, $sId, $sTooltip, $sIconClass, $sActionType, $sColor, $sJsCode, $sOnClickJsCode); $this->sURL = $sURL; $this->sTarget = $sTarget; } /** * @return string */ public function GetURL(): string { return $this->sURL; } /** * @param string $sURL * * @return $this */ public function SetURL(string $sURL) { $this->sURL = $sURL; return $this; } /** * @return string */ public function GetTarget(): string { return $this->sTarget; } /** * @param string $sTarget * * @return $this */ public function SetTarget(string $sTarget) { $this->sTarget = $sTarget; return $this; } }