Changed mailbox display so that flags would be aligned center.
[squirrelmail.git] / src / options_highlight.php
index c007c668cfc229e30c2c8ec6aba6b1f897703551..490d24b2d7f9dd31cca39059adff28a656dd9254 100644 (file)
@@ -25,6 +25,8 @@
       include("../functions/array.php");
    if (!isset($i18n_php))
       include("../functions/i18n.php");
+   if (!isset($plugin_php))
+      include("../functions/plugin.php");
 
 
    if ($action == "delete" && isset($theid)) {
@@ -32,6 +34,9 @@
    } else if ($action == "save") {
       if (!$theid) $theid = 0;
       $identname = ereg_replace(",", " ", $identname);
+      $identname = str_replace("\\\\", "\\", $identname);
+      $identname = str_replace("\\\"", "\"", $identname);
+      $identname = str_replace("\"", """, $identname);
       if ($color_type == 1) $newcolor = $newcolor_choose;
       else $newcolor = $newcolor_input;
  
       $newcolor = ereg_replace("#", "", $newcolor);
       $newcolor = "$newcolor";
       $value = ereg_replace(",", " ", $value);
+      $value = str_replace("\\\\", "\\", $value);
+      $value = str_replace("\\\"", "\"", $value);
+      $value = str_replace("\"", """, $value);
+
       setPref($data_dir, $username, "highlight$theid", $identname.",".$newcolor.",".$value.",".$match_type);
       $message_highlight_list[$theid]["name"] = $identname;
       $message_highlight_list[$theid]["color"] = $newcolor;
       else if (!$selected_choose)
          $selected_input = " checked";
  
-      echo "<form action=\"options_highlight.php\">\n";
+      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 _("Identifying name") . ":";
       echo "      </b></td>\n";
       echo "      <td width=75%>\n";
-      echo "         <input type=\"text\" value=\"".$message_highlight_list[$theid]["name"]."\" name=\"identname\">";
+      $disp = $message_highlight_list[$theid]["name"];
+      $disp = str_replace("\\\\", "\\", $disp);
+      $disp = str_replace("\\\"", "\"", $disp);
+      $disp = str_replace("\"", "&quot;", $disp);
+      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";
       if ($message_highlight_list[$theid]["match_type"] == "subject") echo "            <option value=\"subject\" selected>Subject\n";
       else                                                         echo "            <option value=\"subject\">Subject\n";
       echo "         </select>\n";
-      echo "         <nobr><input type=\"text\" value=\"".$message_highlight_list[$theid]["value"]."\" name=\"value\"> &nbsp;(";
-      echo _("Regular Expression");
-      echo ")\n      <nobr></td>\n";
+      $disp = $message_highlight_list[$theid]["value"];
+      $disp = str_replace("\\\\", "\\", $disp);
+      $disp = str_replace("\\\"", "\"", $disp);
+      $disp = str_replace("\"", "&quot;", $disp);
+      echo "         <nobr><input type=\"text\" value=\"".$disp."\" name=\"value\">";
+      echo "        <nobr></td>\n";
       echo "   </tr>\n";
       echo "</table>\n";
       echo "<center><input type=\"submit\" value=\"" . _("Submit") . "\"></center>\n";
       echo "</form>\n";
+      do_hook("options_highlight_bottom");
    } 
 ?>
 </body></html>