X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=templates%2Fdefault%2Fmessage_list.tpl;h=6040788559f3e3bcf06594dbfa1f3e4e7bf646ab;hb=b1870063b2e576ca9ff3cd41ada9cda1f8812507;hp=906376a2bcf0bcbc334aa11ffcec82826e5f53d8;hpb=4b4abf93a9624311afef0c385023724ee46a2b60;p=squirrelmail.git diff --git a/templates/default/message_list.tpl b/templates/default/message_list.tpl index 906376a2..60407885 100644 --- a/templates/default/message_list.tpl +++ b/templates/default/message_list.tpl @@ -5,7 +5,62 @@ * * Template for viewing a messages list * - * @copyright © 1999-2005 The SquirrelMail Project Team + * The following variables are available in this template: +//FIXME: need to clean (and document) this list, it is just a dump of the array keys of $t + * $sTemplateID + * $icon_theme_path + * $javascript_on + * $delayed_errors + * $frames + * $lang + * $page_title + * $header_tags + * $plugin_output + * $header_sent + * $body_tag_js + * $shortBoxName + * $sm_attribute_str + * $frame_top + * $urlMailbox + * $startMessage + * $hide_sm_attributions + * $uri + * $text + * $onclick + * $class + * $id + * $target + * $color + * $form_name + * $form_id + * $page_selector + * $page_selector_max + * $messagesPerPage + * $showall + * $end_msg + * $align + * $iNumberOfMessages + * $aOrder + * $aFormElements + * $sort + * $pageOffset + * $baseurl + * $aMessages + * $trash_folder + * $sent_folder + * $draft_folder + * $thread_link_str + * $php_self + * $mailbox + * $enablesort + * $icon_theme + * $use_icons + * $alt_index_colors + * $fancy_index_highlite + * $compact_paginator + * $aErrors + * + * @copyright © 1999-2006 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -18,7 +73,9 @@ include_once(SM_PATH . 'templates/util_message_list.php'); /* retrieve the template vars */ extract($t); -do_hook('mailbox_index_before'); +//FIXME: no hooks in templates! +global $null; +do_hook('mailbox_index_before', $null); /** * Calculate string "Viewing message x to y (z total)" @@ -26,9 +83,9 @@ do_hook('mailbox_index_before'); $msg_cnt_str = ''; if ($pageOffset < $end_msg) { $msg_cnt_str = sprintf(_("Viewing Messages: %s to %s (%s total)"), - ''.$pageOffset.'', ''.$end_msg.'', $iNumberOfMessages); + ''.$pageOffset.'', ''.$end_msg.'', $iNumberOfMessages); } else if ($pageOffset == $end_msg) { - $msg_cnt_str = sprintf(_("Viewing Message: %s (%s total)"), ''.$pageOffset.'', $iNumberOfMessages); + $msg_cnt_str = sprintf(_("Viewing Message: %s (%s total)"), ''.$pageOffset.'', $iNumberOfMessages); } @@ -77,16 +134,10 @@ if (!($javascript_on && $fancy_index_highlite)) { } /** - * Check usage of images for attachments, flags and priority - */ -$bIcons = ($use_icons && $icon_theme) ? true : false; - -/** - * Location of icon images - */ -if ($bIcons) { - $sImageLocation = SM_PATH . 'images/themes/' . $icon_theme . '/'; -} + * All icon functionality is now handled through $icon_theme_path. + * $icon_theme_path will contain the path to the user-selected theme. If it is + * NULL, the user and/or admin have turned off icons. +*/ // set this to an empty string to turn off extra // highlighting of checked rows @@ -95,17 +146,17 @@ if ($bIcons) { $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; ?> -
- +
+ +
-
- +
+ + - +
- +
- - +
- +
@@ -127,27 +177,26 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; if (count($aFormElements)) { ?> -
- +
- - -
- + $value) { switch ($value[1]) { case 'submit': - if ($key != 'moveButton' && $key != 'delete' && $key != 'undeleteButton') { // add move in a different table cell + if ($key != 'moveButton' && $key != 'copyButton' && $key != 'delete' && $key != 'undeleteButton') { // add move in a different table cell ?> -   +   -   +   - + - - -   +   -   +   -   +   - -   - + - - - + + + + +
- +
- - - - +
+ - + + - - + + ' ; break; - case 5: $sValue .= 'prio_low.png" border="0" height="10" width="5" alt="" /> ' ; break; - default: $sValue .= 'transparent.png" border="0" width="5" alt="" /> ' ; break; - } - } else { - $sValue = ''; - switch ($aColumns[SQM_COL_PRIO]['value']) { - case 1: - case 2: $sValue .= "!"; break; - // use downwards arrow for low priority emails - case 5: $sValue .= ""; break; - default: break; - } - } + $sValue = getPriorityIcon($aColumns[SQM_COL_PRIO]['value'], $icon_theme_path); $aColumns[SQM_COL_PRIO]['value'] = $sValue; } @@ -382,42 +400,33 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; * Check the attachment column */ if (isset($aColumns[SQM_COL_ATTACHMENT])) { - /* FIX ME, we should use separate templates for icons */ - if ($bIcons) { - $sValue = '' - : 'transparent.png" border="0" width="6" alt="" />'; - } else { - $sValue = ($aColumns[SQM_COL_ATTACHMENT]['value']) ? '+' : ''; - } + $sValue = getAttachmentIcon($aColumns[SQM_COL_ATTACHMENT]['value'], $icon_theme_path); $aColumns[SQM_COL_ATTACHMENT]['value'] = $sValue; } - - $bgcolor = $color[4]; - + $class = 'even'; /** - * If alternating row colors is set, adapt the bgcolor + * If alternating row colors is set, adapt the CSS class */ if (isset($alt_index_colors) && $alt_index_colors) { if (!($i % 2)) { - if (!isset($color[12])) { - $color[12] = '#EAEAEA'; - } - $bgcolor = $color[12]; + $class = 'odd'; } } - $bgcolor = (isset($aMsg['row']['color'])) ? $aMsg['row']['color']: $bgcolor; - $class = 'msg_row'; + if (isset($aMsg['row']['color'])) + { + $bgcolor = $aMsg['row']['color']; + $class = 'misc'.$i; + } + else $bgcolor = ''; $row_extra = ''; // this stuff does the auto row highlighting on mouseover // if ($javascript_on && $fancy_index_highlite) { - $row_extra .= ' onmouseover="rowOver(\''.$form_id . "_msg$i','". $mouseoverColor . '\', \'' . $clickedColor . '\');" onmouseout="setPointer(this, ' . $i . ', \'out\', \'' . $bgcolor . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');" onmousedown="setPointer(this, ' . $i . ', \'click\', \'' . $bgcolor . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');"'; + $row_extra .= ' onmouseover="rowOver(\''.$form_id . '_msg' . $i.'\');" onmouseout="setPointer(this, ' . $i . ', \'out\', \'' . $class . '\', \'mouse_over\', \'clicked\');" onmousedown="setPointer(this, ' . $i . ', \'click\', \'' . $class . '\', \'mouse_over\', \'clicked\');"'; } // this does the auto-checking of the checkbox no matter // where on the row you click @@ -428,22 +437,37 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; $javascript_auto_click = " onMouseDown=\"row_click('$form_id"."_msg$i')\""; } +/* + * Message Highlighting requires a unique CSS class declaration for proper + * mouseover functionality. There is no harm in doing this when the mouseover + * functionality is disabled + */ +if ($class != 'even' && $class != 'odd') +{ ?> -> + + +> '; $sEnd = ''; + if (!in_array('seen',$aFlags) || !$aFlags['seen']) { + $sPre = ''; $sEnd = ''; } if (in_array('deleted',$aFlags) && $aFlags['deleted']) { - $sPre = "" . $sPre; - $sEnd .= ''; + $sPre = '' . $sPre; + $sEnd .= ''; } else { if (in_array('flagged',$aFlags) && $aFlags['flagged']) { - $sPre = "" . $sPre; - $sEnd .= ''; + $sPre = '' . $sPre; + $sEnd .= ''; } } } @@ -459,11 +483,14 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; $sLabelStart = ''; $sLabelEnd = ''; } - $aCol = (isset($aColumns[$iCol])) ? $aColumns[$iCol] : array(); - $title = (isset($aCol['title'])) ? $aCol['title'] : ''; - $link = (isset($aCol['link'])) ? $aCol['link'] : ''; - $value = (isset($aCol['value'])) ? $aCol['value'] : ''; - $target = (isset($aCol['target'])) ? $aCol['target'] : ''; + $aCol = (isset($aColumns[$iCol])) ? $aColumns[$iCol] : array(); + $title = (isset($aCol['title'])) ? $aCol['title'] : ''; + $link = (isset($aCol['link'])) ? $aCol['link'] : ''; + $link_extra = (isset($aCol['link_extra'])) ? $aCol['link_extra'] : ''; + $onclick = (isset($aCol['onclick'])) ? $aCol['onclick'] : ''; + $link = (isset($aCol['link'])) ? $aCol['link'] : ''; + $value = (isset($aCol['value'])) ? $aCol['value'] : ''; + $target = (isset($aCol['target'])) ? $aCol['target'] : ''; if ($iCol !== SQM_COL_CHECK) { $value = $sLabelStart.$sPre.$value.$sEnd.$sLabelEnd; } @@ -471,22 +498,30 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; switch ($iCol) { case SQM_COL_CHECK: - echo ' + if ($javascript_on) { + echo ''; + $checked = ($checkall) ? " checked=checked " : " "; + echo ""; + } break; case SQM_COL_SUBJ: $indent = $aCol['indent']; - $sText = " \n"; + $sText = " \n"; echo $sText; break; case SQM_COL_INT_DATE: case SQM_COL_DATE: - $sText = " \n"; echo $sText; break; default: - $sText = " "; + $sLine = "\n"; ++$i; /* @@ -544,16 +579,16 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
- + '; + echo ''."\n"; } else { - $link = $baseurl . "&startMessage=$pageOffset&&checkall="; + $link = $baseurl . "&startMessage=$pageOffset&checkall="; if (sqgetGlobalVar('checkall',$checkall,SQ_GET)) { $link .= ($checkall) ? '0' : '1'; } else { @@ -248,62 +298,52 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; echo ""._("All").''; } break; - case SQM_COL_FROM: echo _("From"); break; - case SQM_COL_DATE: echo _("Date"); break; - case SQM_COL_SUBJ: echo _("Subject"); break; + case SQM_COL_FROM: echo _("From")."\n"; break; + case SQM_COL_DATE: echo _("Date")."\n"; break; + case SQM_COL_SUBJ: echo _("Subject")."\n"; break; case SQM_COL_FLAGS: - if ($bIcons) { - echo '!'; - } else { - echo ' '; - } - break; - case SQM_COL_SIZE: echo _("Size"); break; + echo getIcon($icon_theme_path, 'msg_new.png', ' ', _("Message Flags")) . "\n"; + break; + case SQM_COL_SIZE: echo _("Size")."\n"; break; case SQM_COL_PRIO: - if ($bIcons) { - echo '!'; - } else { - echo '!'; - } - break; + echo getIcon($icon_theme_path, 'prio_high.png', '!', _("Priority")) . "\n"; + break; case SQM_COL_ATTACHMENT: - if ($bIcons) { - echo '+'; - } else { - echo '+'; - } - break; - case SQM_COL_INT_DATE: echo _("Received"); break; - case SQM_COL_TO: echo _("To"); break; - case SQM_COL_CC: echo _("Cc"); break; - case SQM_COL_BCC: echo _("Bcc"); break; + echo getIcon($icon_theme_path, 'attach.png', '+', _("Attachment")) . "\n"; + break; + case SQM_COL_INT_DATE: echo _("Received")."\n"; break; + case SQM_COL_TO: echo _("To")."\n"; break; + case SQM_COL_CC: echo _("Cc")."\n"; break; + case SQM_COL_BCC: echo _("Bcc")."\n"; break; default: break; } // add the sort buttons if (isset($aSortSupported[$iCol])) { if ($sort == $aSortSupported[$iCol][0]) { - $newsort = $aSortSupported[$iCol][1]; - $img = 'up_pointer.png'; + $newsort = $aSortSupported[$iCol][1]; + $img = 'up_pointer.png'; + $text_icon = '⇧'; // U+21E7 UPWARDS WHITE ARROW } else if ($sort == $aSortSupported[$iCol][1]) { - $newsort = 0; - $img = 'down_pointer.png'; + $newsort = 0; + $img = 'down_pointer.png'; + $text_icon = '⇩'; // U+21E9 DOWNWARDS WHITE ARROW } else { - $newsort = $aSortSupported[$iCol][0]; - $img = 'sort_none.png'; + $newsort = $aSortSupported[$iCol][0]; + $img = 'sort_none.png'; + $text_icon = '◻'; // U+25FB WHITE MEDIUM SQUARE } /* Now that we have everything figured out, show the actual button. */ - echo " "; - echo 'sort'; + echo " " . + getIcon($icon_theme_path, $img, $text_icon, _("Click here to change the sorting of the message list")) . "\n" . + ''; } ?> -
' ?> - " id="" value="" />' ?> + " id="" value="" /> "; + $sText = " "; if ($align['left'] == 'left') { $sText .= str_repeat('  ',$indent); } $sText .= ""; - $sText .= "$value"; + $sText .= "$value"; + $sText = " "; $sText .= $value. "
- +
@@ -563,8 +598,9 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
- +
- - + +
- +
- \ No newline at end of file + +