diff --git a/sources/Forms/Block/AbstractFormBlock.php b/sources/Forms/Block/AbstractFormBlock.php index 64d91ca30..0b54df3fd 100644 --- a/sources/Forms/Block/AbstractFormBlock.php +++ b/sources/Forms/Block/AbstractFormBlock.php @@ -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. * diff --git a/templates/application/forms/itop_console_layout.html.twig b/templates/application/forms/itop_console_layout.html.twig index f5f21a381..eab5fa02f 100644 --- a/templates/application/forms/itop_console_layout.html.twig +++ b/templates/application/forms/itop_console_layout.html.twig @@ -21,25 +21,6 @@ {%- block form_row -%} {% set row_attr = row_attr|merge({class: (row_attr.class|default('') ~ ' ibo-field ibo-content-block ibo-block ibo-field-small')|trim}) %} {{- parent() -}} - - {% if form_block is defined %} - {% for output in form_block.GetOutputs() %} -