summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-30 16:19:51 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-30 16:19:51 +0000
commit42ab7c04862ecd06ee178e005fa41d3654256f1b (patch)
tree941bc2bbac116293cad1b3ce24071cfdabc509a4 /roundcubemail/program/steps/mail/sendmail.inc
parentbc3f3685c81b2ce62ac8e0e35f5fb5e22e318b94 (diff)
- Add option to force spellchecking before sending a message (#1485458)
git-svn-id: https://svn.roundcube.net/trunk@4816 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/sendmail.inc')
-rw-r--r--roundcubemail/program/steps/mail/sendmail.inc17
1 files changed, 17 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/sendmail.inc b/roundcubemail/program/steps/mail/sendmail.inc
index a492e937c..de971a25a 100644
--- a/roundcubemail/program/steps/mail/sendmail.inc
+++ b/roundcubemail/program/steps/mail/sendmail.inc
@@ -409,6 +409,22 @@ if (!$savedraft) {
"\r\n<html><body>\r\n" . $message_body;
}
+ // Check spelling before send
+ if ($CONFIG['spellcheck_before_send'] && $CONFIG['enable_spellcheck']
+ && empty($_SESSION['compose']['spell_checked'])
+ ) {
+ $spellchecker = new rcube_spellchecker();
+ $spell_result = $spellchecker->check($message_body, $isHtml);
+
+ $_SESSION['compose']['spell_checked'] = true;
+
+ if (!$spell_result) {
+ $OUTPUT->show_message('mispellingsfound', 'error');
+ $OUTPUT->command('command', 'spellcheck');
+ $OUTPUT->send('iframe');
+ }
+ }
+
// generic footer for all messages
if ($isHtml && !empty($CONFIG['generic_message_footer_html'])) {
$footer = file_get_contents(realpath($CONFIG['generic_message_footer_html']));
@@ -420,6 +436,7 @@ if (!$savedraft) {
if ($isHtml)
$footer = '<pre>'.$footer.'</pre>';
}
+
if ($footer)
$message_body .= "\r\n" . $footer;
if ($isHtml)