N°3537 run_query : replace main form by components

This commit is contained in:
Pierre Goiffon
2020-12-14 16:18:54 +01:00
parent 3d27e59269
commit 4bb59548d0
10 changed files with 192 additions and 100 deletions

View File

@@ -27,18 +27,38 @@ class InputFactory
public static function MakeForSelectWithLabel(string $sName, string $sLabel, ?string $sId = null): InputWithLabel
{
$oInput = new Select();
$oInput = new Select($sId);
$oInput->SetName($sName);
if (is_null($sId)) {
$sId = $oInput->GetId();
}
$oInputWithLabel = new InputWithLabel($sLabel, $oInput, $sId);
return $oInputWithLabel;
}
}
public static function MakeForTextareaWithLabel(
string $sName, string $sLabel, ?string $sId = null, ?string $sValue = null,
?int $iCols = null, ?int $iRows = null
): InputWithLabel
{
$oTextArea = new TextArea($sValue, $sId, $iCols, $iRows);
$oTextArea->SetName($sName);
if (is_null($sId)) {
$sId = $oTextArea->GetId();
}
$oInputWithLabel = new InputWithLabel($sLabel, $oTextArea, $sId);
return $oInputWithLabel;
}
public static function MakeForSelect(string $sName, ?string $sId = null): Select
{
$oInput = new Select($sId);
$oInput->SetName($sName);
return $oInput;
}