From daf85306a53c0088ed77d17260ca31aac4249179 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 4 May 2011 11:42:46 +0200 Subject: [PATCH] Send e-mail by Ctrl+Enter (Editor) --- adminer/static/functions.js | 15 ++++++++++----- editor/include/adminer.inc.php | 6 ++++-- editor/include/editing.inc.php | 4 ++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 687d66643..85253a7a1 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -190,16 +190,21 @@ function textareaKeydown(target, event) { return true; } -/** Send form by Enter on and
\n"; //! Ctrl+Enter for this.form.email - echo html_select("email_addition", $columns, $_POST["email_addition"]) . "\n"; //! JavaScript + echo "

\n"; //! Ctrl+Enter for this.form.email + echo "

" . html_select("email_addition", $columns, $_POST["email_addition"]) . "\n"; //! JavaScript echo "

" . lang('Attachments') . ": "; echo "

" . (count($emailFields) == 1 ? '' : html_select("email_field", $emailFields)); echo "\n"; + echo "\n"; echo "\n"; } } diff --git a/editor/include/editing.inc.php b/editor/include/editing.inc.php index 5699ed844..c3810833c 100644 --- a/editor/include/editing.inc.php +++ b/editor/include/editing.inc.php @@ -16,12 +16,12 @@ function email_header($header) { * @param array * @return bool */ -function send_mail($email, $subject, $message, $from = "", $files = array("error" => array())) { +function send_mail($email, $subject, $message, $from = "", $files = array()) { $eol = (strncasecmp(PHP_OS, "win", 3) ? "\n" : "\r\n"); // PHP_EOL available since PHP 4.3.10 and 5.0.2 $message = str_replace("\n", $eol, wordwrap(str_replace("\r", "", "$message\n"))); $boundary = uniqid("boundary"); $attachments = ""; - foreach ($files["error"] as $key => $val) { + foreach ((array) $files["error"] as $key => $val) { if (!$val) { $attachments .= "--$boundary$eol" . "Content-Type: " . str_replace("\n", "", $files["type"][$key]) . $eol