Let the skin limit the number of visible recipeints and place a link to show them all in a dialog (better fix for #1488590)
| | |
| | | this.messages = {}; |
| | | }; |
| | | |
| | | // open a jquery UI dialog with the given content |
| | | this.show_popup_dialog = function(html, title) |
| | | { |
| | | // forward call to parent window |
| | | if (this.is_framed()) { |
| | | parent.rcmail.show_popup_dialog(html, title); |
| | | return; |
| | | } |
| | | |
| | | var popup = $('<div class="popup">') |
| | | .html(html) |
| | | .dialog({ |
| | | title: title, |
| | | modal: true, |
| | | resizable: true, |
| | | width: 580, |
| | | close: function(event, ui) { $(this).remove() } |
| | | }); |
| | | |
| | | // resize and center popup |
| | | var win = $(window), w = win.width(), h = win.height(), |
| | | width = popup.width(), height = popup.height(); |
| | | popup.dialog('option', { height: Math.min(h-40, height+50), width: Math.min(w-20, width+50) }) |
| | | .dialog('option', 'position', ['center', 'center']); // only works in a separate call (!?) |
| | | }; |
| | | |
| | | // enable/disable buttons for page shifting |
| | | this.set_page_buttons = function() |
| | | { |
| | |
| | | $labels['showimages'] = 'Display images'; |
| | | $labels['alwaysshow'] = 'Always show images from $sender'; |
| | | $labels['isdraft'] = 'This is a draft message.'; |
| | | $labels['andnmore'] = '$nr more...'; |
| | | |
| | | $labels['htmltoggle'] = 'HTML'; |
| | | $labels['plaintoggle'] = 'Plain text'; |
| | |
| | | if (in_array($hkey, $exclude_headers)) |
| | | continue; |
| | | |
| | | $header_title = rcube_label(preg_replace('/(^mail-|-)/', '', $hkey)); |
| | | |
| | | if ($hkey == 'date') { |
| | | if ($PRINT_MODE) |
| | | $header_value = format_date($value, $RCMAIL->config->get('date_long', 'x')); |
| | |
| | | } |
| | | else if ($hkey == 'replyto') { |
| | | if ($headers['replyto'] != $headers['from']) { |
| | | $header_value = rcmail_address_string($value, null, true, $attrib['addicon'], $headers['charset']); |
| | | $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title); |
| | | $ishtml = true; |
| | | } |
| | | else |
| | |
| | | if ($headers['mail-replyto'] != $headers['reply-to'] |
| | | && $headers['reply-to'] != $headers['from'] |
| | | ) { |
| | | $header_value = rcmail_address_string($value, null, true, $attrib['addicon'], $headers['charset']); |
| | | $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title); |
| | | $ishtml = true; |
| | | } |
| | | else |
| | | continue; |
| | | } |
| | | else if ($hkey == 'mail-followup-to') { |
| | | $header_value = rcmail_address_string($value, null, true, $attrib['addicon'], $headers['charset']); |
| | | $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title); |
| | | $ishtml = true; |
| | | } |
| | | else if (in_array($hkey, array('from', 'to', 'cc', 'bcc'))) { |
| | | $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset']); |
| | | $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title); |
| | | $ishtml = true; |
| | | } |
| | | else if ($hkey == 'subject' && empty($value)) |
| | |
| | | $header_value = trim(rcube_mime::decode_header($value, $headers['charset'])); |
| | | |
| | | $output_headers[$hkey] = array( |
| | | 'title' => rcube_label(preg_replace('/(^mail-|-)/', '', $hkey)), |
| | | 'title' => $header_title, |
| | | 'value' => $header_value, |
| | | 'raw' => $value, |
| | | 'html' => $ishtml, |
| | |
| | | /** |
| | | * decode address string and re-format it as HTML links |
| | | */ |
| | | function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, $default_charset=null) |
| | | function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, $default_charset=null, $title=null) |
| | | { |
| | | global $RCMAIL, $PRINT_MODE, $CONFIG; |
| | | |
| | |
| | | $c = count($a_parts); |
| | | $j = 0; |
| | | $out = ''; |
| | | $allvalues = array(); |
| | | |
| | | if ($addicon && !isset($_SESSION['writeable_abook'])) { |
| | | $_SESSION['writeable_abook'] = $RCMAIL->get_address_sources(true) ? true : false; |
| | |
| | | |
| | | foreach ($a_parts as $part) { |
| | | $j++; |
| | | |
| | | $name = $part['name']; |
| | | $mailto = $part['mailto']; |
| | | $string = $part['string']; |
| | |
| | | 'alt' => "Add contact", |
| | | ))); |
| | | } |
| | | $out .= html::span('adr', $address); |
| | | } |
| | | else { |
| | | $address = ''; |
| | |
| | | $address .= Q($name); |
| | | if ($mailto) |
| | | $address .= (strlen($address) ? ' ' : '') . sprintf('<%s>', Q($mailto)); |
| | | |
| | | $out .= html::span('adr', $address); |
| | | } |
| | | |
| | | if ($c>$j) |
| | | $out .= ','.($max ? ' ' : ' '); |
| | | $address = html::span('adr', $address); |
| | | $allvalues[] = $address; |
| | | |
| | | if ($max && $j==$max && $c>$j) { |
| | | $out .= '...'; |
| | | break; |
| | | if (!$moreadrs) |
| | | $out .= ($out ? ', ' : '') . $address; |
| | | |
| | | if ($max && $j == $max && $c > $j) { |
| | | if ($linked) { |
| | | $moreadrs = $c - $j; |
| | | } |
| | | else { |
| | | $out .= '...'; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if ($moreadrs) { |
| | | $out .= ' ' . html::a(array( |
| | | 'href' => '#more', |
| | | 'class' => 'morelink', |
| | | 'onclick' => sprintf("return %s.show_popup_dialog('%s','%s')", |
| | | JS_OBJECT_NAME, |
| | | JQ(join(', ', $allvalues)), |
| | | JQ($title)) |
| | | ), |
| | | Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))); |
| | | } |
| | | |
| | | return $out; |
| | | } |
| | | |