if($dom->find('div[id=main]', 0)) {
// _debug('div[id=main] is found !!!!', 'SIMPLEHTMLDOM');
$dom->find('div[id=main]', 0)->innertext= $body_field;
$html = $dom->save(); // we finally save changes to apply them
}
// @todo to remove
// we check if a div #inputs is already present in body_field
// if yes we remove div ID in default template t
// if($dom_field->find('div[id=inputs]', 0)) {
// // _debug('div[id=inputs] is found !!!!', 'SIMPLEHTMLDOM');
// $dom->find('div[id=inputs]', 0)->id= null; // we rename div[id=inputs] to new random id if found
// $html = $dom->save(); // we finally save changes to apply them
// }
// ##CONTENTS## placeholder is not used anymore but we replace itdynamically for old config
// instead we use if($dom->find('div[id=main]', 0)), see above
$form_body = str_replace('##CONTENTS##', '', $html); // @todo not used anymore since 2.6 - remove later
$form_statut=$result[0]['newsletter_statut'];
$news_owner = $result[0]['newsletter_posted_by'];
//////////// Check Droits utilisateur + statut newsletter courante ////////////
if (!$l21auth->isSuperAdmin()) ReloadIndex('admin');
////////////
// radio statut
if($form_statut=='W') $mask_statut_W='checked="checked"';
if($form_statut=='D') $mask_statut_D='checked="checked"';
if(isset($_POST['valider'])) {
$table = array();
$table[0]=$_POST['newsletter_title'];
$html = $_POST['newsletter_body'];
if (version_compare(phpversion(), '7.4.0', '<')) {
if (get_magic_quotes_gpc()) $html=stripslashes($html);
}
$html = removeEmptyP($html);
// we get only the text contained into #main div
$flow = str_get_html($html);
$body_content = $flow->find('#main', 0)->innertext;
$table[1]=$body_content;
$table[2]=$_POST['newsletter_statut'];
$integrity=$newsletter_object->CheckDataIntegrity($table);
if(is_string($integrity)) {
$text_format='2FIELD';
$body_content=$_POST['newsletter_body'];
} else {
$text_format='2HTML';
}
$form_title=formatText($_POST['newsletter_title'],$text_format);
$form_body=formatText($body_content, $text_format);
$form_statut=$_POST['newsletter_statut'];
if($_POST['newsletter_statut']=='D') $mask_statut_D='checked="checked"'; else $mask_statut_D='';
if($_POST['newsletter_statut']=='P') $mask_statut_P='checked="checked"'; else $mask_statut_W='';
$table=urlencode(serialize($table));
}
?>