From 84a7acd0f42e3c30c896d65699bbd4b1a3cedd41 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Sat, 28 Mar 2009 13:40:21 +0000 Subject: Implemented using a single image to display all icons via CSS positioning of the image in a div. --- roundcubemail/program/steps/mail/func.inc | 76 +++++++++++++------------------ 1 file changed, 31 insertions(+), 45 deletions(-) (limited to 'roundcubemail/program/steps/mail') diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc index 79e148d8a..c3320855d 100644 --- a/roundcubemail/program/steps/mail/func.inc +++ b/roundcubemail/program/steps/mail/func.inc @@ -169,10 +169,10 @@ function rcmail_message_list($attrib) switch ($col) { case 'flag': - $col_name = sprintf($image_tag, $skin_path, $attrib['unflaggedicon'], ''); + $col_name = '
'; break; case 'attachment': - $col_name = sprintf($image_tag, $skin_path, $attrib['attachmenticon'], ''); + $col_name = '
'; break; default: $col_name = Q(rcube_label($col)); @@ -259,30 +259,27 @@ function rcmail_message_list($attrib) $js_row_arr['flagged'] = true; // set message icon - if ($attrib['deletedicon'] && $header->deleted) - $message_icon = $attrib['deletedicon']; - else if ($attrib['repliedicon'] && $header->answered) + if ($header->deleted) + $message_icon = '
'; + else if ($header->answered) { - if ($attrib['forwardedrepliedicon'] && $header->forwarded) - $message_icon = $attrib['forwardedrepliedicon']; + if ($header->forwarded) + $message_icon = '
'; else - $message_icon = $attrib['repliedicon']; + $message_icon = '
'; } - else if ($attrib['forwardedicon'] && $header->forwarded) - $message_icon = $attrib['forwardedicon']; - else if ($attrib['unreadicon'] && !$header->seen) - $message_icon = $attrib['unreadicon']; - else if ($attrib['messageicon']) - $message_icon = $attrib['messageicon']; - - if ($attrib['flaggedicon'] && $header->flagged) - $flagged_icon = $attrib['flaggedicon']; - else if ($attrib['unflaggedicon'] && !$header->flagged) - $flagged_icon = $attrib['unflaggedicon']; - - // set attachment icon - if ($attrib['attachmenticon'] && preg_match("/multipart\/m/i", $header->ctype)) - $attach_icon = $attrib['attachmenticon']; + else if ($header->forwarded) + $message_icon = '
'; + else if (!$header->seen) + $message_icon = '
'; + else + $message_icon = '
'; + + // set attachment icons + if (preg_match("/multipart\/m/i", $header->ctype)) + $attach_icon = '
'; + else + $attach_icon = ' '; $out .= sprintf(''."\n", $header->uid, @@ -291,7 +288,7 @@ function rcmail_message_list($attrib) $header->flagged ? ' flagged' : '', $zebra_class); - $out .= sprintf("%s\n", $message_icon ? sprintf($image_tag, $skin_path, $message_icon, '') : ''); + $out .= sprintf("%s\n", $message_icon); $IMAP->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']); @@ -310,7 +307,7 @@ function rcmail_message_list($attrib) $cont = sprintf('%s', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), Q($cont)); } else if ($col=='flag') - $cont = $flagged_icon ? sprintf($image_tag, $skin_path, $flagged_icon, '') : ''; + $cont = '
'; else if ($col=='size') $cont = show_bytes($header->$col); else if ($col=='date') @@ -321,7 +318,7 @@ function rcmail_message_list($attrib) if ($col!='attachment') $out .= '' . $cont . "\n"; else - $out .= sprintf("%s\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : ' '); + $out .= '' . $attach_icon . "\n"; } $out .= "\n"; @@ -344,25 +341,14 @@ function rcmail_message_list($attrib) $OUTPUT->set_env('sort_col', $sort_col); $OUTPUT->set_env('sort_order', $sort_order); - if ($attrib['messageicon']) - $OUTPUT->set_env('messageicon', $skin_path . $attrib['messageicon']); - if ($attrib['deletedicon']) - $OUTPUT->set_env('deletedicon', $skin_path . $attrib['deletedicon']); - if ($attrib['unreadicon']) - $OUTPUT->set_env('unreadicon', $skin_path . $attrib['unreadicon']); - if ($attrib['repliedicon']) - $OUTPUT->set_env('repliedicon', $skin_path . $attrib['repliedicon']); - if ($attrib['forwardedicon']) - $OUTPUT->set_env('forwardedicon', $skin_path . $attrib['forwardedicon']); - if ($attrib['forwardedrepliedicon']) - $OUTPUT->set_env('forwardedrepliedicon', $skin_path . $attrib['forwardedrepliedicon']); - if ($attrib['attachmenticon']) - $OUTPUT->set_env('attachmenticon', $skin_path . $attrib['attachmenticon']); - if ($attrib['flaggedicon']) - $OUTPUT->set_env('flaggedicon', $skin_path . $attrib['flaggedicon']); - if ($attrib['unflaggedicon']) - $OUTPUT->set_env('unflaggedicon', $skin_path . $attrib['unflaggedicon']); - + $OUTPUT->set_env('messageicon', '
'); + $OUTPUT->set_env('deletedicon', '
'); + $OUTPUT->set_env('unreadicon', '
'); + $OUTPUT->set_env('repliedicon', '
'); + $OUTPUT->set_env('forwardedicon', '
'); + $OUTPUT->set_env('forwardedrepliedicon', '
'); + $OUTPUT->set_env('attachmenticon', '
'); + $OUTPUT->set_env('flagicon', '
'); $OUTPUT->set_env('messages', $a_js_message_arr); $OUTPUT->set_env('coltypes', $a_show_cols); -- cgit v1.2.3