mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 15:34:12 +01:00
# Conflicts: # application/displayblock.class.inc.php # core/config.class.inc.php # datamodels/2.x/authent-cas/module.authent-cas.php # datamodels/2.x/authent-external/module.authent-external.php # datamodels/2.x/authent-ldap/module.authent-ldap.php # datamodels/2.x/authent-local/module.authent-local.php # datamodels/2.x/combodo-backoffice-darkmoon-theme/module.combodo-backoffice-darkmoon-theme.php # datamodels/2.x/combodo-db-tools/module.combodo-db-tools.php # datamodels/2.x/itop-attachments/module.itop-attachments.php # datamodels/2.x/itop-backup/module.itop-backup.php # datamodels/2.x/itop-bridge-cmdb-ticket/module.itop-bridge-cmdb-ticket.php # datamodels/2.x/itop-bridge-virtualization-storage/module.itop-bridge-virtualization-storage.php # datamodels/2.x/itop-change-mgmt-itil/module.itop-change-mgmt-itil.php # datamodels/2.x/itop-change-mgmt/module.itop-change-mgmt.php # datamodels/2.x/itop-config-mgmt/module.itop-config-mgmt.php # datamodels/2.x/itop-config/module.itop-config.php # datamodels/2.x/itop-core-update/module.itop-core-update.php # datamodels/2.x/itop-datacenter-mgmt/module.itop-datacenter-mgmt.php # datamodels/2.x/itop-endusers-devices/module.itop-endusers-devices.php # datamodels/2.x/itop-faq-light/module.itop-faq-light.php # datamodels/2.x/itop-files-information/module.itop-files-information.php # datamodels/2.x/itop-full-itil/module.itop-full-itil.php # datamodels/2.x/itop-hub-connector/module.itop-hub-connector.php # datamodels/2.x/itop-incident-mgmt-itil/module.itop-incident-mgmt-itil.php # datamodels/2.x/itop-knownerror-mgmt/module.itop-knownerror-mgmt.php # datamodels/2.x/itop-portal-base/module.itop-portal-base.php # datamodels/2.x/itop-portal/module.itop-portal.php # datamodels/2.x/itop-problem-mgmt/module.itop-problem-mgmt.php # datamodels/2.x/itop-profiles-itil/module.itop-profiles-itil.php # datamodels/2.x/itop-request-mgmt-itil/module.itop-request-mgmt-itil.php # datamodels/2.x/itop-request-mgmt/module.itop-request-mgmt.php # datamodels/2.x/itop-service-mgmt-provider/module.itop-service-mgmt-provider.php # datamodels/2.x/itop-service-mgmt/module.itop-service-mgmt.php # datamodels/2.x/itop-sla-computation/module.itop-sla-computation.php # datamodels/2.x/itop-storage-mgmt/module.itop-storage-mgmt.php # datamodels/2.x/itop-structure/module.itop-structure.php # datamodels/2.x/itop-tickets/module.itop-tickets.php # datamodels/2.x/itop-virtualization-mgmt/module.itop-virtualization-mgmt.php # datamodels/2.x/itop-welcome-itil/module.itop-welcome-itil.php # datamodels/2.x/version.xml
116 lines
2.8 KiB
PHP
116 lines
2.8 KiB
PHP
<?php
|
|
/**
|
|
* Copyright (C) 2013-2021 Combodo SARL
|
|
*
|
|
* This file is part of iTop.
|
|
*
|
|
* iTop is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* iTop is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
*/
|
|
|
|
namespace Combodo\iTop\Application\UI\Base\Component\Button;
|
|
|
|
|
|
/**
|
|
* Class Button
|
|
*
|
|
* @author Stephen Abello <stephen.abello@combodo.com>
|
|
* @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';
|
|
public const REQUIRES_ANCESTORS_DEFAULT_JS_FILES = true;
|
|
|
|
// 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 */
|
|
protected $sURL;
|
|
/** @var string */
|
|
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_SCHEME, 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;
|
|
}
|
|
} |