| | |
| | | $OUTPUT->add_label('from', 'to'); |
| | | |
| | | // add id to message list table if not specified |
| | | if (!strlen($attrib['id'])) |
| | | if (!strlen($attrib['id'])) { |
| | | $attrib['id'] = 'rcubemessagelist'; |
| | | } |
| | | |
| | | // define list of cols to be displayed based on parameter or config |
| | | if (empty($attrib['columns'])) { |
| | |
| | | if (!empty($header->list_cols) && is_array($header->list_cols)) |
| | | $a_msg_cols = array_merge($a_msg_cols, $header->list_cols); |
| | | |
| | | $OUTPUT->command('add_message_row', |
| | | $header->uid, |
| | | $a_msg_cols, |
| | | $a_msg_flags, |
| | | $insert_top); |
| | | $OUTPUT->command('add_message_row', $header->uid, $a_msg_cols, $a_msg_flags, $insert_top); |
| | | } |
| | | |
| | | if ($RCMAIL->storage->get_threading()) { |
| | |
| | | { |
| | | global $OUTPUT; |
| | | |
| | | if (empty($attrib['id'])) |
| | | if (empty($attrib['id'])) { |
| | | $attrib['id'] = 'rcmailcontentwindow'; |
| | | } |
| | | |
| | | return $OUTPUT->frame($attrib, true); |
| | | } |
| | |
| | | { |
| | | global $RCMAIL; |
| | | |
| | | if (!$attrib['id']) |
| | | if (!$attrib['id']) { |
| | | $attrib['id'] = 'rcmcountdisplay'; |
| | | } |
| | | |
| | | $RCMAIL->output->add_gui_object('countdisplay', $attrib['id']); |
| | | |
| | |
| | | |
| | | $page_size = $RCMAIL->storage->get_pagesize(); |
| | | $start_msg = ($page-1) * $page_size + 1; |
| | | $max = $count; |
| | | |
| | | if ($count !== null) |
| | | $max = $count; |
| | | else if ($RCMAIL->action) |
| | | $max = $RCMAIL->storage->count(NULL, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL'); |
| | | if ($max === null && $RCMAIL->action) { |
| | | $max = $RCMAIL->storage->count(null, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL'); |
| | | } |
| | | |
| | | if ($max == 0) |
| | | if (!$max) { |
| | | $out = $RCMAIL->storage->get_search_set() ? $RCMAIL->gettext('nomessages') : $RCMAIL->gettext('mailboxempty'); |
| | | else |
| | | } |
| | | else { |
| | | $out = $RCMAIL->gettext(array('name' => $RCMAIL->storage->get_threading() ? 'threadsfromto' : 'messagesfromto', |
| | | 'vars' => array('from' => $start_msg, |
| | | 'to' => min($max, $start_msg + $page_size - 1), |
| | | 'count' => $max))); |
| | | } |
| | | |
| | | return rcube::Q($out); |
| | | } |
| | |
| | | { |
| | | global $RCMAIL; |
| | | |
| | | if (!$attrib['id']) |
| | | if (!$attrib['id']) { |
| | | $attrib['id'] = 'rcmmailboxname'; |
| | | } |
| | | |
| | | $RCMAIL->output->add_gui_object('mailboxname', $attrib['id']); |
| | | |
| | |
| | | global $RCMAIL; |
| | | |
| | | $old_unseen = rcmail_get_unseen_count($mbox_name); |
| | | $unseen = $count; |
| | | |
| | | if ($count === null) |
| | | if ($unseen === null) { |
| | | $unseen = $RCMAIL->storage->count($mbox_name, 'UNSEEN', $force); |
| | | else |
| | | $unseen = $count; |
| | | } |
| | | |
| | | if ($unseen != $old_unseen || ($mbox_name == 'INBOX')) |
| | | if ($unseen != $old_unseen || ($mbox_name == 'INBOX')) { |
| | | $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen, |
| | | ($mbox_name == 'INBOX'), $unseen && $mark ? $mark : ''); |
| | | } |
| | | |
| | | rcmail_set_unseen_count($mbox_name, $unseen); |
| | | |
| | |
| | | |
| | | // now check for evil strings like expression, behavior or url() |
| | | if (!preg_match('/expression|behavior|javascript:|import[^a]/i', $stripped)) { |
| | | if (!$washtml->get_config('allow_remote') && stripos($stripped, 'url(')) |
| | | if (!$washtml->get_config('allow_remote') && stripos($stripped, 'url(')) { |
| | | $washtml->extlinks = true; |
| | | else |
| | | } |
| | | else { |
| | | $out = html::tag('style', array('type' => 'text/css'), $content); |
| | | } |
| | | break; |
| | | } |
| | | |
| | |
| | | $output_headers = array(); |
| | | |
| | | foreach ($standard_headers as $hkey) { |
| | | $ishtml = false; |
| | | |
| | | if ($headers[$hkey]) |
| | | $value = $headers[$hkey]; |
| | | else if ($headers['others'][$hkey]) |
| | |
| | | if (in_array($hkey, $exclude_headers)) |
| | | continue; |
| | | |
| | | $ishtml = false; |
| | | $header_title = $RCMAIL->gettext(preg_replace('/(^mail-|-)/', '', $hkey)); |
| | | |
| | | if ($hkey == 'date') { |
| | |
| | | } |
| | | } |
| | | else if ($hkey == 'mail-reply-to') { |
| | | if ($headers['mail-replyto'] != $headers['reply-to'] |
| | | && $headers['reply-to'] != $headers['from'] |
| | | if ($headers['mail-replyto'] != $headers['replyto'] |
| | | && $headers['replyto'] != $headers['from'] |
| | | ) { |
| | | $header_value = rcmail_address_string($value, $attrib['max'], true, |
| | | $attrib['addicon'], $headers['charset'], $header_title); |
| | |
| | | $attrib['addicon'], $headers['charset'], $header_title); |
| | | $ishtml = true; |
| | | } |
| | | else if ($hkey == 'subject' && empty($value)) |
| | | else if ($hkey == 'subject' && empty($value)) { |
| | | $header_value = $RCMAIL->gettext('nosubject'); |
| | | } |
| | | else { |
| | | $value = is_array($value) ? implode(' ', $value) : $value; |
| | | $header_value = trim(rcube_mime::decode_header($value, $headers['charset'])); |
| | |
| | | function rcmail_wrap_and_quote($text, $length = 72) |
| | | { |
| | | // Rebuild the message body with a maximum of $max chars, while keeping quoted message. |
| | | $max = max(75, $length + 8); |
| | | $max = max(75, $length + 8); |
| | | $lines = preg_split('/\r?\n/', trim($text)); |
| | | $out = ''; |
| | | $out = ''; |
| | | |
| | | foreach ($lines as $line) { |
| | | // don't wrap already quoted lines |
| | |
| | | $newline = ''; |
| | | |
| | | foreach (explode("\n", rcube_mime::wordwrap($line, $length - 2)) as $l) { |
| | | if (strlen($l)) |
| | | $newline .= '> ' . $l . "\n"; |
| | | else |
| | | $newline .= ">\n"; |
| | | $newline .= strlen($l) ? "> $l\n" : ">\n"; |
| | | } |
| | | |
| | | $line = rtrim($newline); |
| | |
| | | { |
| | | $parts = array(); |
| | | foreach ($p as $key => $val) { |
| | | $encode = $key == 'folder' || strpos($val, ';') !== false; |
| | | $encode = $key == 'folder' || strpos($val, ';') !== false; |
| | | $parts[] = $key . '=' . ($encode ? 'B::' . base64_encode($val) : $val); |
| | | } |
| | | |