} if (isset($_GET['remove_attachment'])) { $mailing->removeAttachment($_GET['remove_attachment']); } if ($mailing->current_step !== Core\Mailing::STEP_SENT) { $session['mailing'] = serialize($mailing); } /** TODO: replace that... */ $session['labels'] = $mailing->unreachables; if (!isset($_POST['html_editor_active']) || trim($_POST['html_editor_active']) == '') { $_POST['html_editor_active'] = $preferences->pref_editor_enabled; } if (isset($_POST['mailing_save'])) { //user requested to save the mailing $histo = new Core\MailingHistory($mailing); if ($histo->storeMailing() !== false) { $success_detected[] = _T("Mailing has been successfully saved."); $tpl->assign('mailing_saved', true); $session['mailing'] = null; unset($session['mailing']); $head_redirect = array('timeout' => 30, 'url' => 'gestion_mailings.php'); $tpl->assign('head_redirect', $head_redirect); } } $tpl->assign('success_detected', $success_detected); $tpl->assign('warning_detected', $warning_detected); $tpl->assign('error_detected', $error_detected); $tpl->assign('mailing', $mailing); $tpl->assign('html_editor', true); $tpl->assign('html_editor_active', $_POST['html_editor_active']); }