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 | |
ff8a98e7 |
13 | require_once('../src/validate.php'); |
14 | require_once('../functions/display_messages.php'); |
15 | require_once('../functions/imap.php'); |
16 | require_once('../functions/array.php'); |
17 | require_once('../functions/plugin.php'); |
2016e645 |
18 | require_once('../functions/options.php'); |
f740c049 |
19 | |
e8e0acdf |
20 | displayPageHeader($color, 'None'); |
c36ed9cf |
21 | |
22 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
4ebfe18a |
23 | $boxes = sqimap_mailbox_list($imapConnection); |
1195c340 |
24 | sqimap_logout($imapConnection); |
c36ed9cf |
25 | ?> |
e9f8ea4e |
26 | <br> |
e7db48af |
27 | <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0"> |
28 | <tr><td bgcolor="<?php echo $color[0] ?>" align="center"> |
c36ed9cf |
29 | |
e7db48af |
30 | <b><?php echo _("Options") . " - " . _("Folder Preferences"); ?></b> |
31 | |
32 | <table width="100%" border="0" cellpadding="1" cellspacing="1"> |
33 | <tr><td bgcolor="<?php echo $color[4] ?>" align="center"> |
34 | |
35 | <form name="f" action="options.php" method="post"><br> |
36 | |
37 | <table width="100%" cellpadding="2" cellspacing="0" border="0"> |
c36ed9cf |
38 | |
6170c5b6 |
39 | <?php if ($show_prefix_option == true) { ?> |
c36ed9cf |
40 | <tr> |
6170c5b6 |
41 | <td align=right nowrap><?php echo _("Folder Path"); ?>: |
c36ed9cf |
42 | </td><td> |
6170c5b6 |
43 | <?php if (isset ($folder_prefix)) |
e8e0acdf |
44 | echo ' <input type="text" name="folderprefix" value="'.$folder_prefix.'" size="35"><br>'; |
c36ed9cf |
45 | else |
e8e0acdf |
46 | echo ' <input type="text" name="folderprefix" value="'.$default_folder_prefix.'" size="35"><br>'; |
c36ed9cf |
47 | ?> |
48 | </td> |
49 | </tr> |
6170c5b6 |
50 | <?php } |
c36ed9cf |
51 | |
b5efadfa |
52 | /* Build a simple array into which we will build options. */ |
53 | $optvals = array(); |
54 | |
55 | $special_folder_values = array(); |
56 | foreach ($boxes as $folder) { |
57 | if (strtolower($folder['unformatted']) != 'inbox') { |
58 | $real_value = $folder['unformatted-dm']; |
59 | $disp_value = str_replace(' ', ' ', $folder['formatted']); |
60 | $special_folder_values[$real_value] = $disp_value; |
61 | } |
62 | } |
63 | |
64 | $trash_none = array(SMPREF_NONE => _("Do not use Trash")); |
65 | $trash_folder_values = array_merge($trash_none, $special_folder_values); |
66 | $optvals[] = array( |
67 | 'name' => 'trash_folder', |
68 | 'caption' => _("Trash Folder"), |
69 | 'type' => SMOPT_TYPE_STRLIST, |
70 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
71 | 'posvals' => $trash_folder_values |
72 | ); |
73 | |
74 | $sent_none = array(SMPREF_NONE => _("Do not use Sent")); |
75 | $sent_folder_values = array_merge($sent_none, $special_folder_values); |
76 | $optvals[] = array( |
77 | 'name' => 'sent_folder', |
78 | 'caption' => _("Sent Folder"), |
79 | 'type' => SMOPT_TYPE_STRLIST, |
80 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
81 | 'posvals' => $sent_folder_values |
82 | ); |
83 | |
84 | $drafts_none = array(SMPREF_NONE => _("Do not use Drafts")); |
85 | $draft_folder_values = array_merge($draft_none, $special_folder_values); |
86 | $optvals[] = array( |
87 | 'name' => 'draft_folder', |
88 | 'caption' => _("Draft Folder"), |
89 | 'type' => SMOPT_TYPE_STRLIST, |
90 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
91 | 'posvals' => $draft_folder_values |
92 | ); |
93 | |
94 | /* Build all these values into an array of SquirrelOptions objects. */ |
95 | $options = createOptionArray($optvals); |
96 | |
97 | /* Print the row for each option. */ |
98 | foreach ($options as $option) { |
99 | if ($option->type != SMOPT_TYPE_HIDDEN) { |
100 | echo "<TR>\n"; |
101 | echo ' <TD ALIGN="RIGHT" VALIGN="MIDDLE" NOWRAP>' |
102 | . $option->caption . ":</TD>\n"; |
103 | echo ' <TD>' . $option->createHTMLWidget() . "</TD>\n"; |
104 | echo "</TR>\n"; |
105 | } else { |
106 | echo $option->createHTMLWidget(); |
107 | } |
108 | } |
109 | |
2016e645 |
110 | // if( $unseen_notify == '' ) |
111 | // $unseen_notify = '2'; |
112 | OptionRadio( _("Unseen message notification"), |
113 | 'unseennotify', |
114 | array( 1 => _("No notification"), |
115 | 2 => _("Only INBOX"), |
116 | 3 => _("All Folders") ), |
117 | $unseen_notify, '', '', |
118 | '<br>' ); |
119 | OptionRadio( _("Unseen message notification type"), |
120 | 'unseentype', |
121 | array( 1 => _("Only unseen"), |
122 | 2 => _("Unseen and Total") ), |
123 | $unseen_type, '', '', |
124 | '<br>' ); |
125 | OptionCheck( _("Collapseable folders"), |
126 | 'collapsefolders', |
127 | $collapse_folders, |
128 | _("Enable Collapseable Folders") ); |
129 | OptionSelect( '<b>' . _("Show Clock on Folders Panel") . '</b> ' . _("Date format"), |
130 | 'dateformat', |
131 | array( '1' => 'MM/DD/YY HH:MM', |
132 | '2' => 'DD/MM/YY HH:MM', |
133 | '3' => 'DDD, HH:MM', |
134 | '4' => 'HH:MM:SS', |
135 | '5' => 'HH:MM', |
136 | '6' => _("No Clock") ), |
137 | $date_format ); |
138 | OptionSelect( _("Hour format"), |
139 | 'hourformat', |
140 | array( '1' => _("24-hour clock"), |
141 | '2' => _("12-hour clock") ), |
142 | $hour_format ); |
143 | |
144 | echo '<tr><td colspan=2><hr noshade></td></tr>'; |
145 | do_hook("options_folders_inside"); |
84c18709 |
146 | OptionSubmit( 'submit_folder' ); |
2016e645 |
147 | ?> |
148 | |
c36ed9cf |
149 | </table> |
150 | </form> |
e7db48af |
151 | |
e8e0acdf |
152 | <?php do_hook('options_folders_bottom'); ?> |
e7db48af |
153 | |
154 | </td></tr> |
155 | </table> |
156 | |
157 | </td></tr> |
158 | </table> |
b5efadfa |
159 | </body></html> |