From 7989c723b4fe5d3cab86bbfed0b8df145be2371c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Apr 2026 01:19:32 +0200 Subject: [PATCH] Fix image of layout --- htdocs/core/class/html.formwebsite.class.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 9bc9d5fe8e1..f2ac69198f6 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -349,6 +349,7 @@ class FormWebsite * * @param string $htmlContent HTML name of WYSIWYG field * @return string HTML for model page boxes + * @see getEmailLayoutSelector() */ public function getContentPageTemplate($htmlContent = 'message') { @@ -359,8 +360,12 @@ class FormWebsite require_once DOL_DOCUMENT_ROOT.'/core/lib/emaillayout.lib.php'; $listofsamples = dol_dir_list(DOL_DOCUMENT_ROOT.'/website/samples', 'files', 0, '^page-sample-.*\.html$'); - $arrayofsamples = array(); - $arrayofsamples['empty'] = 'EmptyPage'; // Always this one first + + // Define list of layouts to use + $arrayofsamples = array( + 'empty' => 'EmptyPage', + ); + foreach ($listofsamples as $sample) { $reg = array(); if (preg_match('/^page-sample-(.*)\.html$/', $sample['name'], $reg)) { @@ -391,7 +396,7 @@ class FormWebsite $contentHtml = file_exists($pathtoTemplateFile) ? make_substitutions(@file_get_contents($pathtoTemplateFile), $substitutionarray) : ''; $out .= '
'; - $out .= ''.$template.''; + $out .= ''.$template.''; $out .= ''.($template != 'text' ? ucfirst($template) : ucfirst($templateFunction)).''; $out .= '
'; }