From 3f4521bcf4b538b6ac54817cfad22b51e347546d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 17 Jun 2015 03:03:03 -0400
Subject: [PATCH] Fix so plain text signature field uses monospace font (#1490435)

---
 program/steps/settings/edit_identity.inc |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc
index f208c8a..298822d 100644
--- a/program/steps/settings/edit_identity.inc
+++ b/program/steps/settings/edit_identity.inc
@@ -52,9 +52,9 @@
 $OUTPUT->include_script('list.js');
 $OUTPUT->add_handler('identityform', 'rcube_identity_form');
 $OUTPUT->set_env('identities_level', IDENTITIES_LEVEL);
-$OUTPUT->add_label('deleteidentityconfirm');
+$OUTPUT->add_label('deleteidentityconfirm', 'uploading');
 
-$OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action == 'add-identity' ? 'newidentity' : 'edititem')));
+$OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action == 'add-identity' ? 'addidentity' : 'editidentity')));
 
 if ($RCMAIL->action == 'add-identity' && $OUTPUT->template_exists('identityadd')) {
     $OUTPUT->send('identityadd');
@@ -71,7 +71,7 @@
     $RCMAIL->html_editor('identity');
 
     // add some labels to client
-    $OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting', 'editorwarning');
+    $OUTPUT->add_label('noemailwarning', 'converting', 'editorwarning');
 
     $i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
     $t_rows = !empty($attrib['textarearows']) ? $attrib['textarearows'] : 6;
@@ -96,7 +96,7 @@
                     'spellcheck' => true),
                 'html_signature' => array('type' => 'checkbox',
                     'label'   => $RCMAIL->gettext('htmlsignature'),
-                    'onclick' => 'return rcmail_toggle_editor(this, \'rcmfd_signature\');'),
+                    'onclick' => 'return rcmail.command(\'toggle-editor\', {id: \'rcmfd_signature\', html: this.checked}, \'\', event)'),
         ))
     );
 
@@ -107,6 +107,11 @@
 
         // Correctly handle HTML entities in HTML editor (#1488483)
         $IDENTITY_RECORD['signature'] = htmlspecialchars($IDENTITY_RECORD['signature'], ENT_NOQUOTES, RCUBE_CHARSET);
+    }
+
+    // hide "default" checkbox if only one identity is allowed
+    if (IDENTITIES_LEVEL > 1) {
+        unset($form['addressing']['content']['standard']);
     }
 
     // disable some field according to access level
@@ -176,5 +181,15 @@
 
     $out .= $form_end;
 
+    // add image upload form
+    $max_filesize   = $RCMAIL->upload_init($RCMAIL->config->get('identity_image_size', 64) * 1024);
+    $upload_form_id = 'identityImageUpload';
+
+    $out .= '<form id="' . $upload_form_id . '" style="display: none">'
+        . html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))))
+        . '</form>';
+
+    $RCMAIL->output->add_gui_object('uploadform', $upload_form_id);
+
     return $out;
 }

--
Gitblit v1.9.1