Files
iTop/sources/application/UI/Base/Component/Input/FileSelect/FileSelect.php
2021-02-09 17:24:27 +01:00

83 lines
1.5 KiB
PHP

<?php
/**
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\Input\FileSelect;
use Combodo\iTop\Application\UI\Base\UIBlock;
use Dict;
class FileSelect extends UIBlock
{
// Overloaded constants
public const BLOCK_CODE = 'ibo-input-file-select';
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/input/file-select/layout';
public const DEFAULT_JS_TEMPLATE_REL_PATH = 'base/components/input/file-select/layout';
/** @var string */
private $sName;
/** @var string */
private $sFileName;
/** @var string */
private $sButtonText;
public function __construct(string $sName, string $sId = null)
{
parent::__construct($sId);
$this->sName = $sName;
$this->sFileName = Dict::S('UI:InputFile:NoFileSelected');
$this->sButtonText = Dict::S('UI:InputFile:SelectFile');
}
/**
* @return string
*/
public function GetFileName()
{
return $this->sFileName;
}
/**
* @param mixed $sFileName
*
* @return $this
*/
public function SetFileName($sFileName)
{
$this->sFileName = $sFileName;
return $this;
}
/**
* @return string
*/
public function GetButtonText(): string
{
return $this->sButtonText;
}
/**
* @param string $sButtonText
*
* @return $this
*/
public function SetButtonText(string $sButtonText)
{
$this->sButtonText = $sButtonText;
return $this;
}
/**
* @return string
*/
public function GetName(): string
{
return $this->sName;
}
}