From 11cfdb2a17b7a5bce9edea10b0dd35b102a86801 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Wed, 4 Aug 2021 11:19:05 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03807=20Fix=20container=20added=20for=20a?= =?UTF-8?q?ll=20Html=20components=20This=20was=20causing=20issues=20for=20?= =?UTF-8?q?example=20in=20the=20setup,=20as=20any=20raw=20content=20is=20s?= =?UTF-8?q?ent=20using=20\WebPage::add,=20which=20create=20an=20HTML=20com?= =?UTF-8?q?ponent.=20I=20reverted=20the=20layout=20update,=20and=20created?= =?UTF-8?q?=20a=20new=20factory=20method=20to=20be=20used=20when=20needed?= =?UTF-8?q?=20:=20\Combodo\iTop\Application\UI\Base\Component\Html\HtmlFac?= =?UTF-8?q?tory::MakeHtmlContent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Base/Component/Html/HtmlFactory.php | 12 ++++++++++++ templates/base/components/html/layout.html.twig | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sources/application/UI/Base/Component/Html/HtmlFactory.php b/sources/application/UI/Base/Component/Html/HtmlFactory.php index 869480cfb..bdbb0f47f 100644 --- a/sources/application/UI/Base/Component/Html/HtmlFactory.php +++ b/sources/application/UI/Base/Component/Html/HtmlFactory.php @@ -50,4 +50,16 @@ class HtmlFactory { return new Html('

'.$sContent.'

'); } + + /** + * Create a container for contents having multiple HTML tags, for which we want to preserve style and don't apply minireset + * + * @param string $sContent + * + * @return \Combodo\iTop\Application\UI\Base\Component\Html\Html + */ + public static function MakeHtmlContent(string $sContent): Html + { + return new Html('
'.$sContent.'
'); + } } \ No newline at end of file diff --git a/templates/base/components/html/layout.html.twig b/templates/base/components/html/layout.html.twig index a5b8f3a48..ef12b8056 100644 --- a/templates/base/components/html/layout.html.twig +++ b/templates/base/components/html/layout.html.twig @@ -1 +1 @@ -
{{ oUIBlock.GetHtml()|raw }}
\ No newline at end of file +{{ oUIBlock.GetHtml()|raw }} \ No newline at end of file