Another initialization thing fixed
[squirrelmail.git] / src / options_folder.php
CommitLineData
c36ed9cf 1<?php
2 /**
3 ** options_folder.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 all options relating to folders
9 **
245a6892 10 ** $Id$
c36ed9cf 11 **/
12
13 session_start();
14
c36ed9cf 15 if (!isset($strings_php))
16 include("../functions/strings.php");
61423189 17 if (!isset($config_php))
18 include("../config/config.php");
c36ed9cf 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");
d7d3c4d4 29 if (!isset($plugin_php))
30 include("../functions/plugin.php");
c36ed9cf 31
32 include("../src/load_prefs.php");
33 displayPageHeader($color, "None");
34
35 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
61423189 36 $boxes = sqimap_mailbox_list($imapConnection, $boxes="");
1195c340 37 sqimap_logout($imapConnection);
c36ed9cf 38?>
e9f8ea4e 39 <br>
6170c5b6 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") . " - " . _("Folder Preferences"); ?></b></center>
c36ed9cf 42 </td></tr></table>
43
d7d3c4d4 44 <form name=f action="options.php" method=post>
c36ed9cf 45 <table width=100% cellpadding=0 cellspacing=2 border=0>
46
6170c5b6 47<?php if ($show_prefix_option == true) { ?>
c36ed9cf 48 <tr>
6170c5b6 49 <td align=right nowrap><?php echo _("Folder Path"); ?>:
c36ed9cf 50 </td><td>
6170c5b6 51<?php if (isset ($folder_prefix))
24fc5dd2 52 echo " <input type=text name=folderprefix value=\"$folder_prefix\" size=35><br>";
c36ed9cf 53 else
24fc5dd2 54 echo " <input type=text name=folderprefix value=\"$default_folder_prefix\" size=35><br>";
c36ed9cf 55?>
56 </td>
57 </tr>
6170c5b6 58<?php }
c36ed9cf 59
60 // TRASH FOLDER
61 echo "<tr><td nowrap align=right>";
62 echo _("Trash Folder:");
63 echo "</td><td>";
64 echo "<TT><SELECT NAME=trash>\n";
65 if ($move_to_trash == true)
66 echo "<option value=none>" . _("Don't use Trash");
67 else
68 echo "<option value=none selected>" . _("Do not use Trash");
69
70 for ($i = 0; $i < count($boxes); $i++) {
71 $use_folder = true;
72 if (strtolower($boxes[$i]["unformatted"]) == "inbox") {
73 $use_folder = false;
74 }
75 if ($use_folder == true) {
76 $box = $boxes[$i]["unformatted-dm"];
77 $box2 = replace_spaces($boxes[$i]["formatted"]);
78 if (($boxes[$i]["unformatted"] == $trash_folder) && ($move_to_trash == true))
79 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
80 else
81 echo " <OPTION VALUE=\"$box\">$box2\n";
82 }
83 }
84 echo "</SELECT></TT>\n";
85 echo "</td></tr>";
86
87
88 // SENT FOLDER
89 echo "<tr><td nowrap align=right>";
90 echo _("Sent Folder:");
91 echo "</td><td>";
92 echo "<TT><SELECT NAME=sent>\n";
93 if ($move_to_sent == true)
94 echo "<option value=none>" . _("Don't use Sent");
95 else
96 echo "<option value=none selected>" . _("Do not use Sent");
97
98 for ($i = 0; $i < count($boxes); $i++) {
99 $use_folder = true;
100 if (strtolower($boxes[$i]["unformatted"]) == "inbox") {
101 $use_folder = false;
102 }
103 if ($use_folder == true) {
104 $box = $boxes[$i]["unformatted-dm"];
105 $box2 = replace_spaces($boxes[$i]["formatted"]);
106 if (($boxes[$i]["unformatted"] == $sent_folder) && ($move_to_sent == true))
107 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
108 else
109 echo " <OPTION VALUE=\"$box\">$box2\n";
110 }
111 }
112 echo "</SELECT></TT>\n";
113 echo "</td></tr>";
114?>
24fc5dd2 115 <tr>
116 <td valign=top align=right>
117 <br>
6170c5b6 118 <?php echo _("Unseen message notification"); ?>:
24fc5dd2 119 </td>
120 <td>
6170c5b6 121 <input type=radio name=unseennotify value=1<?php if ($unseen_notify == 1) echo " checked"; ?>> <?php echo _("No notification") ?><br>
122 <input type=radio name=unseennotify value=2<?php if ($unseen_notify != 1 && $unseen_notify != 3) echo " checked"; ?>> <?php echo _("Only INBOX") ?><br>
123 <input type=radio name=unseennotify value=3<?php if ($unseen_notify == 3) echo " checked"; ?>> <?php echo _("All Folders") ?><br>
24fc5dd2 124 <br>
125 </td>
126 </tr>
127 <tr>
128 <td valign=top align=right>
129 <br>
6170c5b6 130 <?php echo _("Unseen message notification type"); ?>:
24fc5dd2 131 </td>
132 <td>
6170c5b6 133 <input type=radio name=unseentype value=1<?php if ($unseen_type < 2 || $unseen_type > 2) echo " checked"; ?>> <?php echo _("Only unseen"); ?> - (4)<br>
134 <input type=radio name=unseentype value=2<?php if ($unseen_type == 2) echo " checked"; ?>> <?php echo _("Unseen and Total"); ?> - (4/27)
24fc5dd2 135 </td>
136 </tr>
ef3c69f0 137 <?php do_hook("options_folders_inside"); ?>
c36ed9cf 138 <tr>
139 <td>&nbsp;
140 </td><td>
32f4685b 141 <input type="submit" value="<?php echo _("Submit"); ?>" name="submit_folder">
c36ed9cf 142 </td>
143 </tr>
144 </table>
145 </form>
d7d3c4d4 146 <?php do_hook("options_folders_bottom"); ?>
c36ed9cf 147</body></html>