Fix image of layout

This commit is contained in:
Laurent Destailleur 2026-04-29 01:19:32 +02:00
parent a300fcb8d9
commit 7989c723b4

View file

@ -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 .= '<div class="template-option" data-template="'.$template.'" data-content="'.htmlentities($contentHtml).'">';
$out .= '<img class="maillayout" alt="'.$template.'" src="'.DOL_URL_ROOT.'/theme/common/maillayout/'.$template.'.png" />';
$out .= '<img class="maillayout" alt="'.$template.'" src="'.DOL_URL_ROOT.'/theme/common/maillayout/'.($template === 'empty' ? 'none' : $template).'.png" />';
$out .= '<span class="template-option-text">'.($template != 'text' ? ucfirst($template) : ucfirst($templateFunction)).'</span>';
$out .= '</div>';
}