r2l by Yoav
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Jun 2002 14:02:45 +0000 (14:02 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Jun 2002 14:02:45 +0000 (14:02 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3001 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/download.php
src/folders_rename_getname.php
src/help.php

index be8ee42ae3c775ca86c5cab940f1d52d9a128291..89f7c0430310d840cd8959aa297acbe8c3bf3671 100644 (file)
@@ -16,6 +16,7 @@ require_once('../src/validate.php');
 require_once('../functions/imap.php');
 require_once('../functions/mime.php');
 require_once('../functions/date.php');
+require_once('../functions/html.php');
 
 header('Pragma: ');
 header('Cache-Control: cache');
@@ -26,24 +27,31 @@ function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at, $imapC
 
     displayPageHeader($color, 'None');
 
-    echo "<BR><TABLE WIDTH=\"100%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
-         "<B><CENTER>".
-         _("Viewing a text attachment") . " - ";
     if ($where && $what) {
         // from a search
-        echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&where=".urlencode($where)."&what=".urlencode($what)."\">". _("View message") . "</a>";
+        $message_link_str = "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&where=".urlencode($where)."&what=".urlencode($what)."\">". _("View message") . "</a>";
     } else {
-        echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a>";
+        $message_link_str = "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a>";
     }
-
     $urlmailbox = urlencode($mailbox);
-    echo "</b></td><tr><tr><td><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$entid&mailbox=$urlmailbox\">".
-         _("Download this as a file").
-         "</A></CENTER><BR>".
-         "</CENTER></B>".
-         "</TD></TR></TABLE>".
-         "<TABLE WIDTH=\"98%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
-         "<TR><TD BGCOLOR=\"$color[4]\"><TT>";
+
+    echo '<br>' .
+        html_tag( 'table',
+            html_tag( 'tr',
+                html_tag( 'td', 
+                     '<b><center>' .
+                     _("Viewing a text attachment") . ' - ' . $message_link_str . '</b></center>',
+                '', 'left', $color[0] )
+            ) .
+            html_tag( 'tr',
+                html_tag( 'td', 
+                     '<center>' .
+                     "<A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$entid&mailbox=$urlmailbox\">".
+                     _("Download this as a file").
+                     "</A></CENTER><BR>".
+                '', 'left' )
+            ),
+        '', 'center', '', 'width="100%" border="0" cellspacing="0" cellpadding="2"' );
 
     if ($type1 == 'html') {
         $msg  = sqimap_get_message($imapConnection, $id, $mailbox);    
@@ -53,8 +61,15 @@ function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at, $imapC
     }
 
     flush();
-    echo $body .
-         "</TT></TD></TR></TABLE>";
+
+         //"<TABLE WIDTH=\"98%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
+        //"<TR><TD BGCOLOR=\"$color[4]\"><TT>";
+
+        html_tag( 'table',
+            html_tag( 'tr',
+                html_tag( 'td', '<tt>' . $body . '</tt>', 'left', $color[4] )
+            ) ,
+        'center', '', 'width="98%" border="0" cellspacing="0" cellpadding="2"' );
 }
 
 function viewMessage($imapConnection, $id, $mailbox, $ent_id, $color, $wrap_at, $extracted) {
@@ -77,45 +92,59 @@ function viewMessage($imapConnection, $id, $mailbox, $ent_id, $color, $wrap_at,
     $bodyheader = viewHeader($header, $color);
     displayPageHeader($color, 'None');
 
-    echo "<BR><TABLE WIDTH=\"100%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>";
+    echo '<br>' .
+        html_tag( 'table', '', 'center', '', 'width="100%" border="0" cellspacing="0" cellpadding="2"' );
+
     if ($extracted) {
-       echo '<TR><TD width="100%"><center><h1>Message succesfully extracted</h1></center></TD></TR>';
+       echo html_tag( 'tr',
+                   html_tag( 'td', '<center><h1>Message succesfully extracted</h1></center>', 'left', '', 'width="100%"' )
+               );
     }
-    echo "<TR><TD BGCOLOR=\"$color[0]\">".
-       "<B><CENTER>".  _("Viewing a message attachment") . " - ";
-    
-    echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a>";
-    
+
+    $td_str = "<b><center>". _("Viewing a message attachment") . " - ";
+    $td_str .= "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a></b></center>";
+    echo html_tag( 'tr',
+               html_tag( 'td', $td_str, 'left', $color[0] )
+           );
+
     $urlmailbox = urlencode($mailbox);
-    
-    echo "</b></td><tr><tr><td><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$ent_id&mailbox=$urlmailbox\">".
+    $td_str = "<center><b><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$ent_id&mailbox=$urlmailbox\">".
        _("Download this as a file").
-       "</A></CENTER><BR>".
-       "</CENTER></B>".
-       "</TD></TR></TABLE>";
-    echo "<TABLE WIDTH=\"100%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
-       "<TR><TD BGCOLOR=\"$color[4]\">";
-    echo "$bodyheader </TD></TR></TABLE>";          
-       
-    echo "<TABLE WIDTH=\"98%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
-       "<TR><TD BGCOLOR=\"$color[4]\"><TT><BR>";
-       echo "$body </TT></TD></TR><table><br>";         
-    echo '<table width="100%"><tr>'.
-         "<td bgcolor=\"$color[9]\" width=\"100%\" align=\"center\">".
-           '<form action="download.php" method="post"><small>'.
-            "<input type=\"hidden\" name=\"passed_id\" value=\"$id\">".
-            "<input type=\"hidden\" name=\"mailbox\" value=\"".$mailbox."\">".
-            "<input type=\"hidden\" name=\"startMessage\" value=\"$startMessage\">".
-            "<input type=\"hidden\" name=\"passed_ent_id\" value=\"$ent_id\">".
-            "<input type=\"hidden\" name=\"extract_message\" value=\"1\">".
-            _("Save to:") .
-            ' <select name="targetMailbox">';
-    get_extract_to_target_list($imapConnection); 
+       "</A><BR>".
+       "</b></center>";
+    echo html_tag( 'tr',
+               html_tag( 'td', $td_str, 'left' )
+           ) .
+
+       "</TABLE>\n" .
+    html_tag( 'table',
+                html_tag( 'tr',
+                    html_tag( 'td', $bodyheader, 'left', $color[4] )
+                ) ,
+            'center', '', 'width="100%" border="0" cellspacing="0" cellpadding="2"' ) . "\n" .
+    html_tag( 'table',
+                html_tag( 'tr',
+                    html_tag( 'td', '<tt><br>' . $body . '</tt>', 'left', $color[4] )
+                ) ,
+            'center', '', 'width="98%" border="0" cellspacing="0" cellpadding="2"' ) . "<br>\n";       
+
+    echo html_tag( 'table', '', '', '', 'width="100%"' ) .
+                html_tag( 'tr' ) .
+                    html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) .
+          '<form action="download.php" method="post"><small>'.
+          "<input type=\"hidden\" name=\"passed_id\" value=\"$id\">".
+          "<input type=\"hidden\" name=\"mailbox\" value=\"".$mailbox."\">".
+          "<input type=\"hidden\" name=\"startMessage\" value=\"$startMessage\">".
+          "<input type=\"hidden\" name=\"passed_ent_id\" value=\"$ent_id\">".
+          "<input type=\"hidden\" name=\"extract_message\" value=\"1\">".
+          _("Save to:") .
+          ' <select name="targetMailbox">';
+          get_extract_to_target_list($imapConnection); 
     echo    '</select> '.'&nbsp'.
             '<input type="submit" value="' . _("Extract") . '">'.
             '</small>'.
            '</form>'.
-         '</td></table>';
+         '</td></tr></table>';
 
 }
 
@@ -183,8 +212,10 @@ function viewHeader($header,$color) {
 }
 
 function makeTableEntry($str, $str_name, $color) {
-    $entry = '<tr><td bgcolor="'."$color[0]".'" align right valign top>'."$str_name".'</td><td bgcolor="'."$color[0]".
-            '" valign top colspan=2><b>'."$str".'</b>&nbsp;</td></tr>'."\n";
+    $entry = html_tag( 'tr',
+                     html_tag( 'td', $str_name, 'right', $color[0], 'valign="top"' ) .
+                     html_tag( 'td', '<b>' . $str .'</b>&nbsp;', 'left', $color[0], 'valign="top" colspan="2"' )
+                 );
     return $entry;
 }
 
@@ -373,15 +404,18 @@ if (isset($absolute_dl) && $absolute_dl == 'true') {
                  "     " . _("To") . ": " . decodeHeader(getLineOfAddrs($top_header->to)) . "\n".
                  "   " . _("Date") . ": " . getLongDateString($top_header->date) . "\n\n";
         } elseif ($type1 == 'html' && isset($showHeaders)) {
-            echo '<table><tr><th align=right>' . _("Subject").
-                 ':</th><td>' . decodeHeader($top_header->subject).
-                 "</td></tr>\n<tr><th align=right>" . _("From").
-                 ':</th><td>' . decodeHeader($top_header->from).
-                 "</td></tr>\n<tr><th align=right>" . _("To").
-                 ':</th><td>' . decodeHeader(getLineOfAddrs($top_header->to)).
-                 "</td></tr>\n<tr><th align=right>" . _("Date").
-                 ':</th><td>' . getLongDateString($top_header->date).
-                 "</td></tr>\n</table>\n<hr>\n";
+            echo html_tag( 'table',
+                       html_tag( 'tr',
+                           html_tag( 'th', _("Subject") . ':', 'right' ) .
+                           html_tag( 'th', decodeHeader($top_header->subject), 'left' ) . "\n" .
+                           html_tag( 'th', _("From") . ':', 'right' ) .
+                           html_tag( 'th', decodeHeader($top_header->from), 'left' ) . "\n" .
+                           html_tag( 'th', _("To") . ':', 'right' ) .
+                           html_tag( 'th', decodeHeader(getLineOfAddrs($top_header->to)), 'left' ) . "\n" .
+                           html_tag( 'th', _("Date") . ':', 'right' ) .
+                           html_tag( 'th', getLongDateString($top_header->date), 'left' ) . "\n"
+                       )
+                    ) . "\n<hr>\n";
         } 
         echo $body;
         break;
index 682a94d73b0004640054dac3d41856bff4fb03af..633c3ea50cbff748cd6f3baa631f0f7c509b8ef1 100644 (file)
@@ -16,6 +16,7 @@ global $delimiter;
 
 require_once('../src/validate.php');
 require_once('../functions/imap.php');
+require_once('../functions/html.php');
 
 if ($old == '') {
     displayPageHeader($color, 'None');
@@ -43,11 +44,13 @@ if (strpos($old, $delimiter)) {
 }
 
 displayPageHeader($color, 'None');
-echo "<br><TABLE align=center border=0 WIDTH=\"95%\" COLS=1>".
-     "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>".
-     _("Rename a folder").
-     "</B></TD></TR>".
-     "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
+echo '<br>' .
+    html_tag( 'table', '', 'center', '', 'width="95%" cols="1" border="0"' ) .
+        html_tag( 'tr',
+            html_tag( 'td', '<b>' . _("Rename a folder") . '</b>', 'center', $color[0] )
+        ) .
+        html_tag( 'tr' ) .
+            html_tag( 'td', '', 'center', $color[4] ) .
      "<FORM ACTION=\"folders_rename_do.php\" METHOD=\"POST\">\n".
      _("New name:").
      "<br><B>$old_parent $delimiter </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
@@ -57,8 +60,8 @@ if ( $isfolder ) {
 printf("<INPUT TYPE=HIDDEN NAME=orig VALUE=\"%s\">\n", $old);
 printf("<INPUT TYPE=HIDDEN NAME=old_name VALUE=\"%s\">\n", $old_name);
 echo "<INPUT TYPE=SUBMIT VALUE=\""._("Submit")."\">\n".
-     "</FORM><BR></TD></TR>".
-     "</TABLE>";
+     "</FORM><BR></td></tr>".
+     "</table>";
 
 /** Log out this session **/
 sqimap_logout($imapConnection);
index 7b65faee71a914b183b9ccd38898762053ccb9c2..f83bc0881be7755223cfd8f283d279ddc5ea5d07 100644 (file)
@@ -82,23 +82,21 @@ function get_info($doc, $pos) {
 
 /**************[ END HELP FUNCTIONS ]******************/
 
-?>
 
-<br>
-<table width="95%" align="center" cellpadding="2" cellspacing="2" border="0">
- <tr>
-  <td bgcolor="<?php echo $color[0] ?>">
-   <center><b><?php echo _("Help") ?></b></center>
-  </td>
- </tr>
-</table>
-
-<?php do_hook("help_top") ?>
-
-<table width="90%" cellpadding="0" cellspacing="10" border="0" align="center">
-<tr>
-<td>
-<?php 
+
+echo '<br>' .
+    html_tag( 'table',
+        html_tag( 'tr',
+            html_tag( 'td','<center><b>' . _("Help") .'</b></center>', 'center', $color[0] )
+        ) ,
+    'center', '', 'width="95%" cellpadding="2" cellspacing="2" border="0"' );
+
+do_hook("help_top");
+
+echo html_tag( 'table', '', 'center', '', 'width="90%" cellpadding="0" cellspacing="10" border="0"' ) .
+        html_tag( 'tr' ) .
+            html_tag( 'td' );
+
 if (isset($HTTP_REFERER)) {
     $ref = strtolower($HTTP_REFERER);
     if (strpos($ref, 'src/compose')){
@@ -165,16 +163,18 @@ if ($help_exists == true) {
     }
 
     if (!isset($chapter)) {
-        echo '<table cellpadding="0" cellspacing="0" border="0" align="center"><tr><td>' .
-             '<b><center>' . _("Table of Contents") . '</center></b><br>';
+        echo html_tag( 'table', '', 'center', '', 'cellpadding="0" cellspacing="0" border="0"' );
+                   html_tag( 'tr' ) .
+                        html_tag( 'td' ) .
+                             '<b><center>' . _("Table of Contents") . '</center></b><br>';
         do_hook('help_chapter');
-        echo '<ol>';
+        echo html_tag( 'ol' );
         for ($i=0; $i < count($helpdir); $i++) {
             $doc = file("../help/$user_language/$helpdir[$i]");
             $help_info = get_info($doc, 0);
             echo '<li><a href="../src/help.php?chapter=' . ($i+1)
-                 . '">' . $help_info[0] . '</a>';
-                 echo '<ul>' . $help_info[2] . '</ul>';
+                 . '">' . $help_info[0] . '</a>' .
+                 html_tag( 'ul', $help_info[2] );
         }
         echo '</ol></td></tr></table>';
     } else {
@@ -202,17 +202,15 @@ if ($help_exists == true) {
         if (isset($help_info[1])){
             echo $help_info[1];
         } else {
-            echo '<p>' . $help_info[2] . '</p>';
+            echo html_tag( 'p', $help_info[2], 'left' );
         }
              
         $section = 0;
         for ($n = $help_info[3]; $n < count($doc); $n++) {
             $section++;
             $help_info = get_info($doc, $n);
-            echo "<b>$chapter.$section - $help_info[0]</b>";
-            echo '<ul>';
-            echo $help_info[1];
-            echo '</ul>';
+            echo "<b>$chapter.$section - $help_info[0]</b>" .
+                html_tag( 'ul', $help_info[1] );
             $n = $help_info[3];
         }
 
@@ -220,6 +218,9 @@ if ($help_exists == true) {
     }
 }
 do_hook('help_bottom');
+
+echo html_tag( 'tr',
+            html_tag( 'td', '&nbsp;', 'left', $color[0] )
+        ).
+       '</table></body></html>';
 ?>
-<tr><td bgcolor="<?php echo $color[0] ?>">&nbsp;</td></tr></table>
-</body></html>