Added stylesheets with default Comic Sans MS and Bitstream Vera Sans/Verdana
[squirrelmail.git] / functions / mailbox_display.php
index 7fb198930a59c88eb172142c4f33586690888a7a..c746a0aa96511be711ddd0759a3a5f0196a627d6 100644 (file)
@@ -17,8 +17,12 @@ require_once(SM_PATH . 'functions/html.php');
 require_once(SM_PATH . 'class/html.class.php');
 require_once(SM_PATH . 'functions/imap_mailbox.php');
 
-/* Default value for page_selector_max. */
+/* Constants:
+ *   PG_SEL_MAX:   default value for page_selector_max
+ *   SUBJ_TRIM_AT: the length at which we trim off subjects
+ */
 define('PG_SEL_MAX', 10);
+define('SUBJ_TRIM_AT', 55);
 
 function elapsed($start)
 {
@@ -873,8 +877,9 @@ function ShowSortButton($sort, $mailbox, $Up, $Down ) {
     /* Now that we have everything figured out, show the actual button. */
     echo ' <a href="' . $source_url .'?newsort=' . $which
          . '&amp;startMessage=1&amp;mailbox=' . urlencode($mailbox)
-         . '"><IMG SRC="../images/' . $img
-         . '" BORDER=0 WIDTH=12 HEIGHT=10 ALT="sort"></a>';
+         . '"><img src="../images/' . $img
+         . '" border="0" width="12" height="10" alt="sort" title="'
+         . _("Click here to change the sorting of the message list") .'"></a>';
 }
 
 function get_selectall_link($start_msg, $sort) {
@@ -1178,17 +1183,20 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
 function processSubject($subject, $threadlevel = 0) {
     global $languages, $squirrelmail_language;
     /* Shouldn't ever happen -- caught too many times in the IMAP functions */
-    if ($subject == '')
+    if ($subject == '') {
         return _("(no subject)");
+    }
 
-    $trim_at = 55;
+    $trim_at = SUBJ_TRIM_AT;
 
     /* if this is threaded, subtract two chars per indentlevel */
-    if($threadlevel > 0 && $threadlevel <= 10)
+    if($threadlevel > 0 && $threadlevel <= 10) {
         $trim_at -= (2*$threadlevel);
+    }
 
-    if (strlen($subject) <= $trim_at)
+    if (strlen($subject) <= $trim_at) {
         return $subject;
+    }
 
     $ent_strlen = $orig_len = strlen($subject);
     $trim_val = $trim_at - 5;
@@ -1221,7 +1229,13 @@ function processSubject($subject, $threadlevel = 0) {
         function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
         return $languages[$squirrelmail_language]['XTRA_CODE']('strimwidth', $subject, $trim_val);
     }
-    return substr($subject, 0, $trim_val) . '...';
+
+    // only print '...' when we're actually dropping part of the subject
+    if(strlen($subject) <= $trim_val) {
+        return $subject;
+    } else {
+        return substr($subject, 0, $trim_val) . '...';
+    }
 }
 
 function getMbxList($imapConnection) {