* Fixed the MOTD
[squirrelmail.git] / src / options_display.php
CommitLineData
c36ed9cf 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 **
245a6892 10 ** $Id$
c36ed9cf 11 **/
12
f740c049 13 include('../src/validate.php');
f740c049 14 include('../functions/display_messages.php');
15 include('../functions/imap.php');
16 include('../functions/array.php');
176ed7de 17 include('../functions/plugin.php');
f740c049 18
e8e0acdf 19 displayPageHeader($color, 'None');
20 $chosen_language = getPref($data_dir, $username, 'language');
c36ed9cf 21?>
e9f8ea4e 22 <br>
e7db48af 23<table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
24<tr><td bgcolor="<?php echo $color[0] ?>" align="center">
c36ed9cf 25
e7db48af 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">
c36ed9cf 33 <tr>
e8e0acdf 34 <td align="right" nowrap><?php echo _("Theme"); ?>:
c36ed9cf 35 </td><td>
8442ac08 36<?php
e8e0acdf 37 echo ' <tt><select name="chosentheme">' . "\n";
c36ed9cf 38 for ($i = 0; $i < count($theme); $i++) {
e8e0acdf 39 if ($theme[$i]['PATH'] == $chosen_theme)
40 echo ' <option selected value="'.$theme[$i]['PATH'].'">'.$theme[$i]['NAME']."\n";
c36ed9cf 41 else
e8e0acdf 42 echo ' <option value="'.$theme[$i]['PATH'].'">'.$theme[$i]['NAME']."\n";
c36ed9cf 43 }
e8e0acdf 44 echo ' </select></tt>';
c36ed9cf 45?>
46 </td>
47 </tr>
48 <tr>
ac53fb56 49 <td align="right" nowrap><?php echo _("Language"); ?>:
c36ed9cf 50 </td><td>
8442ac08 51<?php
e8e0acdf 52 echo ' <tt><select name="language">' . "\n";
441f2d33 53 foreach ($languages as $code => $name) {
c36ed9cf 54 if ($code==$chosen_language)
e8e0acdf 55 echo ' <OPTION SELECTED VALUE="'.$code.'">'.$languages[$code]['NAME']."\n";
c36ed9cf 56 else
f3b4824b 57 echo ' <OPTION VALUE="'.$code.'">'.$languages[$code]['NAME']."\n";
441f2d33 58 }
e8e0acdf 59 echo ' </select></tt>';
441f2d33 60 if (! $use_gettext)
b61ed24d 61 echo '<br><small>This system doesn\'t support multiple languages</small>';
441f2d33 62
c36ed9cf 63?>
64 </td>
65 <tr>
66 <td align=right nowrap>&nbsp;
e8e0acdf 67 <?php echo _("Use Javascript or HTML addressbook?") . '</td><td>';
c36ed9cf 68 if ($use_javascript_addr_book == true) {
e8e0acdf 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");
c36ed9cf 71 } else {
e8e0acdf 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");
c36ed9cf 74 }
75 ?>
76 </td>
77 </tr>
78 <tr>
6170c5b6 79 <td align=right nowrap><?php echo _("Number of Messages to Index"); ?>:
c36ed9cf 80 </td><td>
8442ac08 81<?php
c36ed9cf 82 if (isset($show_num))
e8e0acdf 83 echo ' <tt><input type="text" size="5" name="shownum" value="'.$show_num.'"></tt><br>';
c36ed9cf 84 else
e8e0acdf 85 echo ' <tt><input type="text" size="5" name="shownum" value="25"></tt><br>';
c36ed9cf 86?>
87 </td>
88 </tr>
89 <tr>
e8e0acdf 90 <td align="right" nowrap><?php echo _("Wrap incoming text at"); ?>:
c36ed9cf 91 </td><td>
8442ac08 92<?php
c36ed9cf 93 if (isset($wrap_at))
e8e0acdf 94 echo ' <tt><input type="text" size="5" name="wrapat" value="'.$wrap_at.'"></tt><br>';
c36ed9cf 95 else
e8e0acdf 96 echo ' <tt><input type="tex" size="5" name="wrapat" value="86"></tt><br>';
c36ed9cf 97?>
98 </td>
99 </tr>
100 <tr>
e8e0acdf 101 <td align="right" nowrap><?php echo _("Size of editor window"); ?>:
c36ed9cf 102 </td><td>
8442ac08 103<?php
c36ed9cf 104 if ($editor_size >= 10 && $editor_size <= 255)
e8e0acdf 105 echo ' <tt><input type="text" size="5" name="editorsize" value="'.$editor_size.'"></tt><br>';
c36ed9cf 106 else
e8e0acdf 107 echo ' <tt><input type="text" size="5" name="editorsize" value="76"></tt><br>';
c36ed9cf 108?>
109 </td>
110 </tr>
111 <tr>
e8e0acdf 112 <td align="right" nowrap><?PHP echo _("Location of folder list") ?>:</td>
9a732bb6 113 <td><select name="folder_new_location">
114 <option value="left"<?PHP
115 if ($location_of_bar != 'right') echo ' SELECTED';
e190b5b0 116 ?>><?PHP echo _("Left"); ?></option>
9a732bb6 117 <option value="right"<?PHP
118 if ($location_of_bar == 'right') echo ' SELECTED';
e190b5b0 119 ?>><?PHP echo _("Right"); ?></option>
9a732bb6 120 </select>
121 </td>
122 </tr>
441f2d33 123 <tr>
e8e0acdf 124 <td align="right" nowrap><?PHP echo _("Location of buttons when composing") ?>:</td>
441f2d33 125 <td><select name="button_new_location">
126 <option value="top"<?PHP
127 if ($location_of_buttons == 'top') echo ' SELECTED';
e190b5b0 128 ?>><?PHP echo _("Before headers"); ?></option>
441f2d33 129 <option value="between"<?PHP
130 if ($location_of_buttons == 'between') echo ' SELECTED';
e190b5b0 131 ?>><?PHP echo _("Between headers and message body"); ?></option>
441f2d33 132 <option value="bottom"<?PHP
133 if ($location_of_buttons == 'bottom') echo ' SELECTED';
e190b5b0 134 ?>><?PHP echo _("After message body"); ?></option>
441f2d33 135 </select>
136 </td>
137 </tr>
9a732bb6 138 <tr>
139 <td align=right nowrap><?php echo _("Width of folder list"); ?>:
c36ed9cf 140 </td><td>
8442ac08 141<?php
e8e0acdf 142 echo ' <select name="leftsize">' . "\n";
176ed7de 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 }
38bb54ba 150 echo ' </select>';
c36ed9cf 151?>
152 </td>
153 </tr>
154 <tr>
38bb54ba 155 <td align="right" nowrap><?php echo _("Auto refresh folder list"); ?>:
c36ed9cf 156 </td><td>
8442ac08 157<?php
1de36f81 158 $seconds_str = _("Seconds");
159 $none_str = _("None");
160 $minute_str = _("Minute");
161 $minutes_str = _("Minutes");
162
38bb54ba 163 echo ' <SELECT name="leftrefresh">';
8df1b65b 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
178function 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}
e8e0acdf 201 echo ' </SELECT>';
c36ed9cf 202?>
203 </td>
204 </tr>
e2ab93e5 205 <tr>
ac53fb56 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>
e2ab93e5 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
231echo _("Yes, show me the HTML version of a mail message, if it is available.");
232 ?>
233 </td>
234 </tr>
e8e0acdf 235 <?php do_hook('options_display_inside'); ?>
c36ed9cf 236 <tr>
237 <td>&nbsp;
238 </td><td>
32f4685b 239 <input type="submit" value="<?php echo _("Submit"); ?>"name="submit_display">
c36ed9cf 240 </td>
241 </tr>
e7db48af 242 </table>
c36ed9cf 243 </form>
e7db48af 244
e8e0acdf 245 <?php do_hook('options_display_bottom'); ?>
e7db48af 246
247 </td></tr>
248 </table>
249
250</td></tr>
251</table>
c36ed9cf 252</body></html>