♻️ new FieldFactory

Idea is to remove the aParams parameter from the Field object
And also allow to pass subblocks for the input value instead of only raw HTML
This commit is contained in:
Pierre Goiffon
2020-12-18 10:00:41 +01:00
parent f8b8dd0bc6
commit c8dbf88c03
9 changed files with 434 additions and 318 deletions

View File

@@ -24,6 +24,7 @@ use Combodo\iTop\Application\UI\Base\Component\Button\ButtonFactory;
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableFactory;
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
use Combodo\iTop\Application\UI\Base\Component\Field\Field;
use Combodo\iTop\Application\UI\Base\Component\Field\FieldFactory;
use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSet;
use Combodo\iTop\Application\UI\Base\Component\Form\Form;
use Combodo\iTop\Application\UI\Base\Component\Input\InputFactory;
@@ -970,8 +971,7 @@ EOF
$val['value_raw'] = ($bExcludeRawValue === false) ? $this->Get($sAttCode) : '';
// The field is visible, add it to the current column
$aDetails[] = $val;
$oField = new Field($val);
$oField = FieldFactory::MakeFromParams($val);
if ($sFieldsetName[0] != '_') {
$oFieldSet->AddSubBlock($oField);
} else {
@@ -979,11 +979,6 @@ EOF
}
}
}
// if ($sFieldsetName[0] != '_') {
// $oFieldSet->AddSubBlock(new Html($oPage->GetDetails($aDetails)));
// } else {
// $oColumn->AddSubBlock(new Html($oPage->GetDetails($aDetails)));
// }
}
}
}