diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 3cefeaef99c..42c3b36025b 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -176,7 +176,21 @@ class FormWebsite $langs->load("admin"); - $arrayofsamples=array('empty'=>'EmptyPage', 'corporatehome'=>'CorporateHomePage'); + $listofsamples = dol_dir_list(DOL_DOCUMENT_ROOT.'/website/samples', 'files', 0, '^page-sample-.*\.html$'); + + $arrayofsamples = array(); + $arrayofsamples['empty']='EmptyPage'; // Always this one first + foreach($listofsamples as $sample) + { + $reg = array(); + if (preg_match('/^page-sample-(.*)\.html$/', $sample['name'], $reg)) + { + $key = $reg[1]; + $labelkey = ucfirst($key); + if ($key == 'empty') $labelkey = 'EmptyPage'; + $arrayofsamples[$key] = $labelkey; + } + } $out = ''; $out .= '