diff options
author | alecpl <alec@alec.pl> | 2008-11-03 14:26:23 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-11-03 14:26:23 +0000 |
commit | 79af0bb1ba370bd5f194afb692e7ed59a26b02af (patch) | |
tree | 3b070c6afaa03e0a9d26d6afdaff8bc9d767b678 /program/steps | |
parent | 3d54e6e9b7f65dcb01688d3933f7c6e4aac25a18 (diff) |
- Add warning when switching editor mode from html to plain (#1485488)
- Unified editor switching functions
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/mail/compose.inc | 10 | ||||
-rw-r--r-- | program/steps/settings/edit_identity.inc | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index df6f1ffae..758069acd 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -81,7 +81,9 @@ if (!is_array($_SESSION['compose']) || $_SESSION['compose']['id'] != get_input_v } // add some labels to client -$OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved', 'converting'); +$OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', + 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved', + 'converting', 'editorwarning'); // add config parameters to client script if (!empty($CONFIG['drafts_mbox'])) { @@ -848,9 +850,13 @@ function rcmail_editor_selector($attrib) if ($compose_mode) $useHtml = ($useHtml && $MESSAGE->has_html_part()); + $editorid = empty($attrib['editorid']) ? 'rcmComposeMessage' : $attrib['editorid']; + $selector = ''; $chosenvalue = $useHtml ? 'html' : 'plain'; - $radio = new html_radiobutton(array('name' => '_editorSelect', 'onclick' => 'return rcmail_toggle_editor(this)')); + $radio = new html_radiobutton(array('name' => '_editorSelect', + 'onclick' => "return rcmail.toggle_editor(this.value=='html', '$editorid', '_is_html')")); + foreach ($choices as $value => $text) { $attrib['id'] = '_' . $value; diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc index c8d448adb..e4bb50fea 100644 --- a/program/steps/settings/edit_identity.inc +++ b/program/steps/settings/edit_identity.inc @@ -72,7 +72,7 @@ function rcube_identity_form($attrib) "gecko_spellcheck : true });"); // add some labels to client - $OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting'); + $OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting', 'editorwarning'); $i_size = !empty($attrib['size']) ? $attrib['size'] : 40; $t_rows = !empty($attrib['textarearows']) ? $attrib['textarearows'] : 6; @@ -89,7 +89,7 @@ function rcube_identity_form($attrib) 'reply-to' => array('type' => 'text', 'label' => 'reply-to', 'size' => $i_size), 'bcc' => array('type' => 'text', 'size' => $i_size), 'signature' => array('type' => 'textarea', 'size' => $t_cols, 'rows' => $t_rows), - 'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this, \'rcmfd_signature\');'), + 'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this.checked, \'rcmfd_signature\');'), 'standard' => array('type' => 'checkbox', 'label' => 'setdefault')); // disable some field according to access level |