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>';
53 /* Build a simple array into which we will build options. */
57 /******************************************************/
58 /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */
59 /******************************************************/
60 define('SMOPT_GRP_SPCFOLDER', 0);
61 define('SMOPT_GRP_FOLDERLIST', 1);
63 /*** Load the General Options into the array ***/
64 $optgrps[SMOPT_GRP_SPCFOLDER
] = _("Special Folder Options");
65 $optvals[SMOPT_GRP_SPCFOLDER
] = array();
67 $special_folder_values = array();
68 foreach ($boxes as $folder) {
69 if (strtolower($folder['unformatted']) != 'inbox') {
70 $real_value = $folder['unformatted-dm'];
71 $disp_value = str_replace(' ', ' ', $folder['formatted']);
72 $special_folder_values[$real_value] = $disp_value;
76 $trash_none = array(SMPREF_NONE
=> _("Do not use Trash"));
77 $trash_folder_values = array_merge($trash_none, $special_folder_values);
78 $optvals[SMOPT_GRP_SPCFOLDER
][] = array(
79 'name' => 'trash_folder',
80 'caption' => _("Trash Folder"),
81 'type' => SMOPT_TYPE_STRLIST
,
82 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
83 'posvals' => $trash_folder_values
86 $sent_none = array(SMPREF_NONE
=> _("Do not use Sent"));
87 $sent_folder_values = array_merge($sent_none, $special_folder_values);
88 $optvals[SMOPT_GRP_SPCFOLDER
][] = array(
89 'name' => 'sent_folder',
90 'caption' => _("Sent Folder"),
91 'type' => SMOPT_TYPE_STRLIST
,
92 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
93 'posvals' => $sent_folder_values
96 $draft_none = array(SMPREF_NONE
=> _("Do not use Drafts"));
97 $draft_folder_values = array_merge($draft_none, $special_folder_values);
98 $optvals[SMOPT_GRP_SPCFOLDER
][] = array(
99 'name' => 'draft_folder',
100 'caption' => _("Draft Folder"),
101 'type' => SMOPT_TYPE_STRLIST
,
102 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
103 'posvals' => $draft_folder_values
106 /*** Load the General Options into the array ***/
107 $optgrps[SMOPT_GRP_FOLDERLIST
] = _("Folder List Options");
108 $optvals[SMOPT_GRP_FOLDERLIST
] = array();
110 $optvals[SMOPT_GRP_FOLDERLIST
][] = array(
111 'name' => 'location_of_bar',
112 'caption' => _("Location of Folder List"),
113 'type' => SMOPT_TYPE_STRLIST
,
114 'refresh' => SMOPT_REFRESH_ALL
,
115 'posvals' => array(SMPREF_LOC_LEFT
=> _("Left"),
116 SMPREF_LOC_RIGHT
=> _("Right"))
119 $left_size_values = array();
120 for ($lsv = 100; $lsv <= 300; $lsv +
= 10) {
121 $left_size_values[$lsv] = "$lsv " . _("pixels");
123 $optvals[SMOPT_GRP_FOLDERLIST
][] = array(
124 'name' => 'left_size',
125 'caption' => _("Width of Folder List"),
126 'type' => SMOPT_TYPE_STRLIST
,
127 'refresh' => SMOPT_REFRESH_ALL
,
128 'posvals' => $left_size_values
131 $minute_str = _("Minutes");
132 $left_refresh_values = array(SMPREF_NONE
=> _("Never"));
133 foreach (array(30,60,120,180,300,600) as $lr_val) {
135 $left_refresh_values[$lr_val] = "$lr_val " . _("Seconds");
136 } else if ($lr_val == 60) {
137 $left_refresh_values[$lr_val] = "1 " . _("Minute");
139 $left_refresh_values[$lr_val] = ($lr_val/60) . " $minute_str";
142 $optvals[SMOPT_GRP_FOLDERLIST
][] = array(
143 'name' => 'left_refresh',
144 'caption' => _("Auto Refresh Folder List"),
145 'type' => SMOPT_TYPE_STRLIST
,
146 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
147 'posvals' => $left_refresh_values
150 $optvals[SMOPT_GRP_FOLDERLIST
][] = array(
151 'name' => 'unseen_notify',
152 'caption' => _("Enable Unseen Message Notification"),
153 'type' => SMOPT_TYPE_STRLIST
,
154 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
155 'posvals' => array(SMPREF_UNSEEN_NONE
=> _("No Notification"),
156 SMPREF_UNSEEN_INBOX
=> _("Only INBOX"),
157 SMPREF_UNSEEN_ALL
=> _("All Folders"))
160 $optvals[SMOPT_GRP_FOLDERLIST
][] = array(
161 'name' => 'unseen_type',
162 'caption' => _("Unseen Message Notification Type"),
163 'type' => SMOPT_TYPE_STRLIST
,
164 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
165 'posvals' => array(SMPREF_UNSEEN_ONLY
=> _("Only Unseen"),
166 SMPREF_UNSEEN_TOTAL
=> _("Unseen and Total"))
169 $optvals[SMOPT_GRP_FOLDERLIST
][] = array(
170 'name' => 'collapse_folders',
171 'caption' => _("Enable Collapsable Folders"),
172 'type' => SMOPT_TYPE_BOOLEAN
,
173 'refresh' => SMOPT_REFRESH_FOLDERLIST
176 $optvals[SMOPT_GRP_FOLDERLIST
][] = array(
177 'name' => 'date_format',
178 'caption' => _("Show Clock on Folders Panel"),
179 'type' => SMOPT_TYPE_STRLIST
,
180 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
181 'posvals' => array( '1' => 'MM/DD/YY HH:MM',
182 '2' => 'DD/MM/YY HH:MM',
186 '6' => _("No Clock")),
189 $optvals[SMOPT_GRP_FOLDERLIST
][] = array(
190 'name' => 'hour_format',
191 'caption' => _("Hour Format"),
192 'type' => SMOPT_TYPE_STRLIST
,
193 'refresh' => SMOPT_REFRESH_FOLDERLIST
,
194 'posvals' => array(SMPREF_TIME_12HR
=> _("12-hour clock"),
195 SMPREF_TIME_24HR
=> _("24-hour clock"))
199 /* Build and output the option groups. */
200 $option_groups = createOptionGroups($optgrps, $optvals);
201 printOptionGroups($option_groups);
203 echo '<TR><TD ALIGN="CENTER" VALIGN="MIDDLE" COLSPAN="2" NOWRAP><B>'
204 . _("Plugin Options") . "</B></TD></TR>\n";
205 OptionSubmit( 'submit_folder' );
211 <?php
do_hook('options_folders_bottom'); ?
>