diff options
author | thomascube <thomas@roundcube.net> | 2008-04-12 13:54:45 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-04-12 13:54:45 +0000 |
commit | 47124c2279382714afd8dbe4a867a867ea179199 (patch) | |
tree | 9ce67f4521f466d8718604a23d74de1786189efd /program/steps/mail | |
parent | b00bd0f27d1c066d04fc8124c3a35465a5933ab1 (diff) |
Changed codebase to PHP5 with autoloader + added some new classes from the devel-vnext branch
Diffstat (limited to 'program/steps/mail')
-rw-r--r-- | program/steps/mail/addcontact.inc | 2 | ||||
-rw-r--r-- | program/steps/mail/compose.inc | 38 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 3 | ||||
-rw-r--r-- | program/steps/mail/get.inc | 2 | ||||
-rw-r--r-- | program/steps/mail/sendmail.inc | 13 | ||||
-rw-r--r-- | program/steps/mail/sendmdn.inc | 2 | ||||
-rw-r--r-- | program/steps/mail/show.inc | 23 |
7 files changed, 32 insertions, 51 deletions
diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc index 2cf190358..0ad10313b 100644 --- a/program/steps/mail/addcontact.inc +++ b/program/steps/mail/addcontact.inc @@ -19,8 +19,6 @@ */ -require_once('include/rcube_contacts.inc'); - $done = false; if (!empty($_POST['_address'])) diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index fd3743e2a..aaeca24dd 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -19,9 +19,6 @@ */ -require_once('Mail/mimeDecode.php'); -require_once('lib/html2text.inc'); - // define constants for message compose mode define('RCUBE_COMPOSE_REPLY', 0x0106); define('RCUBE_COMPOSE_FORWARD', 0x0107); @@ -159,14 +156,14 @@ function rcmail_compose_headers($attrib) } $allow_attrib = array('id', 'class', 'style', 'cols', 'rows', 'tabindex'); - $field_type = 'textarea'; + $field_type = 'html_textarea'; break; case 'replyto': case 'reply-to': $fname = '_replyto'; $allow_attrib = array('id', 'class', 'style', 'size', 'tabindex'); - $field_type = 'textfield'; + $field_type = 'html_inputfield'; break; } @@ -231,7 +228,7 @@ function rcmail_compose_headers($attrib) // create teaxtarea object $input = new $field_type($field_attrib); - $out = $input->show($fvalue); + $out = $input->show($fvalue); } if ($form_start) @@ -285,7 +282,7 @@ function rcmail_compose_header_from($attrib) $a_signatures = array(); $field_attrib['onchange'] = JS_OBJECT_NAME.".change_identity(this)"; - $select_from = new select($field_attrib); + $select_from = new html_select($field_attrib); while ($sql_arr = $DB->fetch_assoc($sql_result)) { @@ -327,7 +324,7 @@ function rcmail_compose_header_from($attrib) } else { - $input_from = new textfield($field_attrib); + $input_from = new html_inputfield($field_attrib); $out = $input_from->show($_POST['_from']); } @@ -419,19 +416,19 @@ function rcmail_compose_body($attrib) $out = $form_start ? "$form_start\n" : ''; - $saveid = new hiddenfield(array('name' => '_draft_saveid', 'value' => $compose_mode==RCUBE_COMPOSE_DRAFT ? str_replace(array('<','>'), "", $MESSAGE['headers']->messageID) : '')); + $saveid = new html_hiddenfield(array('name' => '_draft_saveid', 'value' => $compose_mode==RCUBE_COMPOSE_DRAFT ? str_replace(array('<','>'), "", $MESSAGE['headers']->messageID) : '')); $out .= $saveid->show(); - $drafttoggle = new hiddenfield(array('name' => '_draft', 'value' => 'yes')); + $drafttoggle = new html_hiddenfield(array('name' => '_draft', 'value' => 'yes')); $out .= $drafttoggle->show(); - $msgtype = new hiddenfield(array('name' => '_is_html', 'value' => ($isHtml?"1":"0"))); + $msgtype = new html_hiddenfield(array('name' => '_is_html', 'value' => ($isHtml?"1":"0"))); $out .= $msgtype->show(); // If desired, set this text area to be editable by TinyMCE if ($isHtml) $attrib['mce_editable'] = "true"; - $textarea = new textarea($attrib); + $textarea = new html_textarea($attrib); $out .= $textarea->show($body); $out .= $form_end ? "\n$form_end" : ''; @@ -622,7 +619,7 @@ function rcmail_compose_subject($attrib) unset($attrib['form']); $attrib['name'] = '_subject'; - $textfield = new textfield($attrib); + $textfield = new html_inputfield($attrib); $subject = ''; @@ -750,7 +747,7 @@ function rcmail_priority_selector($attrib) unset($attrib['form']); $attrib['name'] = '_priority'; - $selector = new select($attrib); + $selector = new html_select($attrib); $selector->add(array(rcube_label('lowest'), rcube_label('low'), @@ -781,7 +778,7 @@ function rcmail_receipt_checkbox($attrib) $attrib['name'] = '_receipt'; $attrib['value'] = '1'; - $checkbox = new checkbox($attrib); + $checkbox = new html_checkbox($attrib); $out = $form_start ? "$form_start\n" : ''; $out .= $checkbox->show($MESSAGE['headers']->mdn_to ? 1 : 0); @@ -828,7 +825,7 @@ function rcmail_editor_selector($attrib) unset($attrib['checked']); $attrib['id'] = '_' . $value; - $rb = new radiobutton($attrib); + $rb = new html_radiobutton($attrib); $selector .= sprintf("%s<label for=\"%s\">%s</label>", $rb->show($value), $attrib['id'], @@ -846,7 +843,7 @@ function get_form_tags($attrib) $form_start = ''; if (!strlen($MESSAGE_FORM)) { - $hiddenfields = new hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task'])); + $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task'])); $hiddenfields->add(array('name' => '_action', 'value' => 'send')); $form_start = empty($attrib['form']) ? '<form name="form" action="./" method="post">' : ''; @@ -862,7 +859,7 @@ function get_form_tags($attrib) $MESSAGE_FORM = $form_name; - return array($form_start, $form_end); + return array($form_start, $form_end); } @@ -881,9 +878,6 @@ $OUTPUT->add_handlers(array( /****** get contacts for this user and add them to client scripts ********/ -require_once('include/rcube_contacts.inc'); -require_once('include/rcube_ldap.inc'); - $CONTACTS = new rcube_contacts($DB, $USER->ID); $CONTACTS->set_pagesize(1000); @@ -928,5 +922,5 @@ if ($a_contacts) { $OUTPUT->set_env('contacts', $a_contacts); } -parse_template('compose'); +$OUTPUT->send('compose'); ?>
\ No newline at end of file diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 393fcaa10..205db2f91 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -19,7 +19,6 @@ */ -require_once('lib/html2text.inc'); require_once('lib/enriched.inc'); require_once('include/rcube_smtp.inc'); @@ -1541,7 +1540,7 @@ $OUTPUT->add_handlers(array( 'messagecontentframe' => 'rcmail_messagecontent_frame', 'messagepartframe' => 'rcmail_message_part_frame', 'messagepartcontrols' => 'rcmail_message_part_controls', - 'searchform' => 'rcmail_search_form' + 'searchform' => array($OUTPUT, 'search_form'), )); ?> diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index 6aca13101..06c22ec64 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -49,7 +49,7 @@ if ($_GET['_uid']) // show part page if ($_GET['_frame']) { - parse_template('messagepart'); + $OUTPUT->send('messagepart'); exit; } diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 5466d710c..2281a9773 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -5,7 +5,7 @@ | program/steps/mail/sendmail.inc | | | | This file is part of the RoundCube Webmail client | - | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland | + | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland | | Licensed under the GNU GPL | | | | PURPOSE: | @@ -21,11 +21,6 @@ */ -//require_once('lib/smtp.inc'); -require_once('lib/html2text.inc'); -require_once('lib/rc_mail_mime.inc'); - - if (!isset($_SESSION['compose']['id'])) { rcmail_overwrite_action('list'); @@ -70,7 +65,7 @@ function rcmail_get_identity($id) */ function rcmail_attach_emoticons(&$mime_message) { - global $CONFIG, $INSTALL_PATH; + global $CONFIG; $htmlContents = $mime_message->getHtmlBody(); @@ -100,7 +95,7 @@ function rcmail_attach_emoticons(&$mime_message) if (! in_array($image_name, $included_images)) { // add the image to the MIME message - $img_file = $INSTALL_PATH . '/' . $searchstr . $image_name; + $img_file = INSTALL_PATH . '/' . $searchstr . $image_name; if(! $mime_message->addHTMLImage($img_file, 'image/gif', '', true, '_' . $image_name)) $OUTPUT->show_message("emoticonerror", 'error'); @@ -237,7 +232,7 @@ $isHtmlVal = strtolower(get_input_value('_is_html', RCUBE_INPUT_POST)); $isHtml = ($isHtmlVal == "1"); // create extended PEAR::Mail_mime instance -$MAIL_MIME = new rc_mail_mime(rcmail_header_delm()); +$MAIL_MIME = new rcube_mail_mime(rcmail_header_delm()); // For HTML-formatted messages, construct the MIME message with both // the HTML part and the plain-text part diff --git a/program/steps/mail/sendmdn.inc b/program/steps/mail/sendmdn.inc index 530dcac4c..191f950c1 100644 --- a/program/steps/mail/sendmdn.inc +++ b/program/steps/mail/sendmdn.inc @@ -19,8 +19,6 @@ */ -require_once('lib/rc_mail_mime.inc'); - if (!empty($_POST['_uid'])) { $sent = rcmail_send_mdn(get_input_value('_uid', RCUBE_INPUT_POST)); diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index 94e4c6105..cc167009f 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -19,9 +19,6 @@ */ -require_once('Mail/mimeDecode.php'); -require_once('lib/rc_mail_mime.inc'); - $PRINT_MODE = $_action=='print' ? TRUE : FALSE; // similar code as in program/steps/mail/get.inc @@ -39,7 +36,7 @@ if ($_GET['_uid']) { $OUTPUT->show_message('messageopenerror', 'error'); if ($_action=='preview' && template_exists('messagepreview')) - parse_template('messagepreview'); + $OUTPUT->send('messagepreview'); else { $_action = 'list'; @@ -79,14 +76,14 @@ if ($_GET['_uid']) // mark message as read if (!$MESSAGE['headers']->seen) + { + $marked = $IMAP->set_flag($MESSAGE['UID'], 'SEEN'); + if($_action == 'preview' && $marked != -1) { - $marked = $IMAP->set_flag($MESSAGE['UID'], 'SEEN'); - if($_action == 'preview' && $marked != -1) - { - $OUTPUT->command('set_unread_count_from_preview', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'), ($mbox_name == 'INBOX')); - $OUTPUT->command('mark_as_read_from_preview', $MESSAGE['UID']); - } + $OUTPUT->command('set_unread_count_from_preview', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'), ($mbox_name == 'INBOX')); + $OUTPUT->command('mark_as_read_from_preview', $MESSAGE['UID']); } + } // give message uid to the client $OUTPUT->set_env('uid', $MESSAGE['UID']); @@ -207,9 +204,9 @@ $OUTPUT->add_handlers(array( if ($_action=='print' && template_exists('printmessage')) - parse_template('printmessage'); + $OUTPUT->send('printmessage'); else if ($_action=='preview' && template_exists('messagepreview')) - parse_template('messagepreview'); + $OUTPUT->send('messagepreview'); else - parse_template('message'); + $OUTPUT->send('message'); ?> |