diff --git a/sources/Application/TwigBase/Controller/Controller.php b/sources/Application/TwigBase/Controller/Controller.php index 40b6347eec..7335ecc6a9 100644 --- a/sources/Application/TwigBase/Controller/Controller.php +++ b/sources/Application/TwigBase/Controller/Controller.php @@ -992,7 +992,7 @@ abstract class Controller extends AbstractController if (!in_array($sPageType, [self::ENUM_PAGE_TYPE_HTML, self::ENUM_PAGE_TYPE_AJAX, self::ENUM_PAGE_TYPE_TURBO_FORM_AJAX])) { return; } - $sContent = ''; + $aProfilesInfo = []; foreach (InterfaceDiscovery::GetInstance()->FindItopClasses(iProfilerExtension::class) as $sExtension) { /** @var \Combodo\iTop\Application\TwigBase\Controller\iProfilerExtension $oExtensionInstance */ $oExtensionInstance = $sExtension::GetInstance(); @@ -1011,17 +1011,17 @@ abstract class Controller extends AbstractController if (is_array($aSaas)) { $this->aSaas = array_merge($this->aSaas, $aSaas); } - $sContent .= $this->oTwig->render($sDebugTemplate, $aDebugParams); + $aProfilesInfo[] = ['sTemplate' => $sDebugTemplate, 'aProfileData' => $aDebugParams]; } } - if ($sContent === '') { + if (count($aProfilesInfo) === 0) { return; } if ($sPageType === self::ENUM_PAGE_TYPE_HTML || $sPageType === self::ENUM_PAGE_TYPE_AJAX) { - $this->AddToPage($this->oTwig->render('application/forms/itop_debug.html.twig', ['sProfilerContent' => $sContent])); + $this->AddToPage($this->oTwig->render('application/forms/itop_debug.html.twig', ['aProfilesInfo' => $aProfilesInfo])); } elseif ($sPageType === self::ENUM_PAGE_TYPE_TURBO_FORM_AJAX) { - $this->AddToPage($this->oTwig->render('application/forms/itop_debug_update.html.twig', ['sProfilerContent' => $sContent])); + $this->AddToPage($this->oTwig->render('application/forms/itop_debug_update.html.twig', ['aProfilesInfo' => $aProfilesInfo])); } } } diff --git a/templates/application/forms/itop_debug.html.twig b/templates/application/forms/itop_debug.html.twig index 8de1a923be..1c49ba96bb 100644 --- a/templates/application/forms/itop_debug.html.twig +++ b/templates/application/forms/itop_debug.html.twig @@ -3,6 +3,9 @@
- {{ sProfilerContent|raw }} + {% for aProfileInfo in aProfilesInfo %} + {% set aProfileData = aProfileInfo.aProfileData %} + {{ include(aProfileInfo.sTemplate) }} + {% endfor %}
\ No newline at end of file diff --git a/templates/application/forms/itop_debug_update.html.twig b/templates/application/forms/itop_debug_update.html.twig index 5aceb8a0f6..f1f099c87f 100644 --- a/templates/application/forms/itop_debug_update.html.twig +++ b/templates/application/forms/itop_debug_update.html.twig @@ -3,6 +3,9 @@ \ No newline at end of file