X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Foptions_highlight.php;h=44335ba9493560d81939f630dc878b3e3a732a78;hb=063a10aabe8f7d0adf99d4bda61c4bec6dc84bff;hp=491dbe992ef3132fc066881f83c6c50208c3fdc1;hpb=e9f8ea4ecb40efdb6f19631f8359ebd1fbf588be;p=squirrelmail.git
diff --git a/src/options_highlight.php b/src/options_highlight.php
index 491dbe99..44335ba9 100644
--- a/src/options_highlight.php
+++ b/src/options_highlight.php
@@ -7,14 +7,15 @@
**
** Displays message highlighting options
**
+ ** $Id$
**/
session_start();
- if (!isset($config_php))
- include("../config/config.php");
if (!isset($strings_php))
include("../functions/strings.php");
+ if (!isset($config_php))
+ include("../config/config.php");
if (!isset($page_header_php))
include("../functions/page_header.php");
if (!isset($display_messages_php))
@@ -25,13 +26,22 @@
include("../functions/array.php");
if (!isset($i18n_php))
include("../functions/i18n.php");
+ if (!isset($plugin_php))
+ include("../functions/plugin.php");
+ if (! isset($action))
+ $action = '';
+ if (! isset($message_highlight_list))
+ $message_highlight_list = array();
- 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,21 +49,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) { @@ -61,7 +75,7 @@ for ($i=0; $i < count($message_highlight_list); $i++) { echo " | |
\n";
- echo " | ";
echo " \n";
echo " " . $message_highlight_list[$i]["name"];
@@ -78,7 +92,8 @@
echo " \n"; } if ($action == "edit" || $action == "add") { - if (!isset($id)) $id = count($message_highlight_list); + if (!isset($theid)) $theid = count($message_highlight_list); + $message_highlight_list[$theid] = array(); $color_list[0] = "4444aa"; $color_list[1] = "44aa44"; @@ -94,28 +109,43 @@ $color_list[11] = "bfbfbf"; $color_list[12] = "dfdfdf"; $color_list[13] = "ffffff"; + + $selected_input = ""; + for ($i=0; $i < 14; $i++) { - if ($color_list[$i] == $message_highlight_list[$id]["color"]) { - $selected_choose = " checked"; - ${"selected".$i} = " selected"; - continue; - } + ${"selected".$i} = ""; + } + if (isset($message_highlight_list[$theid]["color"])) { + for ($i=0; $i < 14; $i++) { + if ($color_list[$i] == $message_highlight_list[$theid]["color"]) { + $selected_choose = " checked"; + ${"selected".$i} = " selected"; + continue; + } + } } - if (!$message_highlight_list[$id]["color"]) + if (!isset($message_highlight_list[$theid]["color"])) $selected_choose = " checked"; - else if (!$selected_choose) + else if (!isset($selected_choose)) $selected_input = " checked"; - echo "\n"; + do_hook("options_highlight_bottom"); } ?> |