Fix & in URLs to & for correctness of HTML, also 100% to "100%" in
[squirrelmail.git] / src / options_highlight.php
index e50a54fedc00bf6d5ebeb2a79669cadc7d5255f8..bade16cbd43665ec831639891a8339777ec54a87 100644 (file)
@@ -16,11 +16,12 @@ require_once('../functions/display_messages.php');
 require_once('../functions/imap.php');
 require_once('../functions/array.php');
 require_once('../functions/plugin.php');
+require_once('../functions/strings.php');
 
 function oh_opt( $val, $sel, $tit ) {
     echo "<option value=\"$val\"";
     if ( $sel )
-        echo 'selected';
+        echo ' selected';
     echo  ">$tit</option>\n";
 }
 
@@ -37,16 +38,16 @@ if ($action == 'delete' && isset($theid)) {
     exit;
 } else if ($action == 'save') {
     if (!$theid) $theid = 0;
-    $identname = ereg_replace(',', ' ', $identname);
+    $identname = str_replace(',', ' ', $identname);
     if ($color_type == 1) $newcolor = $newcolor_choose;
     elseif ($color_type == 2) $newcolor = $newcolor_input;
     else $newcolor = $color_type;
 
-    $newcolor = ereg_replace(',', '', $newcolor);
-    $newcolor = ereg_replace('#', '', $newcolor);
-    $newcolor = ereg_replace('"', '', $newcolor);
-    $newcolor = ereg_replace('\'', '', $newcolor);
-    $value = ereg_replace(',', ' ', $value);
+    $newcolor = str_replace(',', '', $newcolor);
+    $newcolor = str_replace('#', '', $newcolor);
+    $newcolor = str_replace('"', '', $newcolor);
+    $newcolor = str_replace('\'', '', $newcolor);
+    $value = str_replace(',', ' ', $value);
 
     setPref($data_dir, $username, "highlight$theid", $identname.','.$newcolor.','.$value.','.$match_type);
     $message_highlight_list[$theid]['name'] = $identname;
@@ -68,7 +69,7 @@ if (count($message_highlight_list) >= 1) {
     echo '<table border="0" cellpadding="3" cellspacing="0" align="center" width="80%">'."\n";
     for ($i=0; $i < count($message_highlight_list); $i++) {
         echo '<tr bgcolor="' . $message_highlight_list[$i]['color'] . '">'.
-                "<td width=20% bgcolor=\"$color[4]\" nobr>".
+                "<td width=\"20%\" bgcolor=\"$color[4]\" nowrap>".
                 "<small>[<a href=\"options_highlight.php?action=edit&theid=$i\">".
             _("Edit") .
             '</a>]&nbsp;[<a href="options_highlight.php?action=delete&theid='.
@@ -254,7 +255,7 @@ if ($action == 'edit' || $action == 'add') {
     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\" nobr><b>\n";
+    echo "      <td align=\"right\" nowrap><b>\n";
     echo _("Identifying name") . ":";
     echo '      </b></td>' . "\n";
     echo '      <td>' . "\n";
@@ -295,7 +296,7 @@ if ($action == 'edit' || $action == 'add') {
     echo "   </tr>\n";
 
     # Show grid of color choices
-    echo "<tr bgcolor=$color[0]><td colspan='2'>\n";
+    echo "<tr bgcolor=\"$color[0]\"><td colspan='2'>\n";
     echo "<table border=0 cellpadding=\"2\" align=\"center\" cellspacing=\"1\">\n";
     $current_color = $message_highlight_list[$theid]['color'];
     for($x = 0; $x < 5; $x++) {
@@ -303,14 +304,14 @@ if ($action == 'edit' || $action == 'add') {
         for($y = 0; $y < 19; $y++) {
         $gridindex = "$y,$x";
         $gridcolor = $new_color_list[$gridindex];
-        $selected = ($gridcolor == $current_color)?'SELECTED':'' ;
-        echo "<td bgcolor=#$gridcolor><input type='radio' name=color_type value='#$gridcolor' $selected>\n";
+        $selected = ($gridcolor == $current_color)?'CHECKED':'' ;
+        echo "<td bgcolor=\"#$gridcolor\"><input type='radio' name=color_type value='#$gridcolor' $selected>\n";
         echo "</td>\n";
         }
         echo "</tr>\n";
     }
     echo "</table>\n";
-    echo "</tr></td>\n";
+    echo "</td></tr>\n";
 
     echo '   <tr><td><small><small>&nbsp;</small></small></td></tr>' . "\n";
     echo "   <tr bgcolor=\"$color[0]\">\n";