[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-devel
Subject:    [SM-DEVEL] Message list html formatting fixes
From:       "Ryan O'Neill" <ryanlists () hostbaby ! com>
Date:       2003-03-27 20:55:33
[Download RAW message or body]

I recently updated our squirremail to 1.4.0 cvs and heard almost right away 
from someone using netscape 4.7 that they could no longer see their message 
list.  Instead of telling them to upgrade i just decided to go through and 
fix the HTML (NS 4.x is infamous for not displaying pages with broken 
tables).

Attached is a patch for display_message.php which makes (the output of) 
right_main.php *almost* 100% valid html (according to http://validator.w3.org 
the only thing still "wrong" is the little xhtml " />" on the end of the 
stylesheet line).

I also moved the <form> and </form> tags outside of the main table, so it's 
now basically <form><table>buttons and messages and junk</table></form>.  I 
think this is a much cleaner way to go instead of embedding the form tags 
inside of tables.  I removed all the tab characters in the code as well.

These changes didn't affect the display of the right_main.php list in mozilla.  
I'm not in a good position to be able to check it on IE, but i'm pretty sure 
it'll look the same too.

Hope this is cool (commitable).  If so, i can start going through some of the 
other files as well.

-- 
HOSTBABY.COM - web hosting for musicians
Ryan O'Neill - ryan@hostbaby.com
http://www.hostbaby.com

["mailbox_display-htmlfix.txt" (text/plain)]

--- mailbox_display.php.orig	Thu Mar 27 10:58:25 2003
+++ mailbox_display.php	Thu Mar 27 12:32:51 2003
@@ -457,6 +457,7 @@
 
     $msg_cnt_str = get_msgcnt_str($start_msg, $end_msg, $num_msgs);
 
+    echo '<form name="messageList" method="post" action="move_messages.php">' . \
"\n";  do_hook('mailbox_index_before');
     echo '<table border="0" width="100%" cellpadding="0" cellspacing="0">';
     echo '<tr><td>';
@@ -471,15 +472,17 @@
     echo '    <table width="100%" cellpadding="1" cellspacing="0" align="center"'.' \
border="0" bgcolor="'.$color[9].'">';  echo '     <tr><td>';
     echo '       <table width="100%" cellpadding="1" cellspacing="0" align="center" \
                border="0" bgcolor="'.$color[5].'">';
-    echo '<tr><td>';
     printHeader($mailbox, $srt, $color, !$thread_sort_messages);
 
     displayMessageArray($imapConnection, $num_msgs, $start_msg, 
-		      $msort, $mailbox, $sort, $color, $show_num,0,0);
-    echo '</td></tr></table></td></tr></table>';
+                        $msort, $mailbox, $sort, $color, $show_num,0,0);
+    echo '</table></td></tr></table></td></tr>';
 
     mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $color); 
+    echo '<tr><td bgcolor="'. $color[0] . '">';
+    do_hook('mailbox_index_after');
     echo '</td></tr></table>';
+    echo "</FORM>\n";
     $t = elapsed($start);
     //echo("elapsed time = $t seconds\n");
 }
@@ -649,8 +652,8 @@
         $msg = '';
     }
     $moveFields = '<input type="hidden" name="msg" \
                value="'.htmlspecialchars($msg).'">' .
-		  '<input type="hidden" name="mailbox" value="'.htmlspecialchars($mailbox).'">' .
-		  '<input type="hidden" name="startMessage" \
value="'.htmlspecialchars($start_msg).'">'; +                  '<input type="hidden" \
name="mailbox" value="'.htmlspecialchars($mailbox).'">' . +                  '<input \
type="hidden" name="startMessage" value="'.htmlspecialchars($start_msg).'">';  
 //    $moveURL = "move_messages.php?msg=$msg&amp;mailbox=$urlMailbox"
 //             . "&amp;startMessage=$start_msg";
@@ -658,8 +661,7 @@
      * This is the beginning of the message list table.
      * It wraps around all messages
      */
-    echo '<form name="messageList" method="post" action="move_messages.php">' ."\n"
-	. $moveFields
+    echo $moveFields
         . html_tag( 'table' ,
             html_tag( 'tr',
                 html_tag( 'td' ,
@@ -671,19 +673,19 @@
                     , '', $color[4], 'border="0" width="100%" cellpadding="1"  \
cellspacing="0"' )   , 'left', '', '' )
             , '', $color[0] )
-	    , '', '', 'border="0" width="100%" cellpadding="1"  cellspacing="0"' );
-	/* line between header and button area */
+            , '', '', 'border="0" width="100%" cellpadding="1"  cellspacing="0"' );
+        /* line between header and button area */
+        echo '</td></tr>';
         echo '<tr><td HEIGHT="5" BGCOLOR="'.$color[4].'"></td></tr>';
 
-        echo '<tr><td>';
         echo html_tag( 'tr' ) . "\n"
         . html_tag( 'td' ,'' , 'left', '', '' )
          . html_tag( 'table' ,'' , '', $color[9], 'border="0" width="100%" \
                cellpadding="1"  cellspacing="0"' )
-	  . '<tr><td>'
+         . '<tr><td>'
            . html_tag( 'table' ,'' , '', $color[0], 'border="0" width="100%" \
                cellpadding="1"  cellspacing="0"' )
             . html_tag( 'tr',
-	        getSmallStringCell(_("Move Selected To"), 'left', 'nowrap') .
-	        getSmallStringCell(_("Transform Selected Messages"), 'right')
+               getSmallStringCell(_("Move Selected To"), 'left', 'nowrap') .
+               getSmallStringCell(_("Transform Selected Messages"), 'right')
             )
             . html_tag( 'tr' ) ."\n"
             . html_tag( 'td', '', 'left', '', 'valign="middle" nowrap' );
@@ -709,6 +711,7 @@
     } else {
         $location = $php_self;
     }
+    $location = preg_replace('/&(?!amp;)/i', '&amp;', $location);
     echo '<INPUT TYPE="HIDDEN" NAME="location" VALUE="'.$location.'">';
     echo "</TD>\n"
          . "   </TR>\n";
@@ -724,15 +727,15 @@
         }
         echo html_tag( 'tr' ,
                     html_tag( 'td' ,
-                              '&nbsp;<a href=' . $source_url . '?sort='
-                              . "$sort" . '&start_messages=1&set_thread=' . \
                "$set_thread"
-                              . '&mailbox=' . urlencode($mailbox) . '><small>' . \
                $thread_name
-                              . '</a></small>&nbsp;'
+                              '&nbsp;<a href="' . $source_url . '?sort='
+                              . "$sort" . '&amp;start_messages=1&amp;set_thread=' . \
"$set_thread" +                              . '&amp;mailbox=' . urlencode($mailbox) \
. '"><small>' . $thread_name +                              . '</small></a>&nbsp;'
                      , '', '', '' )
                  , '', '', '' );
     }
 
-    echo "</TABLE></td></tr></table></td></tr>\n";
+    echo "</TABLE></td></tr></table>\n";
 
     do_hook('mailbox_form_before');
 
@@ -766,10 +769,6 @@
         , '', $color[9], 'width="100%" border="0" cellpadding="1"  cellspacing="0"' \
);  echo '</td></tr>';
   }
-    /* End of message-list table */
-
-    do_hook('mailbox_index_after');
-    echo "</FORM>\n";
 }
 
 function printHeader($mailbox, $sort, $color, $showsort=true) {
@@ -1205,7 +1204,7 @@
     global $lastTargetMailbox;
     echo  '         <small>&nbsp;<tt><select name="targetMailbox">';
     echo sqimap_mailbox_option_list($imapConnection, \
                array(strtolower($lastTargetMailbox)) ); 
-    echo '         </SELECT></TT>&nbsp;';
+    echo '         </SELECT></TT>&nbsp;</small>';
 }
 
 function getButton($type, $name, $value) {


-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
--
squirrelmail-devel mailing list
List Address: squirrelmail-devel@lists.sourceforge.net
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=7139
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic