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
13 include('../src/validate.php');
14 include('../functions/display_messages.php');
15 include('../functions/imap.php');
16 include('../functions/array.php');
17 include('../functions/plugin.php');
20 if (! isset($action)) { $action = ''; }
21 if ($action == 'delete' && isset($theid)) {
22 removePref($data_dir, $username, "highlight$theid");
23 } else if ($action == 'save') {
25 displayPageHeader($color, 'None');
28 <table width
=95% align
=center border
=0 cellpadding
=2 cellspacing
=0>
29 <tr
><td align
="center" bgcolor
="<?php echo $color[0] ?>">
31 <b
><?php
echo _("Options") . " - " . _("Index Order"); ?
></b
>
33 <table width
="100%" border
="0" cellpadding
="1" cellspacing
="1">
34 <tr
><td bgcolor
="<?php echo $color[4] ?>" align
="center"><br
>
36 <table width
=100% cellpadding
=2 cellspacing
=0 border
=0>
39 $available[1] = _("Checkbox");
40 $available[2] = _("From");
41 $available[3] = _("Date");
42 $available[4] = _("Subject");
43 $available[5] = _("Flags");
44 $available[6] = _("Size");
46 if (! isset($method)) { $method = ''; }
48 if ($method == 'up' && $num > 1) {
50 $tmp = $index_order[$prev];
51 $index_order[$prev] = $index_order[$num];
52 $index_order[$num] = $tmp;
53 } else if ($method == 'down' && $num < count($index_order)) {
55 $tmp = $index_order[$next];
56 $index_order[$next] = $index_order[$num];
57 $index_order[$num] = $tmp;
58 } else if ($method == 'remove' && $num) {
59 for ($i=1; $i < 8; $i++
) {
60 removePref($data_dir, $username, "order$i");
62 for ($j=1,$i=1; $i <= count($index_order); $i++
) {
64 $new_ary[$j] = $index_order[$i];
68 $index_order = array();
69 $index_order = $new_ary;
70 if (count($index_order) < 1) {
71 include ('../src/load_prefs.php');
73 } else if ($method == 'add' && $add) {
74 // User should not be able to insert PHP-code here
75 $add = str_replace ('<?', '..', $add);
76 $add = ereg_replace ('<.*script.*language.*php.*>', '..', $add);
77 $add = str_replace ('<%', '..', $add);
78 $index_order[count($index_order)+
1] = $add;
82 for ($i=1; $i <= count($index_order); $i++
) {
83 setPref($data_dir, $username, "order$i", $index_order[$i]);
86 echo '<table cellspacing="0" cellpadding="0" border="0" width="65%"><tr><td>' . "\n";
87 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.");
88 echo '</td></tr></table><br>';
90 if (count($index_order))
92 echo '<table cellspacing="0" cellpadding="0" border="0">' . "\n";
93 for ($i=1; $i <= count($index_order); $i++
) {
94 $tmp = $index_order[$i];
96 echo "<td><small><a href=\"options_order.php?method=up&num=$i\">". _("up") ."</a></small></td>\n";
97 echo '<td><small> | </small></td>' . "\n";
98 echo "<td><small><a href=\"options_order.php?method=down&num=$i\">". _("down") . "</a></small></td>\n";
99 echo '<td><small> | </small></td>' . "\n";
101 // Always show the subject
103 echo "<small><a href=\"options_order.php?method=remove&num=$i\">" . _("remove") . '</a></small>';
105 echo '<td><small> - </small></td>' . "\n";
106 echo '<td>' . $available[$tmp] . "</td>\n";
112 if (count($index_order) != count($available)) {
113 echo '<form name="f" method="post" action="options_order.php">';
114 echo '<select name="add">';
115 for ($i=1; $i <= count($available); $i++
) {
117 for ($j=1; $j <= count($index_order); $j++
) {
118 if ($index_order[$j] == $i) {
123 echo "<option value=\"$i\">$available[$i]</option>";
127 echo '<input type="hidden" value="add" name="method">';
128 echo '<input type="submit" value="'._("Add").'" name="submit">';
132 echo '<p><a href="../src/options.php">' . _("Return to options page") . '</a></p><br>';