mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
N°8772 - Form turbo stream WIP
This commit is contained in:
@@ -100,6 +100,7 @@ abstract class AbstractFormBlock
|
||||
public function AddSubFormBlock(AbstractFormBlock $oSubFormBlock): AbstractFormBlock
|
||||
{
|
||||
$this->aSubFormBlocks[] = $oSubFormBlock;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -136,8 +137,8 @@ abstract class AbstractFormBlock
|
||||
*/
|
||||
public function GetInput(string $sName): FormInput
|
||||
{
|
||||
if(!array_key_exists($sName, $this->aFormInputs)) {
|
||||
throw new FormBlockException('Missing input ' . $sName . ' for ' . $this->sName);
|
||||
if (!array_key_exists($sName, $this->aFormInputs)) {
|
||||
throw new FormBlockException('Missing input '.$sName.' for '.$this->sName);
|
||||
}
|
||||
|
||||
return $this->aFormInputs[$sName];
|
||||
@@ -166,8 +167,8 @@ abstract class AbstractFormBlock
|
||||
*/
|
||||
public function GetOutput(string $sName): FormOutput
|
||||
{
|
||||
if(!array_key_exists($sName, $this->aFormOutputs)) {
|
||||
throw new FormBlockException('Missing ouput ' . $sName . ' for ' . $this->sName);
|
||||
if (!array_key_exists($sName, $this->aFormOutputs)) {
|
||||
throw new FormBlockException('Missing ouput '.$sName.' for '.$this->sName);
|
||||
}
|
||||
|
||||
return $this->aFormOutputs[$sName];
|
||||
@@ -213,6 +214,7 @@ abstract class AbstractFormBlock
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -226,6 +228,7 @@ abstract class AbstractFormBlock
|
||||
$aBindings[$oFormInput->GetName()] = $oFormInput->GetBinding();
|
||||
}
|
||||
}
|
||||
|
||||
return $aBindings;
|
||||
}
|
||||
|
||||
@@ -233,7 +236,7 @@ abstract class AbstractFormBlock
|
||||
{
|
||||
foreach ($this->aFormInputs as $oFormInput) {
|
||||
if ($oFormInput->IsBound()) {
|
||||
if(!$oFormInput->IsDataReady($sEventType)) {
|
||||
if (!$oFormInput->IsDataReady($sEventType)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -252,6 +255,16 @@ abstract class AbstractFormBlock
|
||||
$this->bIsAdded = $bIsAdded;
|
||||
}
|
||||
|
||||
public function ListBlockNames(): array
|
||||
{
|
||||
$aNames = [];
|
||||
foreach ($this->aSubFormBlocks as $oSubFormBlock) {
|
||||
$aNames[] = $oSubFormBlock->GetName();
|
||||
}
|
||||
|
||||
return $aNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the form type.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user