Source for file util_message_list.php
Documentation is available at util_message_list.php
* The following functions are utility functions for this template. Do not
* echo output in those functions.
* @copyright © 2005-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: util_message_list.php,v 1.8 2006/07/15 12:01:19 tokul Exp $
* Width of the displayed columns
* Calculate the width of the subject column based on the
* widths of the other columns
foreach($aOrder as $iCol) {
foreach($aOrder as $iCol) {
$aWidth[$iCol] =
$aWidthTpl[$iCol];
$iCheckTotalWidth =
$iTotalWidth =
0;
foreach($aOrder as $iCol) { $iTotalWidth +=
$aWidth[$iCol];}
$iTotalWidth =
($iTotalWidth) ?
$iTotalWidth :
100; // divide by zero check. shouldn't be needed
// correct the width to 100%
foreach($aOrder as $iCol) {
$aWidth[$iCol] =
round( (100 /
$iTotalWidth) *
$aWidth[$iCol] , 0);
$iCheckTotalWidth +=
$aWidth[$iCol];
if ($iCheckTotalWidth >
100) { // correction needed
$aWidth[$iCol] -=
$iCheckTotalWidth-
100;
* Function to retrieve correct icon based on provided message flags. This is
* a merge/replacement for getFlagIcon() and getFlagText() functions.
* @param array $aFlags associative array with seen,deleted,anwered and flag keys.
* @param string $icon_theme_path path to user's currently selected icon theme.
* @return string $icon full HTML img tag or text icon, depending on of user prefs
* 7 = answered deleted seen
* 11 = flagged deleted seen
* 13 = flagged aswered seen
* 14 = flagged answered deleted
* 15 = flagged anserwed deleted seen
* Use static vars to avoid initialisation of the array on each displayed row
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_values =
array('seen' =>
1,
* The flags entry contain all items displayed in the flag column.
foreach ($aFlags as $flag =>
$flagvalue) {
case 'flagged':
if ($flagvalue) $index +=
$flag_values[$flag]; break;
if (isset
($flag_icons[$index])) {
$data =
$flag_icons[$index];
$data =
end($flag_icons);
$icon =
getIcon($icon_theme_path, $data[0], $data[1], $data[2]);
* Function to retrieve correct priority icon based on user prefs
* @param integer $priority priority value of message
* @param string $icon_theme_path path to user's currently selected icon theme.
* @return string $icon full HTML img tag or text icon, depending on of user prefs
$icon =
getIcon($icon_theme_path, 'prio_high.png', '<span class="high_priority">!</span>');
$icon =
getIcon($icon_theme_path, 'prio_low.png', '<span class="low_priority">↓</span>');
$icon =
getIcon($icon_theme_path, 'transparent.png', '', '', 5);
* Function to retrieve correct attchment icon based on user prefs
* @param boolean $attach TRUE if the message has an attachment
* @param string $icon_theme_path path to user's currently selected icon theme.
* @return string $icon full HTML img tag or text icon, depending on of user prefs
$icon_file =
$attach ?
'attach.png' :
'transparent.png';
$text =
$attach ?
'+' :
'';
$icon =
getIcon($icon_theme_path, $icon_file, $text);
Documentation generated on Sat, 07 Oct 2006 16:14:05 +0300 by phpDocumentor 1.3.0RC6