summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorThomas B. <thomas@roundcube.net>2013-09-16 10:47:24 -0700
committerThomas B. <thomas@roundcube.net>2013-09-16 10:47:24 -0700
commit0201298cd8f767389789f7c35897985d4475836a (patch)
tree49ba49fade3e2dd998a569e1694c5e31ad301af3 /program/steps
parentb5c364273d7b026c0deda2326018aabff8bec73c (diff)
parent153e455f6566cb7a4349b7f2197e842d6ec9bf90 (diff)
Merge pull request #118 from Dennis1993/patch-12
Added support for default font size and fix legacy code for default font
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/compose.inc3
-rw-r--r--program/steps/mail/sendmail.inc6
-rw-r--r--program/steps/settings/func.inc25
-rw-r--r--program/steps/settings/save_prefs.inc1
4 files changed, 23 insertions, 12 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 39dca3b03..30c9f79fb 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -148,6 +148,9 @@ if ($font && !is_array($font)) {
$OUTPUT->set_env('default_font', $font);
}
+// default font size for HTML editor
+$OUTPUT->set_env('default_font_size', $RCMAIL->config->get('default_font_size'));
+
// get reference message and set compose mode
if ($msg_uid = $COMPOSE['param']['draft_uid']) {
$compose_mode = RCUBE_COMPOSE_DRAFT;
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 779fb87cd..8fe149611 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -473,8 +473,10 @@ $isHtml = (bool) get_input_value('_is_html', RCUBE_INPUT_POST);
$message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset);
if ($isHtml) {
- $font = rcube_fontdefs($RCMAIL->config->get('default_font'));
- $bstyle = $font && is_string($font) ? " style='font-family: $font'" : '';
+ $font = rcube_fontdefs($RCMAIL->config->get('default_font'));
+ $font = $font && is_string($font) ? ' '.$font : NULL;
+ $font_size = $RCMAIL->config->get('default_font_size');
+ $bstyle = " style='font: ".$font_size.$font.";'";
// append doctype and html/body wrappers
$message_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">' .
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index ecd35e94b..b492c9644 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -844,23 +844,28 @@ function rcmail_user_prefs($current = null)
continue 2;
}
+ // Default font size
+ $field_id = 'rcmfd_default_font_size';
+ $select_default_font_size = new html_select(array('name' => '_default_font_size', 'id' => $field_id));
+
+ $fontsizes = array('8pt', '10pt', '12pt', '14pt', '18pt', '24pt', '36pt');
+ foreach ($fontsizes as $size) {
+ $select_default_font_size->add($size, $size);
+ }
+
+ // Default font
$field_id = 'rcmfd_default_font';
- $fonts = rcube_fontdefs();
- $selected = $config['default_font'];
+ $select_default_font = new html_select(array('name' => '_default_font', 'id' => $field_id));
- $select = '<select name="_default_font" id="'.$field_id.'">';
- $select .= '<option value=""' . (!$selected ? ' selected="selected"' : '') . '>---</option>';
+ $fonts = rcube_fontdefs();
foreach ($fonts as $fname => $font) {
- $select .= '<option value="'.$fname.'"'
- . ($fname == $selected ? ' selected="selected"' : '')
- . ' style=\'font-family: ' . $font . '\'>'
- . Q($fname) . '</option>';
+ $select_default_font->add($fname, $fname);
}
- $select .= '</select>';
$blocks['main']['options']['default_font'] = array(
'title' => html::label($field_id, Q(rcube_label('defaultfont'))),
- 'content' => $select
+ 'content' => $select_default_font_size->show($RCMAIL->config->get('default_font_size', 1)).
+ $select_default_font->show($RCMAIL->config->get('default_font', 1))
);
}
break;
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index 3e8b1d17e..717c7ad8c 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -89,6 +89,7 @@ switch ($CURR_SECTION)
'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0,
'strip_existing_sig' => isset($_POST['_strip_existing_sig']),
'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST),
+ 'default_font_size' => get_input_value('_default_font_size', RCUBE_INPUT_POST),
'forward_attachment' => !empty($_POST['_forward_attachment']),
);