N°4621 Fix naming inconsistencies in sources/*

This commit is contained in:
Pierre Goiffon
2021-12-31 15:21:08 +01:00
parent 16142bd979
commit 5f575d524a
192 changed files with 384 additions and 380 deletions

View File

@@ -0,0 +1,107 @@
<?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;
/** @var bool */
private $bShowFilename;
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');
$this->bShowFilename = true;
}
/**
* @return string
*/
public function GetFileName(): string
{
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;
}
/**
* @param bool $bShowFilename
*
* @return $this
*/
public function SetShowFilename(bool $bShowFilename)
{
$this->bShowFilename = $bShowFilename;
return $this;
}
/**
* @return bool
*/
public function GetShowFilename(): bool
{
return $this->bShowFilename;
}
}

View File

@@ -0,0 +1,38 @@
<?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\AbstractUIBlockFactory;
/**
* Class FileSelectUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Component\Input\FileSelect
* @since 3.0.0
* @api
*/
class FileSelectUIBlockFactory extends AbstractUIBlockFactory
{
/** @inheritDoc */
public const TWIG_TAG_NAME = 'UIFileSelect';
/** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = FileSelect::class;
/**
* @param string $sName
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Component\Input\FileSelect\FileSelect A styled file input selector
*/
public static function MakeStandard(string $sName, string $sId = null)
{
return new FileSelect($sName, $sId);
}
}