5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 ** Displays all options relating to folders
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');
18 require_once('../functions/options.php');
20 displayPageHeader($color, 'None');
22 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
23 $boxes = sqimap_mailbox_list($imapConnection);
24 sqimap_logout($imapConnection);
27 <table width
="95%" align
="center" border
="0" cellpadding
="2" cellspacing
="0">
28 <tr
><td bgcolor
="<?php echo $color[0] ?>" align
="center">
30 <b
><?php
echo _("Options") . " - " . _("Folder Preferences"); ?
></b
>
32 <table width
="100%" border
="0" cellpadding
="1" cellspacing
="1">
33 <tr
><td bgcolor
="<?php echo $color[4] ?>" align
="center">
35 <form name
="f" action
="options.php" method
="post"><br
>
37 <table width
="100%" cellpadding
="2" cellspacing
="0" border
="0">
39 <?php
if ($show_prefix_option == true) { ?
>
41 <td align
=right nowrap
><?php
echo _("Folder Path"); ?
>:
43 <?php
if (isset ($folder_prefix))
44 echo ' <input type="text" name="folderprefix" value="'.$folder_prefix.'" size="35"><br>';
46 echo ' <input type="text" name="folderprefix" value="'.$default_folder_prefix.'" size="35"><br>';
52 /* Build a simple array into which we will build options. */
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;
64 $trash_none = array(SMPREF_NONE
=> _("Do not use Trash"));
65 $trash_folder_values = array_merge($trash_none, $special_folder_values);
67 'name' => 'trash_folder',
68 'caption' => _("Trash Folder"),
69 'type' => SMOPT_TYPE_STRLIST
,
70 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
71 'posvals' => $trash_folder_values
74 $sent_none = array(SMPREF_NONE
=> _("Do not use Sent"));
75 $sent_folder_values = array_merge($sent_none, $special_folder_values);
77 'name' => 'sent_folder',
78 'caption' => _("Sent Folder"),
79 'type' => SMOPT_TYPE_STRLIST
,
80 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
81 'posvals' => $sent_folder_values
84 $drafts_none = array(SMPREF_NONE
=> _("Do not use Drafts"));
85 $draft_folder_values = array_merge($draft_none, $special_folder_values);
87 'name' => 'draft_folder',
88 'caption' => _("Draft Folder"),
89 'type' => SMOPT_TYPE_STRLIST
,
90 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
91 'posvals' => $draft_folder_values
95 'name' => 'location_of_bar',
96 'caption' => _("Location of Folder List"),
97 'type' => SMOPT_TYPE_STRLIST
,
98 'refresh' => SMOPT_REFRESH_ALL
,
99 'posvals' => array(SMPREF_LOC_LEFT
=> _("Left"),
100 SMPREF_LOC_RIGHT
=> _("Right"))
103 $left_size_values = array();
104 for ($lsv = 100; $lsv <= 300; $lsv +
= 10) {
105 $left_size_values[$lsv] = "$lsv " . _("pixels");
108 'name' => 'left_size',
109 'caption' => _("Width of Folder List"),
110 'type' => SMOPT_TYPE_STRLIST
,
111 'refresh' => SMOPT_REFRESH_ALL
,
112 'posvals' => $left_size_values
115 $minute_str = _("Minutes");
116 $left_refresh_values = array(SMPREF_NONE
=> _("Never"));
117 foreach (array(30,60,120,180,300,600) as $lr_val) {
119 $left_refresh_values[$lr_val] = "$lr_val " . _("Seconds");
120 } else if ($lr_val == 60) {
121 $left_refresh_values[$lr_val] = "1 " . _("Minute");
123 $left_refresh_values[$lr_val] = ($lr_val/60) . " $minute_str";
127 'name' => 'left_refresh',
128 'caption' => _("Auto Refresh Folder List"),
129 'type' => SMOPT_TYPE_STRLIST
,
130 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
131 'posvals' => $left_refresh_values
135 'name' => 'unseen_notify',
136 'caption' => _("Enable Unseen Message Notification"),
137 'type' => SMOPT_TYPE_STRLIST
,
138 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
139 'posvals' => array(SMPREF_UNSEEN_NONE
=> _("No Notification"),
140 SMPREF_UNSEEN_INBOX
=> _("Only INBOX"),
141 SMPREF_UNSEEN_ALL
=> _("All Folders"))
145 'name' => 'unseen_type',
146 'caption' => _("Unseen Message Notification Type"),
147 'type' => SMOPT_TYPE_STRLIST
,
148 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
149 'posvals' => array(SMPREF_UNSEEN_ONLY
=> _("Only Unseen"),
150 SMPREF_UNSEEN_TOTAL
=> _("Unseen and Total"))
154 'name' => 'collapse_folders',
155 'caption' => _("Enable Collapsable Folders"),
156 'type' => SMOPT_TYPE_BOOLEAN
,
157 'refresh' => SMOPT_REFRESH_FOLDERLIST
161 'name' => 'date_format',
162 'caption' => _("Show Clock on Folders Panel"),
163 'type' => SMOPT_TYPE_STRLIST
,
164 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
165 'posvals' => array( '1' => 'MM/DD/YY HH:MM',
166 '2' => 'DD/MM/YY HH:MM',
170 '6' => _("No Clock")),
174 'name' => 'hour_format',
175 'caption' => _("Hour Format"),
176 'type' => SMOPT_TYPE_STRLIST
,
177 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
178 'posvals' => array(SMPREF_TIME_12HR
=> _("12-hour clock"),
179 SMPREF_TIME_24HR
=> _("24-hour clock"))
183 /* Build all these values into an array of SquirrelOptions objects. */
184 $options = createOptionArray($optvals);
186 /* Print the row for each option. */
187 foreach ($options as $option) {
188 if ($option->type
!= SMOPT_TYPE_HIDDEN
) {
190 echo ' <TD ALIGN="RIGHT" VALIGN="MIDDLE" NOWRAP>'
191 . $option->caption
. ":</TD>\n";
192 echo ' <TD>' . $option->createHTMLWidget() . "</TD>\n";
195 echo $option->createHTMLWidget();
199 // if( $unseen_notify == '' )
200 // $unseen_notify = '2';
203 echo '<tr><td colspan=2><hr noshade></td></tr>';
204 do_hook("options_folders_inside");
205 OptionSubmit( 'submit_folder' );
211 <?php
do_hook('options_folders_bottom'); ?
>