X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Ftemplate%2Fmessage_list_util.php;h=4795f0b89af47de1491ef0c8326eae110f0c4750;hp=cdd8825b5bda5f58dff9d07705371770a98c3bdf;hb=c4faef335b2362c81b8ebf026d4066c12d70536c;hpb=bb1e750ef81c6f711e086c7b2f27bef25639ea3b diff --git a/functions/template/message_list_util.php b/functions/template/message_list_util.php index cdd8825b..4795f0b8 100644 --- a/functions/template/message_list_util.php +++ b/functions/template/message_list_util.php @@ -8,7 +8,7 @@ * The following functions are utility functions for templates. Do not * echo output in these functions. * - * @copyright © 2005-2006 The SquirrelMail Project Team + * @copyright 2005-2020 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -26,13 +26,13 @@ function calcMessageListColumnWidth($aOrder) { $aWidthTpl = array( SQM_COL_CHECK => 1, SQM_COL_FROM => 25, - SQM_COL_DATE => 10, + SQM_COL_DATE => 15, SQM_COL_SUBJ => 100, SQM_COL_FLAGS => 2, SQM_COL_SIZE => 5, SQM_COL_PRIO => 1, SQM_COL_ATTACHMENT => 1, - SQM_COL_INT_DATE => 10, + SQM_COL_INT_DATE => 15, SQM_COL_TO => 25, SQM_COL_CC => 25, SQM_COL_BCC => 25 @@ -99,38 +99,83 @@ function getFlagIcon ($aFlags, $icon_theme_path) { * 13 = flagged aswered seen * 14 = flagged answered deleted * 15 = flagged anserwed deleted seen + * ... + * 32 = forwarded + * 33 = forwarded seen + * 34 = forwarded deleted + * 35 = forwarded deleted seen + * ... + * 41 = flagged forwarded seen + * 42 = flagged forwarded deleted + * 43 = flagged forwarded deleted seen */ /** * Use static vars to avoid initialisation of the array on each displayed row */ + global $nbsp; static $flag_icons, $flag_values; if (!isset($flag_icons)) { // This is by no means complete... - $flag_icons = array ( // Image icon name Text Icon Alt/Title Text - array ('msg_new.png', ' ', '('._("New").')') , - array ('msg_read.png', ' ', '('._("Read").')'), - array ('msg_new_deleted.png', _("D"), '('._("Deleted").')'), - array ('msg_read_deleted.png', _("D"), '('._("Deleted").')'), - array ('msg_new_reply.png', _("A"), '('._("Answered").')'), - array ('msg_read_reply.png', _("A"), '('._("Answered").')'), - array ('msg_read_deleted_reply.png', _("D"), '('._("Answered").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')') - ); + $flag_icons = array ( + // Image icon name Text Icon Alt/Title Text + // --------------- --------- -------------- + array ('msg_new.png', $nbsp, '('._("New").')') , + array ('msg_read.png', $nbsp, '('._("Read").')'), + // i18n: "D" is short for "Deleted". Make sure that two icon strings aren't translated to the same character (only in 1.5). + array ('msg_new_deleted.png', _("D"), '('._("Deleted").')'), + array ('msg_read_deleted.png', _("D"), '('._("Deleted").')'), + // i18n: "A" is short for "Answered". Make sure that two icon strings aren't translated to the same character (only in 1.5). + array ('msg_new_reply.png', _("A"), '('._("Answered").')'), + array ('msg_read_reply.png', _("A"), '('._("Answered").')'), + array ('msg_new_deleted_reply.png', _("D"), '('._("Answered").')'), + array ('msg_read_deleted_reply.png', _("D"), '('._("Answered").')'), + // i18n: "F" is short for "Flagged". Make sure that two icon strings aren't translated to the same character (only in 1.5). + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + // i18n: "O" is short for "Forwarded". Make sure that two icon strings aren't translated to the same character (only in 1.5). + array ('msg_new_forwarded.png', _("O"), '('._("Forwarded").')'), + array ('msg_read_forwarded.png', _("O"), '('._("Forwarded").')'), + array ('msg_new_deleted_forwarded.png', _("D"), '('._("Forwarded").')'), + array ('msg_read_deleted_forwarded.png', _("D"), '('._("Forwarded").')'), + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + ); - $flag_values = array('seen' => 1, - 'deleted' => 2, - 'answered' => 4, - 'flagged' => 8, - 'draft' => 16); + $flag_values = array('seen' => 1, + 'deleted' => 2, + 'answered' => 4, + 'flagged' => 8, + 'draft' => 16, + 'forwarded' => 32); } /** @@ -143,16 +188,18 @@ function getFlagIcon ($aFlags, $icon_theme_path) { switch ($flag) { case 'deleted': case 'answered': + case 'forwarded': case 'seen': case 'flagged': if ($flagvalue) $index += $flag_values[$flag]; break; default: break; } } - if (isset($flag_icons[$index])) { + if (!empty($flag_icons[$index])) { $data = $flag_icons[$index]; } else { - $data = end($flag_icons); +//FIXME: previously this default was set to the last value of the $flag_icons array (when it was index 15 - flagged anserwed deleted seen) but I don't understand why... am changing it to flagged (index 15 just shows (only) the flag icon anyway) + $data = $flag_icons[8]; // default to just flagged } $icon = getIcon($icon_theme_path, $data[0], $data[1], $data[2]); @@ -174,16 +221,15 @@ function getPriorityIcon ($priority, $icon_theme_path) { switch ($priority) { case 1: case 2: - $icon = getIcon($icon_theme_path, 'prio_high.png', '!'); + $icon = getIcon($icon_theme_path, 'prio_high.png', create_span('!', 'high_priority'), _("High priority")); break; case 5: - $icon = getIcon($icon_theme_path, 'prio_low.png', ''); + $icon = getIcon($icon_theme_path, 'prio_low.png', create_span('↓', 'low_priority'), _("Low priority")); break; default: - $icon = getIcon($icon_theme_path, 'transparent.png', '', '', 5); + $icon = getIcon($icon_theme_path, 'transparent.png', '', _("Normal priority"), 5); break; } - echo "prio = $priority
icon = $icon
"; return $icon; } @@ -201,9 +247,9 @@ function getAttachmentIcon ($attach, $icon_theme_path) { $icon = ''; $icon_file = $attach ? 'attach.png' : 'transparent.png'; + $alt_text = $attach ? _("Attachment") : _("No attachment"); $text = $attach ? '+' : ''; - $icon = getIcon($icon_theme_path, $icon_file, $text); + $icon = getIcon($icon_theme_path, $icon_file, $text, $alt_text); return $icon; } -