added css theme stuff to signout.php
[squirrelmail.git] / src / options_highlight.php
CommitLineData
9d157cec 1<?php
ef870322 2 /**
c36ed9cf 3 ** options_highlight.php
ef870322 4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
c36ed9cf 8 ** Displays message highlighting options
9 **
ef870322 10 **/
11
9d157cec 12 session_start();
13
14 if (!isset($config_php))
15 include("../config/config.php");
16 if (!isset($strings_php))
17 include("../functions/strings.php");
18 if (!isset($page_header_php))
19 include("../functions/page_header.php");
c36ed9cf 20 if (!isset($display_messages_php))
21 include("../functions/display_messages.php");
22 if (!isset($imap_php))
23 include("../functions/imap.php");
24 if (!isset($array_php))
25 include("../functions/array.php");
9d157cec 26 if (!isset($i18n_php))
27 include("../functions/i18n.php");
9d157cec 28
9d157cec 29
e4bf514f 30 if ($action == "delete" && isset($theid)) {
31 removePref($data_dir, $username, "highlight$theid");
44f642f5 32 } else if ($action == "save") {
e4bf514f 33 if (!$theid) $theid = 0;
34 $identname = ereg_replace(",", " ", $identname);
44f642f5 35 if ($color_type == 1) $newcolor = $newcolor_choose;
36 else $newcolor = $newcolor_input;
c36ed9cf 37
44f642f5 38 $newcolor = ereg_replace(",", "", $newcolor);
39 $newcolor = ereg_replace("#", "", $newcolor);
40 $newcolor = "$newcolor";
41 $value = ereg_replace(",", " ", $value);
e4bf514f 42 setPref($data_dir, $username, "highlight$theid", $identname.",".$newcolor.",".$value.",".$match_type);
43 $message_highlight_list[$theid]["name"] = $identname;
44 $message_highlight_list[$theid]["color"] = $newcolor;
45 $message_highlight_list[$theid]["value"] = $value;
46 $message_highlight_list[$theid]["match_type"] = $match_type;
c36ed9cf 47 }
44f642f5 48 include("../src/load_prefs.php");
49 displayPageHeader($color, "None");
c36ed9cf 50?>
e9f8ea4e 51 <br>
6170c5b6 52 <table width=95% align=center border=0 cellpadding=2 cellspacing=0><tr><td bgcolor="<?php echo $color[0] ?>">
53 <center><b><?php echo _("Options") . " - " . _("Message Highlighting"); ?></b></center>
c36ed9cf 54 </td></tr></table>
55
8442ac08 56<?php
c36ed9cf 57 echo "<br><center>[<a href=\"options_highlight.php?action=add\">" . _("New") . "</a>]";
58 echo " - [<a href=\"options.php\">"._("Done")."</a>]</center><br>\n";
44f642f5 59 if (count($message_highlight_list) >= 1) {
60 echo "<table border=0 cellpadding=3 cellspacing=0 align=center width=80%>\n";
61 for ($i=0; $i < count($message_highlight_list); $i++) {
62 echo "<tr>\n";
63 echo " <td width=1% bgcolor=" . $color[4] . ">\n";
e4bf514f 64 echo "<nobr><small>[<a href=\"options_highlight.php?action=edit&theid=$i\">" . _("Edit") . "</a>]&nbsp;[<a href=\"options_highlight.php?action=delete&theid=$i\">"._("Delete")."</a>]</small></nobr>\n";
44f642f5 65 echo " </td>";
66 echo " <td bgcolor=" . $message_highlight_list[$i]["color"] . ">\n";
67 echo " " . $message_highlight_list[$i]["name"];
68 echo " </td>\n";
69 echo " <td bgcolor=" . $message_highlight_list[$i]["color"] . ">\n";
3e69e88b 70 echo " ".$message_highlight_list[$i]["match_type"]." = " . $message_highlight_list[$i]["value"];
44f642f5 71 echo " </td>\n";
72 echo "</tr>\n";
73 }
74 echo "</table>\n";
75 echo "<br>\n";
9d157cec 76 } else {
44f642f5 77 echo "<center>" . _("No highlighting is defined") . "</center><br>\n";
78 echo "<br>\n";
79 }
80 if ($action == "edit" || $action == "add") {
e4bf514f 81 if (!isset($theid)) $theid = count($message_highlight_list);
c36ed9cf 82
44f642f5 83 $color_list[0] = "4444aa";
84 $color_list[1] = "44aa44";
85 $color_list[2] = "aaaa44";
86 $color_list[3] = "44aaaa";
87 $color_list[4] = "aa44aa";
88 $color_list[5] = "aaaaff";
89 $color_list[6] = "aaffaa";
90 $color_list[7] = "ffffaa";
91 $color_list[8] = "aaffff";
92 $color_list[9] = "ffaaff";
93 $color_list[10] = "aaaaaa";
94 $color_list[11] = "bfbfbf";
95 $color_list[12] = "dfdfdf";
c36ed9cf 96 $color_list[13] = "ffffff";
44f642f5 97 for ($i=0; $i < 14; $i++) {
e4bf514f 98 if ($color_list[$i] == $message_highlight_list[$theid]["color"]) {
44f642f5 99 $selected_choose = " checked";
100 ${"selected".$i} = " selected";
101 continue;
102 }
103 }
e4bf514f 104 if (!$message_highlight_list[$theid]["color"])
3e69e88b 105 $selected_choose = " checked";
c36ed9cf 106 else if (!$selected_choose)
44f642f5 107 $selected_input = " checked";
c36ed9cf 108
109 echo "<form action=\"options_highlight.php\">\n";
9d157cec 110 echo "<input type=\"hidden\" value=\"save\" name=\"action\">\n";
e4bf514f 111 echo "<input type=\"hidden\" value=\"$theid\" name=\"theid\">\n";
e9f8ea4e 112 echo "<table width=80% align=center cellpadding=3 cellspacing=0 border=0>\n";
113 echo " <tr bgcolor=\"$color[0]\">\n";
114 echo " <td align=right width=25%><b>\n";
9d157cec 115 echo _("Identifying name") . ":";
e9f8ea4e 116 echo " </b></td>\n";
429f8906 117 echo " <td width=75%>\n";
e4bf514f 118 echo " <input type=\"text\" value=\"".$message_highlight_list[$theid]["name"]."\" name=\"identname\">";
9d157cec 119 echo " </td>\n";
120 echo " </tr>\n";
e9f8ea4e 121 echo " <tr><td><small><small>&nbsp;</small></small></td></tr>\n";
122 echo " <tr bgcolor=\"$color[0]\">\n";
123 echo " <td align=right width=25%><b>\n";
9d157cec 124 echo _("Color") . ":";
e9f8ea4e 125 echo " </b></td>\n";
429f8906 126 echo " <td width=75%>\n";
44f642f5 127 echo " <input type=\"radio\" name=color_type value=1$selected_choose> &nbsp;<select name=newcolor_choose>\n";
128 echo " <option value=\"$color_list[0]\"$selected0>" . _("Dark Blue") . "\n";
129 echo " <option value=\"$color_list[1]\"$selected1>" . _("Dark Green") . "\n";
130 echo " <option value=\"$color_list[2]\"$selected2>" . _("Dark Yellow") . "\n";
131 echo " <option value=\"$color_list[3]\"$selected3>" . _("Dark Cyan") . "\n";
132 echo " <option value=\"$color_list[4]\"$selected4>" . _("Dark Magenta") . "\n";
133 echo " <option value=\"$color_list[5]\"$selected5>" . _("Light Blue") . "\n";
134 echo " <option value=\"$color_list[6]\"$selected6>" . _("Light Green") . "\n";
135 echo " <option value=\"$color_list[7]\"$selected7>" . _("Light Yellow") . "\n";
136 echo " <option value=\"$color_list[8]\"$selected8>" . _("Light Cyan") . "\n";
137 echo " <option value=\"$color_list[9]\"$selected9>" . _("Light Magenta") . "\n";
138 echo " <option value=\"$color_list[10]\"$selected10>" . _("Dark Gray") . "\n";
139 echo " <option value=\"$color_list[11]\"$selected11>" . _("Medium Gray") . "\n";
140 echo " <option value=\"$color_list[12]\"$selected12>" . _("Light Gray") . "\n";
141 echo " <option value=\"$color_list[13]\"$selected13>" . _("White") . "\n";
142 echo " </select><br>\n";
c36ed9cf 143 echo " <input type=\"radio\" name=color_type value=2$selected_input> &nbsp;". _("Other:") ."<input type=\"text\" value=\"";
e4bf514f 144 if ($selected_input) echo $message_highlight_list[$theid]["color"];
44f642f5 145 echo "\" name=\"newcolor_input\" size=7> "._("Ex: 63aa7f")."<br>\n";
9d157cec 146 echo " </td>\n";
147 echo " </tr>\n";
e9f8ea4e 148 echo " <tr><td><small><small>&nbsp;</small></small></td></tr>\n";
149 echo " <tr bgcolor=\"$color[0]\">\n";
150 echo " <td align=right width=25%><b>\n";
9d157cec 151 echo _("Match") . ":";
e9f8ea4e 152 echo " </b></td>\n";
429f8906 153 echo " <td width=75%>\n";
3e69e88b 154 echo " <select name=match_type>\n";
e4bf514f 155 if ($message_highlight_list[$theid]["match_type"] == "from") echo " <option value=\"from\" selected>From\n";
c36ed9cf 156 else echo " <option value=\"from\">From\n";
e4bf514f 157 if ($message_highlight_list[$theid]["match_type"] == "to") echo " <option value=\"to\" selected>To\n";
c36ed9cf 158 else echo " <option value=\"to\">To\n";
e4bf514f 159 if ($message_highlight_list[$theid]["match_type"] == "cc") echo " <option value=\"cc\" selected>Cc\n";
1195c340 160 else echo " <option value=\"cc\">Cc\n";
e4bf514f 161 if ($message_highlight_list[$theid]["match_type"] == "to_cc") echo " <option value=\"to_cc\" selected>To or Cc\n";
1195c340 162 else echo " <option value=\"to_cc\">To or Cc\n";
e4bf514f 163 if ($message_highlight_list[$theid]["match_type"] == "subject") echo " <option value=\"subject\" selected>Subject\n";
c36ed9cf 164 else echo " <option value=\"subject\">Subject\n";
3e69e88b 165 echo " </select>\n";
e90872be 166 echo " <nobr><input type=\"text\" value=\"".$message_highlight_list[$theid]["value"]."\" name=\"value\">";
167 echo " <nobr></td>\n";
9d157cec 168 echo " </tr>\n";
169 echo "</table>\n";
170 echo "<center><input type=\"submit\" value=\"" . _("Submit") . "\"></center>\n";
171 echo "</form>\n";
c36ed9cf 172 }
9d157cec 173?>
c36ed9cf 174</body></html>