3 ** options_highlight.php
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 ** Displays message highlighting options
15 if (!isset($strings_php))
16 include("../functions/strings.php");
17 if (!isset($config_php))
18 include("../config/config.php");
19 if (!isset($page_header_php))
20 include("../functions/page_header.php");
21 if (!isset($display_messages_php))
22 include("../functions/display_messages.php");
23 if (!isset($imap_php))
24 include("../functions/imap.php");
25 if (!isset($array_php))
26 include("../functions/array.php");
27 if (!isset($i18n_php))
28 include("../functions/i18n.php");
29 if (!isset($plugin_php))
30 include("../functions/plugin.php");
33 if (! isset($action)) { $action = ""; }
34 if ($action == "delete" && isset($theid)) {
35 removePref($data_dir, $username, "highlight$theid");
36 } else if ($action == "save") {
38 include("../src/load_prefs.php");
39 displayPageHeader($color, "None");
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
>
46 <table width
=95% align
=center border
=0><tr
><td
>
49 $available[1] = _("Checkbox");
50 $available[2] = _("From");
51 $available[3] = _("Date");
52 $available[4] = _("Subject");
53 $available[5] = _("Flags");
54 $available[6] = _("Size");
56 if (! isset($method)) { $method = ""; }
58 if ($method == "up" && $num > 1) {
60 $tmp = $index_order[$prev];
61 $index_order[$prev] = $index_order[$num];
62 $index_order[$num] = $tmp;
63 } else if ($method == "down" && $num < count($index_order)) {
65 $tmp = $index_order[$next];
66 $index_order[$next] = $index_order[$num];
67 $index_order[$num] = $tmp;
68 } else if ($method == "remove" && $num) {
69 for ($i=1; $i < 8; $i++
) {
70 removePref($data_dir, $username, "order$i");
72 for ($j=1,$i=1; $i <= count($index_order); $i++
) {
74 $new_ary[$j] = $index_order[$i];
78 $index_order = array();
79 $index_order = $new_ary;
80 if (count($index_order) < 1) {
81 include "../src/load_prefs.php";
83 } else if ($method == "add" && $add) {
84 $index_order[count($index_order)+
1] = $add;
88 for ($i=1; $i <= count($index_order); $i++
) {
89 setPref($data_dir, $username, "order$i", $index_order[$i]);
93 echo "<table cellspacing=0 cellpadding=0 border=0 width=65%><tr><td>\n";
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.");
95 echo "</td></tr></table></center><br>";
97 if (count($index_order))
100 echo "<table cellspacing=0 cellpadding=0 border=0>\n";
101 for ($i=1; $i <= count($index_order); $i++
) {
102 $tmp = $index_order[$i];
104 echo "<td><small><a href=\"options_order.php?method=up&num=$i\">". _("up") ."</a></small></td>\n";
105 echo "<td><small> | </small></td>\n";
106 echo "<td><small><a href=\"options_order.php?method=down&num=$i\">". _("down") . "</a></small></td>\n";
107 echo "<td><small> | </small></td>\n";
109 // Always show the subject
111 echo "<small><a href=\"options_order.php?method=remove&num=$i\">" . _("remove") . "</a></small>";
113 echo "<td><small> - </small></td>\n";
114 echo "<td>" . $available[$tmp] . "</td>\n";
121 if (count($index_order) != count($available)) {
122 echo "<center><form name=f method=post action=options_order.php>";
123 echo "<select name=add>";
124 for ($i=1; $i <= count($available); $i++
) {
126 for ($j=1; $j <= count($index_order); $j++
) {
127 if ($index_order[$j] == $i) {
132 echo "<option value=$i>$available[$i]</option>";
136 echo "<input type=hidden value=add name=method>";
137 echo "<input type=submit value=\""._("Add")."\" name=submit>";
138 echo "</form></center>";
141 echo "<br><center><a href=\"../src/options.php\">" . _("Return to options page") . "</a></center>";