* Moved load_prefs.php and display_page.php (or whatever it is called) into
[squirrelmail.git] / src / options_display.php
1 <?php
2 /**
3 ** options_display.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 optinos about display preferences
9 **
10 ** $Id$
11 **/
12
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');
18
19 displayPageHeader($color, 'None');
20 $chosen_language = getPref($data_dir, $username, 'language');
21 ?>
22 <br>
23 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
24 <tr><td bgcolor="<?php echo $color[0] ?>" align="center">
25
26 <b><?php echo _("Options") . ' - ' . _("Display Preferences"); ?></b><br>
27
28 <table width="100%" border="0" cellpadding="1" cellspacing="1">
29 <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
30
31 <form name="f" action="options.php" method="post"><br>
32 <table width="100%" cellpadding="2" cellspacing="0" border="0">
33 <tr>
34 <td align="right" nowrap><?php echo _("Theme"); ?>:
35 </td><td>
36 <?php
37 echo ' <tt><select name="chosentheme">' . "\n";
38 for ($i = 0; $i < count($theme); $i++) {
39 if ($theme[$i]['PATH'] == $chosen_theme)
40 echo ' <option selected value="'.$theme[$i]['PATH'].'">'.$theme[$i]['NAME']."\n";
41 else
42 echo ' <option value="'.$theme[$i]['PATH'].'">'.$theme[$i]['NAME']."\n";
43 }
44 echo ' </select></tt>';
45 ?>
46 </td>
47 </tr>
48 <tr>
49 <td align="right" nowrap><?php echo _("Language"); ?>:
50 </td><td>
51 <?php
52 echo ' <tt><select name="language">' . "\n";
53 foreach ($languages as $code => $name) {
54 if ($code==$chosen_language)
55 echo ' <OPTION SELECTED VALUE="'.$code.'">'.$languages[$code]['NAME']."\n";
56 else
57 echo ' <OPTION VALUE="'.$code.'">'.$languages[$code]['NAME']."\n";
58 }
59 echo ' </select></tt>';
60 if (! $use_gettext)
61 echo '<br><small>This system doesn\'t support multiple languages</small>';
62
63 ?>
64 </td>
65 <tr>
66 <td align=right nowrap>&nbsp;
67 <?php echo _("Use Javascript or HTML addressbook?") . '</td><td>';
68 if ($use_javascript_addr_book == true) {
69 echo ' <input type="radio" name="javascript_abook" value="1" checked> ' . _("JavaScript") . '&nbsp;&nbsp;&nbsp;&nbsp;';
70 echo ' <input type="radio" name="javascript_abook" value="0"> ' . _("HTML");
71 } else {
72 echo ' <input type="radio" name="javascript_abook" value="1"> ' . _("JavaScript") . '&nbsp;&nbsp;&nbsp;&nbsp;';
73 echo ' <input type="radio" name="javascript_abook" value="0" checked> ' . _("HTML");
74 }
75 ?>
76 </td>
77 </tr>
78 <tr>
79 <td align=right nowrap><?php echo _("Number of Messages to Index"); ?>:
80 </td><td>
81 <?php
82 if (isset($show_num))
83 echo ' <tt><input type="text" size="5" name="shownum" value="'.$show_num.'"></tt><br>';
84 else
85 echo ' <tt><input type="text" size="5" name="shownum" value="25"></tt><br>';
86 ?>
87 </td>
88 </tr>
89 <tr>
90 <td align="right" nowrap><?php echo _("Wrap incoming text at"); ?>:
91 </td><td>
92 <?php
93 if (isset($wrap_at))
94 echo ' <tt><input type="text" size="5" name="wrapat" value="'.$wrap_at.'"></tt><br>';
95 else
96 echo ' <tt><input type="tex" size="5" name="wrapat" value="86"></tt><br>';
97 ?>
98 </td>
99 </tr>
100 <tr>
101 <td align="right" nowrap><?php echo _("Size of editor window"); ?>:
102 </td><td>
103 <?php
104 if ($editor_size >= 10 && $editor_size <= 255)
105 echo ' <tt><input type="text" size="5" name="editorsize" value="'.$editor_size.'"></tt><br>';
106 else
107 echo ' <tt><input type="text" size="5" name="editorsize" value="76"></tt><br>';
108 ?>
109 </td>
110 </tr>
111 <tr>
112 <td align="right" nowrap><?PHP echo _("Location of folder list") ?>:</td>
113 <td><select name="folder_new_location">
114 <option value="left"<?PHP
115 if ($location_of_bar != 'right') echo ' SELECTED';
116 ?>><?PHP echo _("Left"); ?></option>
117 <option value="right"<?PHP
118 if ($location_of_bar == 'right') echo ' SELECTED';
119 ?>><?PHP echo _("Right"); ?></option>
120 </select>
121 </td>
122 </tr>
123 <tr>
124 <td align="right" nowrap><?PHP echo _("Location of buttons when composing") ?>:</td>
125 <td><select name="button_new_location">
126 <option value="top"<?PHP
127 if ($location_of_buttons == 'top') echo ' SELECTED';
128 ?>><?PHP echo _("Before headers"); ?></option>
129 <option value="between"<?PHP
130 if ($location_of_buttons == 'between') echo ' SELECTED';
131 ?>><?PHP echo _("Between headers and message body"); ?></option>
132 <option value="bottom"<?PHP
133 if ($location_of_buttons == 'bottom') echo ' SELECTED';
134 ?>><?PHP echo _("After message body"); ?></option>
135 </select>
136 </td>
137 </tr>
138 <tr>
139 <td align=right nowrap><?php echo _("Width of folder list"); ?>:
140 </td><td>
141 <?php
142 echo ' <select name="leftsize">' . "\n";
143 for ($i = 100; $i <= 300; $i += 10)
144 {
145 if ($left_size >= $i && $left_size < $i + 10)
146 echo "<option value=\"$i\" selected>$i pixels\n";
147 else
148 echo "<option value=\"$i\">$i pixels\n";
149 }
150 echo ' </select>';
151 ?>
152 </td>
153 </tr>
154 <tr>
155 <td align="right" nowrap><?php echo _("Auto refresh folder list"); ?>:
156 </td><td>
157 <?php
158 $seconds_str = _("Seconds");
159 $none_str = _("None");
160 $minute_str = _("Minute");
161 $minutes_str = _("Minutes");
162
163 echo ' <SELECT name="leftrefresh">';
164
165 if ($left_refresh == '')
166 $left_refresh = 'None';
167 if ($left_refresh > 600)
168 $left_refresh = 600;
169 RefreshOption($left_refresh, '', 'None', _("None"));
170 RefreshOption($left_refresh, 30);
171 RefreshOption($left_refresh, 60);
172 RefreshOption($left_refresh, 120);
173 RefreshOption($left_refresh, 180);
174 RefreshOption($left_refresh, 300);
175 RefreshOption($left_refresh, 600);
176 // Refreshes after the session auto-timeout (default 15 min) is pointless
177
178 function RefreshOption(&$current, $val, $str = '') {
179 static $lastVal = 0;
180
181 if (is_int($val) && is_int($current)) {
182 if ($current > $lastVal && $current <= $val)
183 $current = $val;
184 }
185
186 if ($str == '') {
187 if ($val > 60) {
188 $str = ($val / 60) . ' ' . _("Minutes");
189 } elseif ($val == 60) {
190 $str = '1 ' . _("Minute");
191 } else {
192 $str = $val . ' ' . _("Seconds");
193 }
194 }
195
196 echo '<option value="' . $val . '"';
197 if ($val == $current)
198 echo ' SELECTED';
199 echo '>' . $str . "\n";
200 }
201 echo ' </SELECT>';
202 ?>
203 </td>
204 </tr>
205 <tr>
206 <td align="right">
207 <?php echo _("Use alternating row colors?") ?>
208 </td><td>
209 <?php
210 if (isset($alt_index_colors) && $alt_index_colors == 1) {
211 $a = " checked";
212 $b = "";
213 } else {
214 $a = "";
215 $b = " checked";
216 }
217 ?>
218 <input type="radio" name="altIndexColors" value="1"<?php echo $a ?>> <?php echo _("Yes") ?> &nbsp;&nbsp;
219 <input type="radio" name="altIndexColors" value="0"<?php echo $b ?>> <?php echo _("No") ?><br>
220 </td>
221 </tr>
222 <tr>
223 <td align=right>
224 <?php echo _("Show HTML version by default"); ?>:
225 </td>
226 <td>
227 <input type=checkbox name=showhtmldefault <?php
228 if (isset($show_html_default) && $show_html_default)
229 echo " checked"; ?>>
230 <?php
231 echo _("Yes, show me the HTML version of a mail message, if it is available.");
232 ?>
233 </td>
234 </tr>
235 <?php do_hook('options_display_inside'); ?>
236 <tr>
237 <td>&nbsp;
238 </td><td>
239 <input type="submit" value="<?php echo _("Submit"); ?>"name="submit_display">
240 </td>
241 </tr>
242 </table>
243 </form>
244
245 <?php do_hook('options_display_bottom'); ?>
246
247 </td></tr>
248 </table>
249
250 </td></tr>
251 </table>
252 </body></html>