| | |
| | | if ($header->flagged) |
| | | $a_msg_flags['flagged'] = 1; |
| | | |
| | | if ($browser->ie) |
| | | $a_msg_cols = rc_utf8_clean($a_msg_cols); |
| | | |
| | | $OUTPUT->command('add_message_row', |
| | | $header->uid, |
| | | $a_msg_cols, |
| | |
| | | |
| | | $OUTPUT->add_gui_object('quotadisplay', $attrib['id']); |
| | | |
| | | $quota = rcmail_quota_content(NULL, $attrib); |
| | | $quota = rcmail_quota_content($attrib); |
| | | |
| | | if (is_array($quota)) { |
| | | $OUTPUT->add_script('$(document).ready(function(){ |
| | | rcmail.set_quota('.json_encode($quota).')});', 'foot'); |
| | | rcmail.set_quota('.json_serialize($quota).')});', 'foot'); |
| | | $quota = ''; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | function rcmail_quota_content($quota=NULL, $attrib=NULL) |
| | | function rcmail_quota_content($attrib=NULL) |
| | | { |
| | | global $IMAP, $COMM_PATH, $RCMAIL; |
| | | global $COMM_PATH, $RCMAIL; |
| | | |
| | | $display = isset($_SESSION['quota_display']) ? $_SESSION['quota_display'] : ''; |
| | | |
| | | if (empty($quota)) { |
| | | if (!$IMAP->get_capability('QUOTA')) |
| | | return rcube_label('unknown'); |
| | | else |
| | | $quota = $IMAP->get_quota(); |
| | | } |
| | | $quota = $RCMAIL->imap->get_quota(); |
| | | $quota = $RCMAIL->plugins->exec_hook('quota', $quota); |
| | | |
| | | if ($quota && !($quota['total']==0 && $RCMAIL->config->get('quota_zero_as_unlimited'))) |
| | | if (!isset($quota['used']) || !isset($quota['total'])) |
| | | return rcube_label('unknown'); |
| | | |
| | | if (!($quota['total']==0 && $RCMAIL->config->get('quota_zero_as_unlimited'))) |
| | | { |
| | | if (!isset($quota['percent'])) |
| | | $quota['percent'] = min(100, round(($quota['used']/max(1,$quota['total']))*100)); |
| | | |
| | | $quota_result = sprintf('%s / %s (%.0f%%)', |
| | | show_bytes($quota['used'] * 1024), show_bytes($quota['total'] * 1024), |
| | | $quota['percent']); |
| | | |
| | | if ($display == 'image') { |
| | | $quota_result = array( |
| | | $quota_result = array( |
| | | 'percent' => $quota['percent'], |
| | | 'title' => $quota_result, |
| | | ); |
| | | |
| | | if ($attrib['width']) |
| | | $quota_result['width'] = $attrib['width']; |
| | | if ($attrib['height']) |
| | |
| | | return html::span($attrib, rcmail_get_mailbox_name_text()); |
| | | } |
| | | |
| | | |
| | | function rcmail_get_mailbox_name_text() |
| | | { |
| | | global $RCMAIL; |
| | |
| | | |
| | | return $unseen; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Sets message is_safe flag according to 'show_images' option value |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Cleans up the given message HTML Body (for displaying) |
| | | * |
| | |
| | | // special replacements (not properly handled by washtml class) |
| | | $html_search = array( |
| | | '/(<\/nobr>)(\s+)(<nobr>)/i', // space(s) between <NOBR> |
| | | '/<title>.*<\/title>/i', // PHP bug #32547 workaround: remove title tag |
| | | '/<title[^>]*>.*<\/title>/i', // PHP bug #32547 workaround: remove title tag |
| | | '/^(\0\0\xFE\xFF|\xFF\xFE\0\0|\xFE\xFF|\xFF\xFE|\xEF\xBB\xBF)/', // byte-order mark (only outlook?) |
| | | '/<html\s[^>]+>/i', // washtml/DOMDocument cannot handle xml namespaces |
| | | ); |
| | |
| | | |
| | | $html = $washer->wash($html); |
| | | $REMOTE_OBJECTS = $washer->extlinks; |
| | | |
| | | |
| | | return $html; |
| | | } |
| | | |
| | |
| | | |
| | | return $data['type'] == 'html' ? $data['body'] : html::tag('pre', array(), $data['body']); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Handle links and citation marks in plain text message |
| | |
| | | $tagname = $matches[2]; |
| | | |
| | | $tagname = preg_replace(array( |
| | | '/:.*$/', // Microsoft's Smart Tags <st1:xxxx> |
| | | '/[^a-z0-9_-]/i', // forbidden characters |
| | | '/:.*$/', // Microsoft's Smart Tags <st1:xxxx> |
| | | '/[^a-z0-9_\[\]\!-]/i', // forbidden characters |
| | | ), '', $tagname); |
| | | |
| | | return $matches[1].$tagname; |
| | |
| | | $attrib['href'] = "./bin/modcss.php?u=" . urlencode($attrib['href']) . "&c=" . urlencode($GLOBALS['rcmail_html_container_id']); |
| | | $end = ' />'; |
| | | } |
| | | else if (preg_match("/^mailto:$EMAIL_ADDRESS_PATTERN/i", $attrib['href'], $mailto)) { |
| | | else if (preg_match('/^mailto:'.$EMAIL_ADDRESS_PATTERN.'(\?[^"\'>]+)?/i', $attrib['href'], $mailto)) { |
| | | $attrib['href'] = $mailto[0]; |
| | | $attrib['onclick'] = sprintf( |
| | | "return %s.command('compose','%s',this)", |
| | | JS_OBJECT_NAME, |
| | | JQ($mailto[1])); |
| | | JQ($mailto[1].$mailto[2])); |
| | | } |
| | | else if (!empty($attrib['href']) && $attrib['href'][0] != '#') { |
| | | $attrib['target'] = '_blank'; |