protected function output() { $to = ''; $subject = ''; $body = ''; $files = $this->get('uploaded_files', array()); $cc = ''; $bcc = ''; $in_reply_to = ''; $recip = ''; $draft = $this->get('compose_draft', array()); $reply = $this->get('reply_details', array()); $reply_type = $this->get('reply_type', ''); $html = $this->get('smtp_compose_type', 0); if (!empty($reply)) { list($to, $cc, $subject, $body, $in_reply_to) = format_reply_fields($reply['msg_text'], $reply['msg_headers'], $reply['msg_struct'], $html, $this, $reply_type, Hm_SMTP_List::address_list()); $recip = get_primary_recipients($reply['msg_headers'], $this->get('smtp_servers', array())); } elseif (!empty($draft)) { $to = $draft['draft_to']; $subject = $draft['draft_subject']; $body = $draft['draft_body']; } $res = ''; if ($html == 1) { $res .= '<script type="text/javascript" src="modules/smtp/assets/kindeditor/kindeditor-all-min.js"></script>' . '<link href="modules/smtp/assets/kindeditor/themes/default/default.css" rel="stylesheet" />' . '<script type="text/javascript">KindEditor.ready(function(K) { K.create("#compose_body", {items:' . "['formatblock', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold'," . "'italic', 'underline', 'strikethrough', 'lineheight', 'table', 'hr', 'pagebreak', 'link', 'unlink'," . "'justifyleft', 'justifycenter', 'justifyright'," . "'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', '|'," . "'undo', 'redo', 'preview', 'print', '|', 'selectall', 'cut', 'copy', 'paste'," . "'plainpaste', 'wordpaste', '|', 'source', 'fullscreen']" . ",basePath: 'modules/smtp/assets/kindeditor/'" . '})});;</script>'; } $res .= '<div class="compose_page"><div class="content_title">' . $this->trans('Compose') . '</div>' . '<form class="compose_form" method="post" action="?page=compose">' . '<input type="hidden" name="hm_page_key" value="' . $this->html_safe(Hm_Request_Key::generate()) . '" />' . '<input type="hidden" name="compose_in_reply_to" value="' . $this->html_safe($in_reply_to) . '" />' . '<div class="to_outer"><input autocomplete="off" value="' . $this->html_safe($to) . '" required name="compose_to" class="compose_to" type="text" placeholder="' . $this->trans('To') . '" />' . '<a href="#" tabindex="-1" class="toggle_recipients">+</a></div><div id="to_contacts"></div>' . '<div class="recipient_fields"><input autocomplete="off" value="' . $this->html_safe($cc) . '" name="compose_cc" class="compose_cc" type="text" placeholder="' . $this->trans('Cc') . '" /><div id="cc_contacts"></div><input autocomplete="off" value="' . $this->html_safe($bcc) . '" name="compose_bcc" class="compose_bcc" type="text" placeholder="' . $this->trans('Bcc') . '" />' . '</div><div id="bcc_contacts"></div><input value="' . $this->html_safe($subject) . '" required name="compose_subject" class="compose_subject" type="text" placeholder="' . $this->trans('Subject') . '" /><textarea id="compose_body" name="compose_body" class="compose_body">' . $this->html_safe($body) . '</textarea><table class="uploaded_files">'; foreach ($files as $file) { $res .= format_attachment_row($file, $this); } $res .= '</table>' . smtp_server_dropdown($this->module_output(), $this, $recip) . '<input class="smtp_send" type="submit" value="' . $this->trans('Send') . '" name="smtp_send" />' . '<input class="smtp_save" type="button" value="' . $this->trans('Save') . '" />' . '<input class="smtp_reset" type="button" value="' . $this->trans('Reset') . '" />' . '<input class="compose_attach_button" value="' . $this->trans('Attach') . '" name="compose_attach_button" type="button" /></form>' . '<form enctype="multipart/form-data" class="compose_attach_form" />' . '<input class="compose_attach_file" type="file" name="compose_attach_file" />' . '<input type="hidden" name="compose_attach_page_id" value="ajax_smtp_attach_file" />' . '</form>' . '</div>'; return $res; }
protected function output() { $to = ''; $subject = ''; $body = ''; $draft = $this->get('compose_draft', array()); $reply = $this->get('reply_details', array()); $reply_type = $this->get('reply_type', ''); $html = $this->get('smtp_compose_type', 0); if (!empty($reply)) { list($to, $subject, $body) = format_reply_fields($reply['msg_text'], $reply['msg_headers'], $reply['msg_struct'], $html, $this, $reply_type); } elseif (!empty($draft)) { $to = $draft['draft_to']; $subject = $draft['draft_subject']; $body = $draft['draft_body']; } $res = ''; if ($html == 1) { $res .= '<script type="text/javascript" src="modules/smtp/assets/kindeditor/kindeditor-all-min.js"></script>' . '<link href="modules/smtp/assets/kindeditor/themes/default/default.css" rel="stylesheet" />' . '<script type="text/javascript">KindEditor.ready(function(K) { K.create("#compose_body", {items:' . "['formatblock', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold'," . "'italic', 'underline', 'strikethrough', 'lineheight', 'table', 'hr', 'pagebreak', 'link', 'unlink'," . "'justifyleft', 'justifycenter', 'justifyright'," . "'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', '|'," . "'undo', 'redo', 'preview', 'print', '|', 'selectall', 'cut', 'copy', 'paste'," . "'plainpaste', 'wordpaste', '|', 'source', 'fullscreen']" . ",basePath: 'modules/smtp/assets/kindeditor/'" . '})});;</script>'; } $res .= '<div class="compose_page"><div class="content_title">' . $this->trans('Compose') . '</div>' . '<form class="compose_form" method="post" action="?page=compose">' . '<input type="hidden" name="hm_page_key" value="' . $this->html_safe(Hm_Request_Key::generate()) . '" />' . '<input value="' . $this->html_safe($to) . '" required name="compose_to" class="compose_to" type="text" placeholder="' . $this->trans('To') . '" />' . '<input value="' . $this->html_safe($subject) . '" required name="compose_subject" class="compose_subject" type="text" placeholder="' . $this->trans('Subject') . '" />' . '<textarea novalidate id="compose_body" name="compose_body" class="compose_body">' . $this->html_safe($body) . '</textarea>' . smtp_server_dropdown($this->module_output(), $this) . '<input class="smtp_send" type="submit" value="' . $this->trans('Send') . '" name="smtp_send" />' . '<input class="smtp_reset" type="button" value="' . $this->trans('Reset') . '" /></form></div>'; return $res; }