diff --git a/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig b/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig index 666f0c77e..a72dcf115 100644 --- a/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig +++ b/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig @@ -2,7 +2,7 @@ {# @license http://opensource.org/licenses/AGPL-3.0 #} {% apply spaceless %} -{% UIContentBlock "" "ibo-update-core" %} +{% UIContentBlock {'container_class':'ibo-update-core'} %} {% UITitle ForPage {'title':'iTopUpdate:UI:PageTitle'|dict_s} %} @@ -10,7 +10,7 @@
 
{% EndUIHtml %} -{% UIContentBlock "" "display_block display-files" %} +{% UIContentBlock {'container_class':'display_block display-files'} %} {% UIFieldSet {'legend':'iTopUpdate:UI:Status'|dict_s} %} {% UIAlert ForInformation {'title':'', 'id':'header-requirements'} %} @@ -38,6 +38,83 @@ {% EndUIFieldSet %} {% EndUIContentBlock %} +{% UIContentBlock {'container_class':'display_block display-files'} %} +{% UIFieldSet {'legend':'iTopUpdate:UI:SelectUpdateFile'|dict_s} %} + {#
#} + {# #} + {# #} + + {# #} + + {#
#} + {#
#} + {#
#} + {# #} + {#
#} + {#
#} + + {# #} + {#
#} + {# #} + {# #} + {#
#} + {#
#} + {# #} + {# #} + {#
#} + {#
#} + {#

#} + {#
#} +{% EndUIFieldSet %} +{% EndUIContentBlock %} + + +{% UIContentBlock {'container_class':'display_block display-files'} %} +{% UIFieldSet {'legend':'iTopUpdate:UI:History'|dict_s} %} + {#
#} + {# {% for aInstall in aPreviousInstall %} #} + {# {% if loop.first %} #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# {% endif %} #} + + {# {% if (loop.index0 % 2) == 0 %} #} + {# {% set sRowClass = "odd" %} #} + {# {% else %} #} + {# {% set sRowClass = "even" %} #} + {# {% endif %} #} + + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + + {# {% if loop.last %} #} + {#
{{ 'Class:ModuleInstallation/Attribute:name'|dict_s }}{{ 'Class:ModuleInstallation/Attribute:version'|dict_s }}{{ 'Class:ModuleInstallation/Attribute:installed'|dict_s }}{{ 'Class:ModuleInstallation/Attribute:comment'|dict_s }}
{{ aInstall.name }}{{ aInstall.version }}{{ aInstall.installed }}{{ aInstall.comment }}
#} + {# {% endif %} #} + {# {% endfor %} #} + {#
#} +{% EndUIFieldSet %} +{% EndUIContentBlock %} + + {% EndUIContentBlock %} {# #} diff --git a/sources/application/TwigBase/UI/Component/FieldSet/UIFieldSetNode.php b/sources/application/TwigBase/UI/Component/FieldSet/UIFieldSetNode.php index 27a575aaf..7f0541666 100644 --- a/sources/application/TwigBase/UI/Component/FieldSet/UIFieldSetNode.php +++ b/sources/application/TwigBase/UI/Component/FieldSet/UIFieldSetNode.php @@ -29,8 +29,8 @@ class UIFieldSetNode extends Node ->subcompile($oParams) ->raw(";\n") ->write("\$sLegend = \$aParams['legend'] ?? '';\n") - ->write("\$sName = \$aParams['value'] ?? null;\n") - ->write("\${$sBlockVar} = new Combodo\\iTop\\Application\\UI\\Base\\Component\\FieldSet\\FieldSet(\$sLegend, \$sName);\n") + ->write("\$sId = \$aParams['id'] ?? null;\n") + ->write("\${$sBlockVar} = new Combodo\\iTop\\Application\\UI\\Base\\Component\\FieldSet\\FieldSet(\$sLegend, \$sId);\n") ->write(UIBlockHelper::AddToParentBlock($sBlockVar)) ->write(UIBlockHelper::PushParentBlock($sBlockVar)) ->subcompile($this->getNode('body')) diff --git a/sources/application/TwigBase/UI/Layout/UIContentBlockNode.php b/sources/application/TwigBase/UI/Layout/UIContentBlockNode.php index f170c45a7..e93be42c4 100644 --- a/sources/application/TwigBase/UI/Layout/UIContentBlockNode.php +++ b/sources/application/TwigBase/UI/Layout/UIContentBlockNode.php @@ -14,19 +14,24 @@ use Twig\Node\Node; class UIContentBlockNode extends Node { - public function __construct($sName, $sContainerClass, $oBody, $lineno = 0, $tag = null) + public function __construct($oParams, $oBody, $lineno = 0, $tag = null) { - parent::__construct(['body' => $oBody], ['name' => $sName, 'container_class' => $sContainerClass], $lineno, $tag); + parent::__construct(['body' => $oBody], ['params' => $oParams], $lineno, $tag); } public function compile(Compiler $compiler) { $sBlockVar = UIBlockHelper::GetBlockVarName('oContentBlock'); - $sName = empty($this->getAttribute('name')) ? 'null' : "'".$this->getAttribute('name')."'"; - $sContainerClass = $this->getAttribute('container_class'); + $oParams = $this->getAttribute('params'); + $compiler ->addDebugInfo($this) - ->write("\${$sBlockVar} = new Combodo\\iTop\\Application\\UI\\Base\\Layout\\UIContentBlock({$sName}, '{$sContainerClass}');\n") + ->write("\$aParams = ") + ->subcompile($oParams) + ->raw(";\n") + ->write("\$sId = \$aParams['id'] ?? null;\n") + ->write("\$sContainerClass = \$aParams['container_class'] ?? '';\n") + ->write("\${$sBlockVar} = new Combodo\\iTop\\Application\\UI\\Base\\Layout\\UIContentBlock(\$sId, \$sContainerClass);\n") ->write(UIBlockHelper::AddToParentBlock($sBlockVar)) ->write(UIBlockHelper::PushParentBlock($sBlockVar)) ->subcompile($this->getNode('body')) diff --git a/sources/application/TwigBase/UI/Layout/UIContentBlockParser.php b/sources/application/TwigBase/UI/Layout/UIContentBlockParser.php index b509496bd..ba9fff348 100644 --- a/sources/application/TwigBase/UI/Layout/UIContentBlockParser.php +++ b/sources/application/TwigBase/UI/Layout/UIContentBlockParser.php @@ -22,20 +22,14 @@ class UIContentBlockParser extends AbstractTokenParser $iLineno = $token->getLine(); $oStream = $this->parser->getStream(); - $sName = null; - if ($oStream->test(Token::STRING_TYPE)) { - $sName = $oStream->expect(Token::STRING_TYPE)->getValue(); - } - $sContainerClass = ''; - if ($oStream->test(Token::STRING_TYPE)) { - $sContainerClass = $oStream->expect(Token::STRING_TYPE)->getValue(); - } + $oParams = $this->parser->getExpressionParser()->parseExpression(); + $oStream->expect(Token::BLOCK_END_TYPE); $oBody = $this->parser->subparse([$this, 'decideForEnd'], true); $oStream->expect(Token::BLOCK_END_TYPE); - return new UIContentBlockNode($sName, $sContainerClass, $oBody, $iLineno, $this->getTag()); + return new UIContentBlockNode($oParams, $oBody, $iLineno, $this->getTag()); } /** diff --git a/sources/application/TwigBase/UI/UIBlockHelper.php b/sources/application/TwigBase/UI/UIBlockHelper.php index 78fede052..f2ea3a394 100644 --- a/sources/application/TwigBase/UI/UIBlockHelper.php +++ b/sources/application/TwigBase/UI/UIBlockHelper.php @@ -12,7 +12,7 @@ class UIBlockHelper { public static function PushParentBlock($sBlockVarName) { - return "\$context['UIBlockParent'][] = \${$sBlockVarName};\n"; + return "array_push(\$context['UIBlockParent'], \${$sBlockVarName});\n"; } public static function PopParentBlock()