X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_highlight.php;h=490d24b2d7f9dd31cca39059adff28a656dd9254;hb=ab43754446081c5cf7e512f060b188d224eab064;hp=09ce14663200af871ce431a872862716edd5681e;hpb=c36ed9cfc1635cd9a8f80d9cdf8200628777903f;p=squirrelmail.git diff --git a/src/options_highlight.php b/src/options_highlight.php index 09ce1466..490d24b2 100644 --- a/src/options_highlight.php +++ b/src/options_highlight.php @@ -25,13 +25,18 @@ include("../functions/array.php"); if (!isset($i18n_php)) include("../functions/i18n.php"); + if (!isset($plugin_php)) + include("../functions/plugin.php"); - if ($action == "delete" && isset($id)) { - removePref($data_dir, $username, "highlight$id"); + if ($action == "delete" && isset($theid)) { + removePref($data_dir, $username, "highlight$theid"); } else if ($action == "save") { - if (!$id) $id = 0; - $name = ereg_replace(",", " ", $name); + 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; @@ -39,20 +44,25 @@ $newcolor = ereg_replace("#", "", $newcolor); $newcolor = "$newcolor"; $value = ereg_replace(",", " ", $value); - setPref($data_dir, $username, "highlight$id", $name.",".$newcolor.",".$value.",".$match_type); - $message_highlight_list[$id]["name"] = $name; - $message_highlight_list[$id]["color"] = $newcolor; - $message_highlight_list[$id]["value"] = $value; - $message_highlight_list[$id]["match_type"] = $match_type; + $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; + $message_highlight_list[$theid]["value"] = $value; + $message_highlight_list[$theid]["match_type"] = $match_type; } include("../src/load_prefs.php"); displayPageHeader($color, "None"); ?> -
- +
\n"; if (count($message_highlight_list) >= 1) { @@ -60,7 +70,7 @@ for ($i=0; $i < count($message_highlight_list); $i++) { echo " | |
\n";
- echo " | ";
echo " \n";
echo " " . $message_highlight_list[$i]["name"];
@@ -77,7 +87,7 @@
echo " \n"; } if ($action == "edit" || $action == "add") { - if (!isset($id)) $id = count($message_highlight_list); + if (!isset($theid)) $theid = count($message_highlight_list); $color_list[0] = "4444aa"; $color_list[1] = "44aa44"; @@ -94,34 +104,38 @@ $color_list[12] = "dfdfdf"; $color_list[13] = "ffffff"; for ($i=0; $i < 14; $i++) { - if ($color_list[$i] == $message_highlight_list[$id]["color"]) { + if ($color_list[$i] == $message_highlight_list[$theid]["color"]) { $selected_choose = " checked"; ${"selected".$i} = " selected"; continue; } } - if (!$message_highlight_list[$id]["color"]) + if (!$message_highlight_list[$theid]["color"]) $selected_choose = " checked"; else if (!$selected_choose) $selected_input = " checked"; - echo " |