mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (remove UIHtml from twig)
This commit is contained in:
@@ -38,7 +38,11 @@ class UIBlockNode extends Node
|
||||
$oParams = $this->getAttribute('params');
|
||||
$compiler
|
||||
->addDebugInfo($this)
|
||||
->write("\$aParams = ")
|
||||
->write("\$sHtml = trim(ob_get_contents());\n")
|
||||
->write("ob_end_clean();\n")
|
||||
->write("if (strlen(\$sHtml) > 0) {\n")
|
||||
->indent()->write("end(\$context['UIBlockParent'])->AddSubBlock(new \Combodo\iTop\Application\UI\Base\Component\Html\Html(\$sHtml));\n")->outdent()
|
||||
->write("}\n") ->write("\$aParams = ")
|
||||
->subcompile($oParams)
|
||||
->raw(";\n");
|
||||
|
||||
@@ -107,8 +111,15 @@ class UIBlockNode extends Node
|
||||
if ($oSubNode) {
|
||||
$compiler
|
||||
->write("array_push(\$context['UIBlockParent'], \${$sBlockVar});\n")
|
||||
->write("ob_start();\n")
|
||||
->subcompile($oSubNode)
|
||||
->write("\$sHtml = trim(ob_get_contents());\n")
|
||||
->write("ob_end_clean();\n")
|
||||
->write("if (strlen(\$sHtml) > 0) {\n")
|
||||
->indent()->write("end(\$context['UIBlockParent'])->AddSubBlock(new \Combodo\iTop\Application\UI\Base\Component\Html\Html(\$sHtml));\n")->outdent()
|
||||
->write("}\n")
|
||||
->write("array_pop(\$context['UIBlockParent']);\n");
|
||||
}
|
||||
$compiler->write("ob_start();\n");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user