| +-----------------------------------------------------------------------+ $Id: func.inc 429 2006-12-22 22:26:24Z thomasb $ */ 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'; if (empty($_SESSION['mbox'])){ $_SESSION['mbox'] = $IMAP->get_mailbox_name(); } // 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']; } // set mailbox to INBOX if not set if (empty($_SESSION['mbox'])) $_SESSION['mbox'] = $IMAP->get_mailbox_name(); // set default sort col/order to session if (!isset($_SESSION['sort_col'])) $_SESSION['sort_col'] = $CONFIG['message_sort_col']; if (!isset($_SESSION['sort_order'])) $_SESSION['sort_order'] = $CONFIG['message_sort_order']; // 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'])); if ($CONFIG['drafts_mbox']) $OUTPUT->add_script(sprintf("%s.set_env('drafts_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['drafts_mbox'])); if ($CONFIG['junk_mbox']) $OUTPUT->add_script(sprintf("%s.set_env('junk_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['junk_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; static $a_mailboxes; // add some labels to client rcube_add_label('purgefolderconfirm'); // $mboxlist_start = rcube_timer(); $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