221ca7bf |
1 | <?php |
2 | /** |
3 | ** options_highlight.php |
4 | ** |
5 | ** Copyright (c) 1999-2000 The SquirrelMail development team |
6 | ** Licensed under the GNU GPL. For full terms see the file COPYING. |
7 | ** |
8 | ** Displays message highlighting options |
9 | ** |
245a6892 |
10 | ** $Id$ |
221ca7bf |
11 | **/ |
12 | |
13 | session_start(); |
14 | |
221ca7bf |
15 | if (!isset($strings_php)) |
e1db998a |
16 | include('../functions/strings.php'); |
61423189 |
17 | if (!isset($config_php)) |
e1db998a |
18 | include('../config/config.php'); |
221ca7bf |
19 | if (!isset($page_header_php)) |
e1db998a |
20 | include('../functions/page_header.php'); |
221ca7bf |
21 | if (!isset($display_messages_php)) |
e1db998a |
22 | include('../functions/display_messages.php'); |
221ca7bf |
23 | if (!isset($imap_php)) |
e1db998a |
24 | include('../functions/imap.php'); |
221ca7bf |
25 | if (!isset($array_php)) |
e1db998a |
26 | include('../functions/array.php'); |
221ca7bf |
27 | if (!isset($i18n_php)) |
e1db998a |
28 | include('../functions/i18n.php'); |
221ca7bf |
29 | if (!isset($plugin_php)) |
e1db998a |
30 | include('../functions/plugin.php'); |
221ca7bf |
31 | |
32 | |
e1db998a |
33 | if (! isset($action)) { $action = ''; } |
34 | if ($action == 'delete' && isset($theid)) { |
221ca7bf |
35 | removePref($data_dir, $username, "highlight$theid"); |
e1db998a |
36 | } else if ($action == 'save') { |
221ca7bf |
37 | } |
e1db998a |
38 | include('../src/load_prefs.php'); |
39 | displayPageHeader($color, 'None'); |
221ca7bf |
40 | ?> |
41 | <br> |
42 | <table width=95% align=center border=0 cellpadding=2 cellspacing=0><tr><td bgcolor="<?php echo $color[0] ?>"> |
43 | <center><b><?php echo _("Options") . " - " . _("Index Order"); ?></b></center> |
44 | </td></tr></table> |
45 | |
46 | <table width=95% align=center border=0><tr><td> |
47 | <?php |
48 | |
0fba4d30 |
49 | $available[1] = _("Checkbox"); |
50 | $available[2] = _("From"); |
51 | $available[3] = _("Date"); |
52 | $available[4] = _("Subject"); |
53 | $available[5] = _("Flags"); |
54 | $available[6] = _("Size"); |
221ca7bf |
55 | |
e1db998a |
56 | if (! isset($method)) { $method = ''; } |
61423189 |
57 | |
e1db998a |
58 | if ($method == 'up' && $num > 1) { |
221ca7bf |
59 | $prev = $num-1; |
60 | $tmp = $index_order[$prev]; |
61 | $index_order[$prev] = $index_order[$num]; |
62 | $index_order[$num] = $tmp; |
e1db998a |
63 | } else if ($method == 'down' && $num < count($index_order)) { |
221ca7bf |
64 | $next = $num++; |
65 | $tmp = $index_order[$next]; |
66 | $index_order[$next] = $index_order[$num]; |
67 | $index_order[$num] = $tmp; |
e1db998a |
68 | } else if ($method == 'remove' && $num) { |
221ca7bf |
69 | for ($i=1; $i < 8; $i++) { |
70 | removePref($data_dir, $username, "order$i"); |
71 | } |
72 | for ($j=1,$i=1; $i <= count($index_order); $i++) { |
73 | if ($i != $num) { |
74 | $new_ary[$j] = $index_order[$i]; |
75 | $j++; |
76 | } |
77 | } |
78 | $index_order = array(); |
79 | $index_order = $new_ary; |
80 | if (count($index_order) < 1) { |
e1db998a |
81 | include ('../src/load_prefs.php'); |
221ca7bf |
82 | } |
e1db998a |
83 | } else if ($method == 'add' && $add) { |
221ca7bf |
84 | $index_order[count($index_order)+1] = $add; |
85 | } |
86 | |
87 | if ($method) { |
88 | for ($i=1; $i <= count($index_order); $i++) { |
89 | setPref($data_dir, $username, "order$i", $index_order[$i]); |
90 | } |
91 | } |
e1db998a |
92 | echo '<center>'; |
93 | echo '<table cellspacing="0" cellpadding="0" border="0" width="65%"><tr><td>' . "\n"; |
5c54e435 |
94 | echo _("The index order is the order that the columns are arranged in the message index. You can add, remove, and move columns around to customize them to fit your needs."); |
e1db998a |
95 | echo '</td></tr></table></center><br>'; |
221ca7bf |
96 | |
0fba4d30 |
97 | if (count($index_order)) |
98 | { |
e1db998a |
99 | echo '<center>'; |
100 | echo '<table cellspacing="0" cellpadding="0" border="0">' . "\n"; |
0fba4d30 |
101 | for ($i=1; $i <= count($index_order); $i++) { |
102 | $tmp = $index_order[$i]; |
e1db998a |
103 | echo '<tr>'; |
5c54e435 |
104 | echo "<td><small><a href=\"options_order.php?method=up&num=$i\">". _("up") ."</a></small></td>\n"; |
e1db998a |
105 | echo '<td><small> | </small></td>' . "\n"; |
5c54e435 |
106 | echo "<td><small><a href=\"options_order.php?method=down&num=$i\">". _("down") . "</a></small></td>\n"; |
e1db998a |
107 | echo '<td><small> | </small></td>' . "\n"; |
108 | echo '<td>'; |
0fba4d30 |
109 | // Always show the subject |
110 | if ($tmp != 4) |
e1db998a |
111 | echo "<small><a href=\"options_order.php?method=remove&num=$i\">" . _("remove") . '</a></small>'; |
0fba4d30 |
112 | echo "</td>\n"; |
e1db998a |
113 | echo '<td><small> - </small></td>' . "\n"; |
114 | echo '<td>' . $available[$tmp] . "</td>\n"; |
0fba4d30 |
115 | echo "</tr>\n"; |
116 | } |
117 | echo "</table>\n"; |
e1db998a |
118 | echo '</center>'; |
221ca7bf |
119 | } |
120 | |
121 | if (count($index_order) != count($available)) { |
e1db998a |
122 | echo '<center><form name="f" method="post" action="options_order.php">'; |
123 | echo '<select name="add">'; |
221ca7bf |
124 | for ($i=1; $i <= count($available); $i++) { |
125 | $found = false; |
126 | for ($j=1; $j <= count($index_order); $j++) { |
127 | if ($index_order[$j] == $i) { |
128 | $found = true; |
129 | } |
130 | } |
131 | if (!$found) { |
e1db998a |
132 | echo "<option value=\"$i\">$available[$i]</option>"; |
221ca7bf |
133 | } |
134 | } |
e1db998a |
135 | echo '</select>'; |
136 | echo '<input type="hidden" value="add" name="method">'; |
137 | echo '<input type="submit" value="'._("Add").'" name="submit">'; |
138 | echo '</form></center>'; |
221ca7bf |
139 | } |
140 | |
e1db998a |
141 | echo '<br><center><a href="../src/options.php">' . _("Return to options page") . '</a></center>'; |
5c54e435 |
142 | |
221ca7bf |
143 | ?> |
144 | </td></tr></table> |
145 | </body></html> |