From 4e17e6c9dbac8991ee8b302cb2581241247dc8bc Mon Sep 17 00:00:00 2001 From: thomascube Date: Sun, 25 Sep 2005 14:18:03 +0000 Subject: Initial revision --- program/steps/mail/func.inc | 1101 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1101 insertions(+) create mode 100644 program/steps/mail/func.inc (limited to 'program/steps/mail/func.inc') diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc new file mode 100644 index 000000000..2109bed3a --- /dev/null +++ b/program/steps/mail/func.inc @@ -0,0 +1,1101 @@ + | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +require_once('lib/html2text.inc'); +require_once('lib/enriched.inc'); + + +$EMAIL_ADDRESS_PATTERN = '/([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})/i'; + +// set imap properties and session vars +if (strlen($_GET['_mbox'])) + { + $IMAP->set_mailbox($_GET['_mbox']); + $_SESSION['mbox'] = $_GET['_mbox']; + } + +if (strlen($_GET['_page'])) + { + $IMAP->set_page($_GET['_page']); + $_SESSION['page'] = $_GET['_page']; + } + + +// define url for getting message parts +if (strlen($_GET['_uid'])) + $GET_URL = sprintf('%s&_action=get&_mbox=%s&_uid=%d', $COMM_PATH, $IMAP->get_mailbox_name(), $_GET['_uid']); + + +// set current mailbox in client environment +$OUTPUT->add_script(sprintf("%s.set_env('mailbox', '%s');", $JS_OBJECT_NAME, $IMAP->get_mailbox_name())); + + +if ($CONFIG['trash_mbox']) + $OUTPUT->add_script(sprintf("%s.set_env('trash_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['trash_mbox'])); + + + +// return the mailboxlist in HTML +function rcmail_mailbox_list($attrib) + { + global $IMAP, $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $COMM_PATH; + static $s_added_script = FALSE; + + $type = $attrib['type'] ? $attrib['type'] : 'ul'; + $add_attrib = $type=='select' ? array('style', 'class', 'id', 'name', 'onchange') : + array('style', 'class', 'id'); + + if ($type=='ul' && !$attrib['id']) + $attrib['id'] = 'rcmboxlist'; + + // allow the following attributes to be added to the