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
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");
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");
26 if (!isset($i18n_php))
27 include("../functions/i18n.php");
28 if (!isset($plugin_php))
29 include("../functions/plugin.php");
32 if ($action == "delete" && isset($theid)) {
33 removePref($data_dir, $username, "highlight$theid");
34 } else if ($action == "save") {
36 include("../src/load_prefs.php");
37 displayPageHeader($color, "None");
40 <table width
=95% align
=center border
=0 cellpadding
=2 cellspacing
=0><tr
><td bgcolor
="<?php echo $color[0] ?>">
41 <center
><b
><?php
echo _("Options") . " - " . _("Index Order"); ?
></b
></center
>
44 <table width
=95% align
=center border
=0><tr
><td
>
47 $available[1] = _("Checkbox");
48 $available[2] = _("From");
49 $available[3] = _("Date");
50 $available[4] = _("Subject");
51 $available[5] = _("Flags");
52 $available[6] = _("Size");
54 if ($method == "up" && $num > 1) {
56 $tmp = $index_order[$prev];
57 $index_order[$prev] = $index_order[$num];
58 $index_order[$num] = $tmp;
59 } else if ($method == "down" && $num < count($index_order)) {
61 $tmp = $index_order[$next];
62 $index_order[$next] = $index_order[$num];
63 $index_order[$num] = $tmp;
64 } else if ($method == "remove" && $num) {
65 for ($i=1; $i < 8; $i++
) {
66 removePref($data_dir, $username, "order$i");
68 for ($j=1,$i=1; $i <= count($index_order); $i++
) {
70 $new_ary[$j] = $index_order[$i];
74 $index_order = array();
75 $index_order = $new_ary;
76 if (count($index_order) < 1) {
77 include "../src/load_prefs.php";
79 } else if ($method == "add" && $add) {
80 $index_order[count($index_order)+
1] = $add;
84 for ($i=1; $i <= count($index_order); $i++
) {
85 setPref($data_dir, $username, "order$i", $index_order[$i]);
89 echo "<table cellspacing=0 cellpadding=0 border=0 width=65%><tr><td>\n";
90 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.");
91 echo "</td></tr></table></center><br>";
93 if (count($index_order))
96 echo "<table cellspacing=0 cellpadding=0 border=0>\n";
97 for ($i=1; $i <= count($index_order); $i++
) {
98 $tmp = $index_order[$i];
100 echo "<td><small><a href=\"options_order.php?method=up&num=$i\">". _("up") ."</a></small></td>\n";
101 echo "<td><small> | </small></td>\n";
102 echo "<td><small><a href=\"options_order.php?method=down&num=$i\">". _("down") . "</a></small></td>\n";
103 echo "<td><small> | </small></td>\n";
105 // Always show the subject
107 echo "<small><a href=\"options_order.php?method=remove&num=$i\">" . _("remove") . "</a></small>";
109 echo "<td><small> - </small></td>\n";
110 echo "<td>" . $available[$tmp] . "</td>\n";
117 if (count($index_order) != count($available)) {
118 echo "<center><form name=f method=post action=options_order.php>";
119 echo "<select name=add>";
120 for ($i=1; $i <= count($available); $i++
) {
122 for ($j=1; $j <= count($index_order); $j++
) {
123 if ($index_order[$j] == $i) {
128 echo "<option value=$i>$available[$i]</option>";
132 echo "<input type=hidden value=add name=method>";
133 echo "<input type=submit value=\""._("Add")."\" name=submit>";
134 echo "</form></center>";
137 echo "<br><center><a href=\"../src/options.php\">" . _("Return to options page") . "</a></center>";