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($config_php))
16 include("../config/config.php");
17 if (!isset($strings_php))
18 include("../functions/strings.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 ($action == "delete" && isset($theid)) {
34 removePref($data_dir, $username, "highlight$theid");
35 } else if ($action == "save") {
37 include("../src/load_prefs.php");
38 displayPageHeader($color, "None");
41 <table width
=95% align
=center border
=0 cellpadding
=2 cellspacing
=0><tr
><td bgcolor
="<?php echo $color[0] ?>">
42 <center
><b
><?php
echo _("Options") . " - " . _("Index Order"); ?
></b
></center
>
45 <table width
=95% align
=center border
=0><tr
><td
>
48 $available[1] = _("Checkbox");
49 $available[2] = _("From");
50 $available[3] = _("Date");
51 $available[4] = _("Subject");
52 $available[5] = _("Flags");
53 $available[6] = _("Size");
55 if ($method == "up" && $num > 1) {
57 $tmp = $index_order[$prev];
58 $index_order[$prev] = $index_order[$num];
59 $index_order[$num] = $tmp;
60 } else if ($method == "down" && $num < count($index_order)) {
62 $tmp = $index_order[$next];
63 $index_order[$next] = $index_order[$num];
64 $index_order[$num] = $tmp;
65 } else if ($method == "remove" && $num) {
66 for ($i=1; $i < 8; $i++
) {
67 removePref($data_dir, $username, "order$i");
69 for ($j=1,$i=1; $i <= count($index_order); $i++
) {
71 $new_ary[$j] = $index_order[$i];
75 $index_order = array();
76 $index_order = $new_ary;
77 if (count($index_order) < 1) {
78 include "../src/load_prefs.php";
80 } else if ($method == "add" && $add) {
81 $index_order[count($index_order)+
1] = $add;
85 for ($i=1; $i <= count($index_order); $i++
) {
86 setPref($data_dir, $username, "order$i", $index_order[$i]);
90 echo "<table cellspacing=0 cellpadding=0 border=0 width=65%><tr><td>\n";
91 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.");
92 echo "</td></tr></table></center><br>";
94 if (count($index_order))
97 echo "<table cellspacing=0 cellpadding=0 border=0>\n";
98 for ($i=1; $i <= count($index_order); $i++
) {
99 $tmp = $index_order[$i];
101 echo "<td><small><a href=\"options_order.php?method=up&num=$i\">". _("up") ."</a></small></td>\n";
102 echo "<td><small> | </small></td>\n";
103 echo "<td><small><a href=\"options_order.php?method=down&num=$i\">". _("down") . "</a></small></td>\n";
104 echo "<td><small> | </small></td>\n";
106 // Always show the subject
108 echo "<small><a href=\"options_order.php?method=remove&num=$i\">" . _("remove") . "</a></small>";
110 echo "<td><small> - </small></td>\n";
111 echo "<td>" . $available[$tmp] . "</td>\n";
118 if (count($index_order) != count($available)) {
119 echo "<center><form name=f method=post action=options_order.php>";
120 echo "<select name=add>";
121 for ($i=1; $i <= count($available); $i++
) {
123 for ($j=1; $j <= count($index_order); $j++
) {
124 if ($index_order[$j] == $i) {
129 echo "<option value=$i>$available[$i]</option>";
133 echo "<input type=hidden value=add name=method>";
134 echo "<input type=submit value=\""._("Add")."\" name=submit>";
135 echo "</form></center>";
138 echo "<br><center><a href=\"../src/options.php\">" . _("Return to options page") . "</a></center>";