r2l by Yoav
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 25 Jun 2002 11:05:52 +0000 (11:05 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 25 Jun 2002 11:05:52 +0000 (11:05 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3007 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/options.php
src/options_highlight.php
src/options_identities.php
src/options_order.php

index 3fd806955fb5aa5957cbced7c5b1e6c7c736fbd0..209afbd3a13e8393548bf39749f0dbf510ff5b10 100644 (file)
@@ -18,6 +18,7 @@ require_once('../functions/imap.php');
 require_once('../functions/array.php');
 require_once('../functions/options.php');
 require_once('../functions/strings.php');
 require_once('../functions/array.php');
 require_once('../functions/options.php');
 require_once('../functions/strings.php');
+require_once('../functions/html.php');
 
 /*********************************/
 /*** Build the resultant page. ***/
 
 /*********************************/
 /*** Build the resultant page. ***/
@@ -46,7 +47,7 @@ function process_optionmode_submit($optpage, $optpage_data) {
             /* Remove Debug Mode Until Needed
             echo "name = '$option->name', "
                . "value = '$option->value', "
             /* Remove Debug Mode Until Needed
             echo "name = '$option->name', "
                . "value = '$option->value', "
-               . "new_value = '$option->new_value'<BR>\n";
+               . "new_value = '$option->new_value'<br>\n";
             */
             if ($option->changed()) {
                 $option->save();
             */
             if ($option->changed()) {
                 $option->save();
@@ -70,40 +71,41 @@ function process_optionmode_link($optpage) {
 function print_optionpages_row($leftopt, $rightopt = false) {
     global $color;
 
 function print_optionpages_row($leftopt, $rightopt = false) {
     global $color;
 
-    echo "<TABLE BGCOLOR=\"$color[4]\" WIDTH=\"100%\" CELLPADDING=0 CELLSPACING=5 BORDER=0>" .
-            '<TR><TD VALIGN="TOP">' .
-               '<TABLE WIDTH="100%" CELLPADDING="3" CELLSPACING="0" BORDER="0">' .
-                  '<TR>' .
-                     "<TD VALIGN=TOP BGCOLOR=\"$color[9]\" WIDTH=\"49%\">" .
-                        '<A HREF="' . $leftopt['url'] . '">' . $leftopt['name'] . '</A>'.
-                     '</TD>'.
-                     "<TD VALIGN=TOP BGCOLOR=\"$color[4]\" WIDTH=\"2%\">&nbsp;</TD>";
     if ($rightopt) {
     if ($rightopt) {
-        echo         "<TD VALIGN=top BGCOLOR=\"$color[9]\" WIDTH=\"49%\">" .
-                        '<A HREF="' . $rightopt['url'] . '">' . $rightopt['name'] . '</A>' .
-                     '</TD>';
+        $rightopt_name = html_tag( 'td', '<a href="' . $rightopt['url'] . '">' . $rightopt['name'] . '</a>', 'left', $color[9], 'valign="top" width="49%"' );
+        $rightopt_desc = html_tag( 'td', $rightopt['desc'], 'left', $color[0], 'valign="top" width="49%"' );
     } else {
     } else {
-        echo         "<TD VALIGN=top BGCOLOR=\"$color[4]\" WIDTH=\"49%\">&nbsp;</TD>";
+        $rightopt_name = html_tag( 'td', '&nbsp;', 'left', $color[4], 'valign="top" width="49%"' );
+        $rightopt_desc = html_tag( 'td', '&nbsp;', 'left', $color[4], 'valign="top" width="49%"' );
     }
 
     }
 
-    echo          '</TR>' .
-                  '<TR>' .
-                     "<TD VALIGN=top BGCOLOR=\"$color[0]\" WIDTH=\"49%\">" .
-                        $leftopt['desc'] .
-                     '</TD>' .
-                     "<TD VALIGN=top BGCOLOR=\"$color[4]\" WIDTH=\"2%\">&nbsp;</TD>";
-    if ($rightopt) {
-        echo         "<TD VALIGN=top BGCOLOR=\"$color[0]\" WIDTH=\"49%\">" .
-                        $rightopt['desc'] .
-                     '</TD>';
-    } else {
-        echo         "<TD VALIGN=top BGCOLOR=\"$color[4]\" WIDTH=\"49%\">&nbsp;</TD>";
-    }
-    
-    echo          '</TR>' . 
-               '</TABLE>' .
-            '</TD></TR>' .
-         "</TABLE>\n";
+    echo
+    html_tag( 'table', "\n" .
+        html_tag( 'tr', "\n" .
+            html_tag( 'td', "\n" .
+                html_tag( 'table', "\n" .
+                    html_tag( 'tr', "\n" .
+                        html_tag( 'td',
+                            '<a href="' . $leftopt['url'] . '">' . $leftopt['name'] . '</a>' ,
+                        'left', $color[9], 'valign="top" width="49%"' ) .
+                        html_tag( 'td',
+                            '&nbsp;' ,
+                        'left', $color[4], 'valign="top" width="2%"' ) . "\n" .
+                        $rightopt_name
+                    ) . "\n" .
+                    html_tag( 'tr', "\n" .
+                        html_tag( 'td',
+                            $leftopt['desc'] ,
+                        'left', $color[0], 'valign="top" width="49%"' ) .
+                        html_tag( 'td',
+                            '&nbsp;' ,
+                        'left', $color[4], 'valign="top" width="2%"' ) . "\n" .
+                        $rightopt_desc
+                    ) ,
+                '', '', 'width="100%" cellpadding="2" cellspacing="0" border="0"' ) ,
+            'left', '', 'valign="top"' )
+        ) ,
+    '', $color[4], 'width="100%" cellpadding="0" cellspacing="5" border="0"' );
 }
 
 /* ---------------------------- main ---------------------------- */
 }
 
 /* ---------------------------- main ---------------------------- */
@@ -200,12 +202,14 @@ if (isset($optpage_name) && ($optpage_name != '')) {
     $optpage_title .= " - $optpage_name";
 }
 
     $optpage_title .= " - $optpage_name";
 }
 
-echo '<BR>' .
-     "<TABLE BGCOLOR=\"$color[0]\" WIDTH=\"95%\" ALIGN=\"CENTER\" CELLPADDING=\"2\" CELLSPACING=\"0\" BORDER=\"0\">\n".
-    '<TR><TD ALIGN="CENTER">'.
-    "<B>$optpage_title</B><BR>\n".
-    '<TABLE WIDTH="100%" BORDER="0" CELLPADDING="5" CELLSPACING="0">'.
-    "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=\"CENTER\">\n";
+echo '<br>' .
+    html_tag( 'table', '', 'center', $color[0], 'width="95%" cellpadding="2" cellspacing="0" border="0"' ) . "\n" .
+        html_tag( 'tr' ) . "\n" .
+            html_tag( 'td', '', 'center' ) .
+                "<b>$optpage_title</b><br>\n".
+                html_tag( 'table', '', '', '', 'width="100%" cellpadding="5" cellspacing="0" border="0"' ) . "\n" .
+                    html_tag( 'tr' ) . "\n" .
+                        html_tag( 'td', '', 'center', $color[4] ) . "\n";
 
 /*******************************************************************/
 /* DO OLD SAVING OF SUBMITTED OPTIONS. THIS WILL BE REMOVED LATER. */
 
 /*******************************************************************/
 /* DO OLD SAVING OF SUBMITTED OPTIONS. THIS WILL BE REMOVED LATER. */
@@ -261,14 +265,14 @@ if ($optpage == SMOPT_PAGE_MAIN) {
             $frame_top = '_top';
         }
         /* Display a message indicating a successful save. */
             $frame_top = '_top';
         }
         /* Display a message indicating a successful save. */
-        echo '<B>' . _("Successfully Saved Options") . ": $optpage_name</B><BR>\n";
+        echo '<b>' . _("Successfully Saved Options") . ": $optpage_name</b><br>\n";
 
         /* If $max_refresh != SMOPT_REFRESH_NONE, provide a refresh link. */
         if ( !isset( $max_refresh ) ) {
         } else if ($max_refresh == SMOPT_REFRESH_FOLDERLIST) {
 
         /* If $max_refresh != SMOPT_REFRESH_NONE, provide a refresh link. */
         if ( !isset( $max_refresh ) ) {
         } else if ($max_refresh == SMOPT_REFRESH_FOLDERLIST) {
-            echo '<A HREF="../src/left_main.php" TARGET="left">' . _("Refresh Folder List") . '</A><BR>';
+            echo '<a href="../src/left_main.php" target="left">' . _("Refresh Folder List") . '</a><br>';
         } else if ($max_refresh) {
         } else if ($max_refresh) {
-            echo '<A HREF="../src/webmail.php?right_frame=options.php" TARGET="' . $frame_top . '">' . _("Refresh Page") . '</A><BR>';
+            echo '<a href="../src/webmail.php?right_frame=options.php" target="' . $frame_top . '">' . _("Refresh Page") . '</a><br>';
         }
     }
     /******************************************/
         }
     }
     /******************************************/
@@ -337,9 +341,12 @@ if ($optpage == SMOPT_PAGE_MAIN) {
     /* Now, print out each option page section. */
     /********************************************/
     $first_optpage = false;
     /* Now, print out each option page section. */
     /********************************************/
     $first_optpage = false;
-    echo "<TABLE BGCOLOR=\"$color[4]\" WIDTH=\"100%\" CELLPADDING=0 CELLSPACING=\"5\" BORDER=\"0\">" .
-                '<TR><TD VALIGN="TOP">' .
-                   "<TABLE BGCOLOR=\"$color[4]\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" BORDER=\"0\"><TR><TD>";
+    echo html_tag( 'table', '', '', $color[4], 'width="100%" cellpadding="0" cellspacing="5" border="0"' ) . "\n" .
+                html_tag( 'tr' ) . "\n" .
+                    html_tag( 'td', '', 'left', '', 'valign="top"' ) .
+                        html_tag( 'table', '', '', $color[4], 'width="100%" cellpadding="3" cellspacing="0" border="0"' ) . "\n" .
+                            html_tag( 'tr' ) . "\n" .
+                                html_tag( 'td', '', 'left' );
     foreach ($optpage_blocks as $next_optpage) {
         if ($first_optpage == false) {
             $first_optpage = $next_optpage;
     foreach ($optpage_blocks as $next_optpage) {
         if ($first_optpage == false) {
             $first_optpage = $next_optpage;
@@ -353,7 +360,7 @@ if ($optpage == SMOPT_PAGE_MAIN) {
         print_optionpages_row($first_optpage);
     }
 
         print_optionpages_row($first_optpage);
     }
 
-    echo "</TD></TR></TABLE></TD></TR></TABLE>\n";
+    echo "</td></tr></table></td></tr></table>\n";
 
     do_hook('options_link_and_description');
 
 
     do_hook('options_link_and_description');
 
@@ -362,10 +369,12 @@ if ($optpage == SMOPT_PAGE_MAIN) {
 /* If we are not looking at the main option page, display the page here. */
 /*************************************************************************/
 } else {
 /* If we are not looking at the main option page, display the page here. */
 /*************************************************************************/
 } else {
-    echo '<FORM NAME="f" ACTION="options.php" METHOD="POST"><BR>' . "\n"
+    echo '<form name="f" action="options.php" method="post"><br>' . "\n"
        . create_optpage_element($optpage)
        . create_optmode_element(SMOPT_MODE_SUBMIT)
        . create_optpage_element($optpage)
        . create_optmode_element(SMOPT_MODE_SUBMIT)
-       . '<TABLE WIDTH="100%" CELLPADDING=2 CELLSPACING=0 BORDER=0>' . "\n";
+       . html_tag( 'table', '', '', '', 'width="100%" cellpadding="2" cellspacing="0" border="0"' ) . "\n"
+       . html_tag( 'tr' ) . "\n"
+       . html_tag( 'td', '', 'left' ) . "\n";
 
     /* Output the option groups for this page. */
     print_option_groups($optpage_data['options']);
 
     /* Output the option groups for this page. */
     print_option_groups($optpage_data['options']);
@@ -410,7 +419,7 @@ if ($optpage == SMOPT_PAGE_MAIN) {
 
     /* Spit out a submit button. */
     OptionSubmit($submit_name);
 
     /* Spit out a submit button. */
     OptionSubmit($submit_name);
-    echo '</TABLE></FORM>';
+    echo '</td></tr></table></form>';
 
     /* If it is not empty, trigger the bottom hook. */
     if ($bottom_hook_name != '') {
 
     /* If it is not empty, trigger the bottom hook. */
     if ($bottom_hook_name != '') {
@@ -418,10 +427,10 @@ if ($optpage == SMOPT_PAGE_MAIN) {
     }
 }
 
     }
 }
 
-echo        '</TD></TR>' .
-        '</TABLE>'.
-        '</TD></TR>'.
-     '</TABLE>' .
-     '</BODY></HTML>';
+echo        '</td></tr>' .
+        '</table>'.
+        '</td></tr>'.
+     '</table>' .
+     '</body></html>';
 
 ?>
 
 ?>
index fdd0a279230080c635801b9a2245353d1cca4a10..8d21a7459aca796a92877038049c196a2b7106b9 100644 (file)
@@ -17,6 +17,7 @@ require_once('../functions/imap.php');
 require_once('../functions/array.php');
 require_once('../functions/plugin.php');
 require_once('../functions/strings.php');
 require_once('../functions/array.php');
 require_once('../functions/plugin.php');
 require_once('../functions/strings.php');
+require_once('../functions/html.php');
 
 function oh_opt( $val, $sel, $tit ) {
     echo "<option value=\"$val\"";
 
 function oh_opt( $val, $sel, $tit ) {
     echo "<option value=\"$val\"";
@@ -56,30 +57,57 @@ if ($action == 'delete' && isset($theid)) {
     $message_highlight_list[$theid]['match_type'] = $match_type;
 }
 displayPageHeader($color, 'None');
     $message_highlight_list[$theid]['match_type'] = $match_type;
 }
 displayPageHeader($color, 'None');
-?>
-<br>
-<table width="95%" align="center" border="0" cellpadding="2" cellspacing="0"><tr><td bgcolor="<?php echo $color[0] ?>">
-    <center><b><?php echo _("Options") . ' - ' . _("Message Highlighting"); ?></b></center>
-</td></tr></table>
 
 
-<?php
-echo '<br><center>[<a href="options_highlight.php?action=add">' . _("New") . '</a>]'.
+echo '<br>' .
+html_tag( 'table', "\n" .
+    html_tag( 'tr', "\n" .
+        html_tag( 'td', '<center><b>' . _("Options") . ' - ' . _("Message Highlighting") . '</b></center>',
+        'left', $color[0] )
+    ) ,
+'center', '', 'width="95% border="0" cellpadding="2" cellspacing="0"' ) . "<br>\n" .
+html_tag( 'table', '', '', '', 'width="100% border="0" cellpadding="0" cellspacing="0"' ) . 
+     html_tag( 'tr' ) . "\n" .
+         html_tag( 'td', '', 'left' );
+
+echo '<center>[<a href="options_highlight.php?action=add">' . _("New") . '</a>]'.
         ' - [<a href="options.php">'._("Done").'</a>]</center><br>'."\n";
 if (count($message_highlight_list) >= 1) {
         ' - [<a href="options.php">'._("Done").'</a>]</center><br>'."\n";
 if (count($message_highlight_list) >= 1) {
-    echo '<table border="0" cellpadding="3" cellspacing="0" align="center" width="80%">'."\n";
+    echo html_tag( 'table', '', 'center', '', 'width="80% border="0" cellpadding="3" cellspacing="0"' ) . "\n";
     for ($i=0; $i < count($message_highlight_list); $i++) {
     for ($i=0; $i < count($message_highlight_list); $i++) {
-        echo '<tr bgcolor="' . $message_highlight_list[$i]['color'] . '">'.
-                "<td width=\"20%\" bgcolor=\"$color[4]\" nowrap>".
-                "<small>[<a href=\"options_highlight.php?action=edit&amp;theid=$i\">".
-            _("Edit") .
-            '</a>]&nbsp;[<a href="options_highlight.php?action=delete&amp;theid='.
-            $i . '">' . _("Delete") . '</a>]</small>'.
-            '</td><td>'.
-            htmlspecialchars($message_highlight_list[$i]['name']) .
-            '</td><td>'.
-            $message_highlight_list[$i]['match_type'] . ' = ' .
-            htmlspecialchars($message_highlight_list[$i]['value']).
-            '</td></tr>';
+        $match_type = '';
+        switch ($message_highlight_list[$i]['match_type'] ) {
+            case 'from' :
+                $match_type = _("From");
+            break;
+            case 'to' :
+                $match_type = _("To");
+            break;
+            case 'cc' :
+                $match_type = _("Cc");
+            break;
+            case 'to_cc' :
+                $match_type = _("To or Cc");
+            break;
+            case 'subject' :
+                $match_type = _("subject");
+            break;
+        }
+
+        echo html_tag( 'tr',
+                    html_tag( 'td',
+                        '<small>[<a href="options_highlight.php?action=edit&amp;theid=' . $i . '">' .
+                        _("Edit") .
+                        '</a>]&nbsp;[<a href="options_highlight.php?action=delete&amp;theid='.
+                        $i . '">' . _("Delete") . '</a>]</small>' ,
+                    'left', $color[4], 'width="20%" nowrap' ) .
+                    html_tag( 'td',
+                        htmlspecialchars($message_highlight_list[$i]['name']) ,
+                    'left' ) .
+                    html_tag( 'td',
+                        $match_type . ' = ' .
+                        htmlspecialchars($message_highlight_list[$i]['value']) ,
+                    'left' ) ,
+                '', $message_highlight_list[$i]['color'] ) . "\n";
     }
     echo "</table>\n".
         "<br>\n";
     }
     echo "</table>\n".
         "<br>\n";
@@ -245,20 +273,41 @@ if ($action == 'edit' || $action == 'add') {
             }
     }
     }
             }
     }
     }
+
+    if (isset($message_highlight_list[$theid]['color'])) {
+        $current_color = $message_highlight_list[$theid]['color'];
+    }
+    else {
+        $current_color = '63aa7f';
+    }
+
+    for($x = 0; $x < 5; $x++) {
+        for($y = 0; $y < 19; $y++) {
+            $gridindex = "$y,$x";
+            $gridcolor = $new_color_list[$gridindex];
+            if ($gridcolor == $current_color) {
+                $pre_defined_color = 1;
+                break;
+            }
+        }
+    }
+
     if (!isset($message_highlight_list[$theid]['color']))
         $selected_choose = ' checked';
     if (!isset($message_highlight_list[$theid]['color']))
         $selected_choose = ' checked';
+    else if ($pre_defined_color)
+        $selected_predefined = ' checked';
     else if ($selected_choose == '')
         $selected_input = ' checked';
 
     echo '<form name="f" action="options_highlight.php">' . "\n";
     echo '<input type="hidden" value="save" name="action">' . "\n";
     echo '<input type="hidden" value="'.$theid.'" name="theid">' . "\n";
     else if ($selected_choose == '')
         $selected_input = ' checked';
 
     echo '<form name="f" action="options_highlight.php">' . "\n";
     echo '<input type="hidden" value="save" name="action">' . "\n";
     echo '<input type="hidden" value="'.$theid.'" name="theid">' . "\n";
-    echo '<table width="80%" align="center" cellpadding="3" cellspacing="0" border="0">' . "\n";
-    echo "   <tr bgcolor=\"$color[0]\">\n";
-    echo "      <td align=\"right\" nowrap><b>\n";
+    echo html_tag( 'table', '', 'center', '', 'width="80%" cellpadding="3" cellspacing="0" border="0"' ) . "\n";
+    echo html_tag( 'tr', '', '', $color[0] ) . "\n";
+    echo html_tag( 'td', '', 'right', '', 'nowrap' ) . "<b>\n";
     echo _("Identifying name") . ":";
     echo '      </b></td>' . "\n";
     echo _("Identifying name") . ":";
     echo '      </b></td>' . "\n";
-    echo '      <td>' . "\n";
+    echo html_tag( 'td', '', 'left' ) . "\n";
     if (isset($message_highlight_list[$theid]['name']))
         $disp = $message_highlight_list[$theid]['name'];
     else
     if (isset($message_highlight_list[$theid]['name']))
         $disp = $message_highlight_list[$theid]['name'];
     else
@@ -267,12 +316,10 @@ if ($action == 'edit' || $action == 'add') {
     echo "         <input type=\"text\" value=\"".$disp."\" name=\"identname\">";
     echo "      </td>\n";
     echo "   </tr>\n";
     echo "         <input type=\"text\" value=\"".$disp."\" name=\"identname\">";
     echo "      </td>\n";
     echo "   </tr>\n";
-    echo '   <tr><td><small><small>&nbsp;</small></small></td></tr>' . "\n";
-    echo "   <tr bgcolor=\"$color[0]\">\n";
-    echo '      <td align="right"><b>' . "\n";
-    echo _("Color") . ':';
-    echo "      </b></td>\n";
-    echo '      <td>' . "\n";
+    echo html_tag( 'tr', html_tag( 'td', '<small><small>&nbsp;</small></small>', 'left' ) ) ."\n";
+    echo html_tag( 'tr', '', '', $color[0] ) . "\n";
+    echo html_tag( 'td', '<b>'. _("Color") . ':</b>', 'right' );
+    echo html_tag( 'td', '', 'left' );
     echo "         <input type=\"radio\" name=color_type value=1$selected_choose> &nbsp;<select name=newcolor_choose>\n";
     echo "            <option value=\"$color_list[0]\"$selected0>" . _("Dark Blue") . "\n";
     echo "            <option value=\"$color_list[1]\"$selected1>" . _("Dark Green") . "\n";
     echo "         <input type=\"radio\" name=color_type value=1$selected_choose> &nbsp;<select name=newcolor_choose>\n";
     echo "            <option value=\"$color_list[0]\"$selected0>" . _("Dark Blue") . "\n";
     echo "            <option value=\"$color_list[1]\"$selected1>" . _("Dark Green") . "\n";
@@ -296,31 +343,26 @@ if ($action == 'edit' || $action == 'add') {
     echo "   </tr>\n";
 
     # Show grid of color choices
     echo "   </tr>\n";
 
     # Show grid of color choices
-    echo "<tr bgcolor=\"$color[0]\"><td colspan='2'>\n";
-    echo "<table border=0 cellpadding=\"2\" align=\"center\" cellspacing=\"1\">\n";
-    if (isset($message_highlight_list[$theid]['color'])) {
-        $current_color = $message_highlight_list[$theid]['color'];
-    }
-    else {
-        $current_color = '63aa7f';
-    }
+    echo html_tag( 'tr', '', '', $color[0] ) . "\n";
+    echo html_tag( 'td', '', 'left', '', 'colspan="2"' );
+    echo html_tag( 'table', '', 'center', '', 'border=0 cellpadding="2" cellspacing="1"' ) . "\n";
+
     for($x = 0; $x < 5; $x++) {
     for($x = 0; $x < 5; $x++) {
-        echo "<tr>\n";
+        echo html_tag( 'tr' ) . "\n";
         for($y = 0; $y < 19; $y++) {
         $gridindex = "$y,$x";
         $gridcolor = $new_color_list[$gridindex];
         for($y = 0; $y < 19; $y++) {
         $gridindex = "$y,$x";
         $gridcolor = $new_color_list[$gridindex];
-        $selected = ($gridcolor == $current_color)?'CHECKED':'' ;
-        echo "<td bgcolor=\"#$gridcolor\"><input type='radio' name=color_type value='#$gridcolor' $selected>\n";
-        echo "</td>\n";
+        $selected = ($gridcolor == $current_color) ? ' checked' : '' ;
+        echo html_tag( 'td', '<input type="radio" name="color_type" value="#' . $gridcolor .'"' . $selected . '>', 'left', $gridcolor, 'colspan="2"' );
         }
         echo "</tr>\n";
     }
     echo "</table>\n";
     echo "</td></tr>\n";
 
         }
         echo "</tr>\n";
     }
     echo "</table>\n";
     echo "</td></tr>\n";
 
-    echo '   <tr><td><small><small>&nbsp;</small></small></td></tr>' . "\n";
-    echo "   <tr bgcolor=\"$color[0]\">\n";
-    echo '      <td align="center" colspan=2>' . "\n";
+    echo html_tag( 'tr', html_tag( 'td', '<small><small>&nbsp;</small></small>', 'left' ) ) . "\n";
+    echo html_tag( 'tr', '', '', $color[0] ) . "\n";
+    echo html_tag( 'td', '', 'center', '', 'colspan="2"' ) . "\n";
     echo "         <select name=match_type>\n";
     oh_opt( 'from',
             ($message_highlight_list[$theid]['match_type'] == 'from'),
     echo "         <select name=match_type>\n";
     oh_opt( 'from',
             ($message_highlight_list[$theid]['match_type'] == 'from'),
index 310f06079af83abcd0b58d37172a60eed2e040d3..25e087ae5d89a4527fc720b3038240cca756ad51 100644 (file)
@@ -13,6 +13,7 @@
 
 require_once('../src/validate.php');
 require_once('../functions/display_messages.php');
 
 require_once('../src/validate.php');
 require_once('../functions/display_messages.php');
+require_once('../functions/html.php');
 
     if (isset($return)) {
        SaveUpdateFunction();
 
     if (isset($return)) {
        SaveUpdateFunction();
@@ -34,61 +35,46 @@ require_once('../functions/display_messages.php');
         SaveUpdateFunction();
     }
  
         SaveUpdateFunction();
     }
  
+   do_hook('options_identities_top');
    LoadInfo($full_name, $email_address, $reply_to, $signature, '');
    LoadInfo($full_name, $email_address, $reply_to, $signature, '');
-
-?>
-<br>
-<table width="95%" align=center border=0 cellpadding=2 cellspacing=0>
-<tr><td bgcolor="<?php echo $color[0] ?>" align="center">
-
-      <b><?php echo _("Options") . ' - ' . _("Advanced Identities"); ?></b>
-
-    <table width="100%" border="0" cellpadding="1" cellspacing="1">
-    <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
-
-<form name="f" action="options_identities.php" method="post"><br>
-
-<?php do_hook('options_identities_top'); ?>
-
-<table width="80%" cellpadding=2 cellspacing=0 border=0>
-  <tr bgcolor="<?php echo $color[9] ?>">
-    <th colspan=2 align=center><?php echo _("Default Identity") ?></th>
-  </tr>
-<?PHP
-
-   ShowTableInfo($full_name, $email_address, $reply_to, $signature, '');
+   $td_str = '';
+   $td_str .= '<form name="f" action="options_identities.php" method="post"><br>';
+   $td_str .= ShowTableInfo($full_name, $email_address, $reply_to, $signature, '');
   
   
-    $num = 1;
-   while (LoadInfo($full_name, $email_address, $reply_to, $signature, $num))
-    {
-?>
-  <tr bgcolor="<?PHP echo $color[9] ?>">
-    <th colspan=2 align=center><?PHP printf (_("Alternate Identity %d"),
-    $num) ?></th>
-  </tr>
-<?PHP
-       ShowTableInfo($full_name, $email_address, $reply_to, $signature, $num);
-        $num ++;
-    }
-   
-?>
-  <tr bgcolor="<?php echo $color[9] ?>">
-    <th colspan=2 align=center><?PHP echo _("Add a New Identity") ?></th>
-  </tr>
-<?php
-    ShowTableInfo('', '', '', '', $num);
-?>
-</table>
-</form>
-
-    </td></tr>
-    </table>
-
-</td></tr>
-</table>
-</body></html>
-
-<?PHP
+   $num = 1;
+   while (LoadInfo($full_name, $email_address, $reply_to, $signature, $num)) {
+       $td_str .= html_tag( 'tr',
+                          html_tag( 'th', sprintf (_("Alternate Identity %d"), $num), 'center', '', 'colspan="2"' ) ,
+                      '', $color[9]);
+       $td_str .= ShowTableInfo($full_name, $email_address, $reply_to, $signature, $num);
+       $num ++;
+       }
+
+   echo '<br>' . 
+   html_tag( 'table', "\n" .
+       html_tag( 'tr', "\n" .
+           html_tag( 'td', "\n" .
+               '<b>'. _("Options") . ' - ' . _("Advanced Identities") .'</b><br>' .
+               html_tag( 'table', "\n" .
+                   html_tag( 'tr', "\n" .
+                       html_tag( 'td', "\n" .
+                           html_tag( 'table', "\n" .
+                               html_tag( 'tr', "\n" .
+                                   html_tag( 'th', _("Default Identity"), 'center', '', 'colspan="2"' ) ,
+                                   '', $color[9]) . "\n" .
+                                   $td_str . "\n" .
+                               html_tag( 'tr',
+                                   html_tag( 'th', _("Add a New Identity") . ShowTableInfo('', '', '', '', $num), 'center', '', 'colspan="2"' ) ,
+                               '', $color[9]) ,
+                            '', '', 'width="80%" cellpadding="2" cellspacing="0" border="0"' ) ,
+                       'center', $color[4] )
+                   ) ,
+               '', '', 'width="100%" border="0" cellpadding="1" cellspacing="1"' ) ,
+           'center', $color[0] )
+       ) ,
+   'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"' ) .
+
+   '</body></html>';
 
     function SaveUpdateFunction() {
         global $username, $data_dir, $full_name, $email_address, $reply_to, $signature;
 
     function SaveUpdateFunction() {
         global $username, $data_dir, $full_name, $email_address, $reply_to, $signature;
@@ -294,27 +280,25 @@ require_once('../functions/display_messages.php');
     }
 
 function sti_input( $title, $hd, $data, $post, $bg ) {
     }
 
 function sti_input( $title, $hd, $data, $post, $bg ) {
-
-    echo "<tr$bg><td align=right nowrap>$title:".
-         '</td><td>'.
-         '<input size=50 type=text value="' . htmlspecialchars($data) .
-         "\" name=\"$hd$post\"></td></tr>";
-
+    $return_val = html_tag( 'tr',
+                           html_tag( 'td', $title . ':', 'right', '', 'nowrap' ) .
+                           html_tag( 'td', '<input size="50" type="text" value="' . htmlspecialchars($data) . '" name="' . $hd . $post . '">' , 'left' ) ,
+                       '', $bg );
+     return ($return_val);
 }
 
 function sti_textarea( $title, $hd, $data, $post, $bg ) {
 }
 
 function sti_textarea( $title, $hd, $data, $post, $bg ) {
-
-    echo "<tr$bg><td align=right nowrap>$title:".
-         '</td><td>'.
-         "<textarea cols=50 rows=5 name=\"$hd$post\">" . htmlspecialchars($data) .
-         "</textarea></td></tr>";
-
+    $return_val = html_tag( 'tr',
+                           html_tag( 'td', $title . ':', 'right', '', 'nowrap' ) .
+                           html_tag( 'td', '<textarea cols="50" rows="5" name="' . $hd . $post . '">' . htmlspecialchars($data) . '</textarea>' , 'left' ) ,
+                       '', $bg );
+     return ($return_val);
 }
 
 function ShowTableInfo($full_name, $email_address, $reply_to, $signature, $post) {
     global $color;
 
 }
 
 function ShowTableInfo($full_name, $email_address, $reply_to, $signature, $post) {
     global $color;
 
-    $OtherBG = ' bgcolor="' . $color[0] . '"';
+    $OtherBG = $color[0];
     if ($full_name == '' && $email_address == '' && $reply_to == '' && $signature == '')
         $OtherBG = '';
 
     if ($full_name == '' && $email_address == '' && $reply_to == '' && $signature == '')
         $OtherBG = '';
 
@@ -323,29 +307,34 @@ function ShowTableInfo($full_name, $email_address, $reply_to, $signature, $post)
     else
         $isEmptySection = false;
 
     else
         $isEmptySection = false;
 
-    sti_input( _("Full Name"), 'full_name', $full_name, $post, $OtherBG );
-    sti_input( _("E-Mail Address"), 'email_address', $email_address, $post, $OtherBG );
-    sti_input( _("Reply To"), 'reply_to', $reply_to, $post, $OtherBG );
-    sti_textarea( _("Signature"), 'signature', $signature, $post, $OtherBG );
+    $return_val = '';
+    $return_val .= sti_input( _("Full Name"), 'full_name', $full_name, $post, $OtherBG );
+    $return_val .= sti_input( _("E-Mail Address"), 'email_address', $email_address, $post, $OtherBG );
+    $return_val .= sti_input( _("Reply To"), 'reply_to', $reply_to, $post, $OtherBG );
+    $return_val .= sti_textarea( _("Signature"), 'signature', $signature, $post, $OtherBG );
 
     do_hook('options_identities_table', $OtherBG, $isEmptySection, $post);
 
     do_hook('options_identities_table', $OtherBG, $isEmptySection, $post);
-    echo "<tr$OtherBG>".
-         '<td>&nbsp;</td><td>'.
-         "<input type=hidden name=\"form_for_$post\" value=\"1\">".
-         '<input type=submit name="update" value="'.
-         _("Save / Update") . '">';
+    $return_val .= html_tag( 'tr', '', '', $OtherBG);
+    $return_val .= html_tag( 'td', '&nbsp;', 'left' );
+    $return_val .= html_tag( 'td', '', 'left' );
+    $return_val .= '<input type=hidden name="form_for_'. $post .'" value="1">';
+    $return_val .= '<input type="submit" name="update" value="' . _("Save / Update") . '">';
+
+
     if (! $isEmptySection && $post != '') {
     if (! $isEmptySection && $post != '') {
-        echo "<input type=submit name=\"make_default_$post\" value=\"".
+        $return_val .= '<input type="submit" name="make_default_' . $post . '" value="'.
              _("Make Default") . '">'.
              _("Make Default") . '">'.
-             "<input type=submit name=\"delete_$post\" value=\"".
+             '<input type=submit name="delete_' . $post . '" value="'.
              _("Delete") . '">';
     }
     if (! $isEmptySection && $post != '' && $post > 1) {
              _("Delete") . '">';
     }
     if (! $isEmptySection && $post != '' && $post > 1) {
-        echo '<input type=submit name="promote_' . $post . '" value="'.
+        $return_val .= '<input type=submit name="promote_' . $post . '" value="'.
              _("Move Up") . '">';
     }
     do_hook('options_identities_buttons', $isEmptySection, $post);
              _("Move Up") . '">';
     }
     do_hook('options_identities_buttons', $isEmptySection, $post);
-    echo '</td></tr>'.
-         '<tr><td colspan="2">&nbsp;</td></tr>';
+    $return_val .=  '</td></tr>'.
+         html_tag( 'tr', html_tag( 'td', '&nbsp;', 'left', '', 'colspan="2"' ));
+
+    return ($return_val);
 }
 ?>
\ No newline at end of file
 }
 ?>
\ No newline at end of file
index 3be5f87fcd41ebfbd692497fe7f91358ee382fb0..629e83a822692f015350bf0e280b09d869a774d8 100644 (file)
@@ -16,6 +16,7 @@ require_once('../functions/display_messages.php');
 require_once('../functions/imap.php');
 require_once('../functions/array.php');
 require_once('../functions/plugin.php');
 require_once('../functions/imap.php');
 require_once('../functions/array.php');
 require_once('../functions/plugin.php');
+require_once('../functions/html.php');
 
 if (! isset($action)) { $action = ''; }
 if ($action == 'delete' && isset($theid)) {
 
 if (! isset($action)) { $action = ''; }
 if ($action == 'delete' && isset($theid)) {
@@ -23,16 +24,15 @@ if ($action == 'delete' && isset($theid)) {
 } elseif ($action == 'save') {
 } 
 displayPageHeader($color, 'None');
 } elseif ($action == 'save') {
 } 
 displayPageHeader($color, 'None');
-?>
-   <br>
-<table width="95%" align=center border=0 cellpadding=2 cellspacing=0>
-<tr><td align="center" bgcolor="<?php echo $color[0] ?>">
-
-      <b><?php echo _("Options") . " - " . _("Index Order"); ?></b>
 
 
-    <table width="100%" border="0" cellpadding="1" cellspacing="1">
-    <tr><td bgcolor="<?php echo $color[4] ?>" align="center"><br>
-<?php
+   echo '<br>' . 
+   html_tag( 'table', '', 'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"' ) . 
+   html_tag( 'tr' ) . 
+   html_tag( 'td', '', 'center', $color[0] ) .
+   '<b>' . _("Options") . ' - ' . _("Index Order") . '</b>' .
+   html_tag( 'table', '', '', '', 'width="100%" border="0" cellpadding="1" cellspacing="1"' ) . 
+   html_tag( 'tr' ) . 
+   html_tag( 'td', '', 'center', $color[4] );
  
     $available[1] = _("Checkbox");
     $available[2] = _("From");
  
     $available[1] = _("Checkbox");
     $available[2] = _("From");
@@ -81,30 +81,36 @@ displayPageHeader($color, 'None');
            setPref($data_dir, $username, "order$i", $index_order[$i]);
         }
     }
            setPref($data_dir, $username, "order$i", $index_order[$i]);
         }
     }
-    echo '<table cellspacing="0" cellpadding="0" border="0" width="65%"><tr><td>' . "\n";
-    echo _("The index order is the order that the columns are arranged in the message index.  You can add, remove, and move columns around to customize them to fit your needs.");
-    echo '</td></tr></table><br>';
+    echo html_tag( 'table',
+                html_tag( 'tr',
+                    html_tag( 'td',
+                        _("The index order is the order that the columns are arranged in the message index.  You can add, remove, and move columns around to customize them to fit your needs.")
+                    )
+                ) ,
+            '', '', '', 'width="65%" border="0" cellpadding="0" cellspacing="0"' ) . "<br>\n";
  
     if (count($index_order))
     {
  
     if (count($index_order))
     {
-        echo '<table cellspacing="0" cellpadding="0" border="0">' . "\n";
+        echo html_tag( 'table', '', '', '', ' cellspacing="0" cellpadding="0" border="0"' ) . "\n";
         for ($i=1; $i <= count($index_order); $i++) {
             $tmp = $index_order[$i];
         for ($i=1; $i <= count($index_order); $i++) {
             $tmp = $index_order[$i];
-            echo '<tr>';
-            echo "<td><small><a href=\"options_order.php?method=up&amp;num=$i\">". _("up") ."</a></small></td>\n";
-            echo '<td><small>&nbsp;|&nbsp;</small></td>' . "\n";
-            echo "<td><small><a href=\"options_order.php?method=down&amp;num=$i\">". _("down") . "</a></small></td>\n";
-            echo '<td><small>&nbsp;|&nbsp;</small></td>' . "\n";
-            echo '<td>';
+            echo html_tag( 'tr' );
+            echo html_tag( 'td', '<small><a href="options_order.php?method=up&amp;num=' . $i . '">'. _("up") .'</a></small>' );
+            echo html_tag( 'td', '<small>&nbsp;|&nbsp;</small>' );
+            echo html_tag( 'td', '<small><a href="options_order.php?method=down&amp;num=' . $i . '">'. _("down") .'</a></small>' );
+            echo html_tag( 'td', '<small>&nbsp;|&nbsp;</small>' );
+            echo html_tag( 'td' );
             /* Always show the subject */
             if ($tmp != 4)
             /* Always show the subject */
             if ($tmp != 4)
-               echo "<small><a href=\"options_order.php?method=remove&amp;num=$i\">" . _("remove") . '</a></small>';
-            echo "</td>\n";
-            echo '<td><small>&nbsp;-&nbsp;</small></td>' . "\n";
-            echo '<td>' . $available[$tmp] . "</td>\n";
-            echo "</tr>\n";
+               echo '<small><a href="options_order.php?method=remove&amp;num=' . $i . '">' . _("remove") . '</a></small>';
+            else
+               echo '&nbsp;'; 
+            echo '</td>';
+            echo html_tag( 'td', '<small>&nbsp;-&nbsp;</small>' );
+            echo html_tag( 'td', $available[$tmp] );
+            echo '</tr>' . "\n";
         }
         }
-        echo "</table>\n";
+        echo '</table>' . "\n";
     }
     
     if (count($index_order) != count($available)) {
     }
     
     if (count($index_order) != count($available)) {
@@ -127,7 +133,7 @@ displayPageHeader($color, 'None');
         echo '</form>';
     }
  
         echo '</form>';
     }
  
-    echo '<p><a href="../src/options.php">' . _("Return to options page") . '</a></p><br>';
+    echo html_tag( 'p', '<a href="../src/options.php">' . _("Return to options page") . '</a></p><br>' );
 
 ?>
     </td></tr>
 
 ?>
     </td></tr>