* Made everything here global too to work with new include system
[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
13 session_start();
14
c36ed9cf 15 if (!isset($strings_php))
e8e0acdf 16 include('../functions/strings.php');
1863670d 17 if (!isset($config_php))
e8e0acdf 18 include('../config/config.php');
c36ed9cf 19 if (!isset($page_header_php))
e8e0acdf 20 include('../functions/page_header.php');
c36ed9cf 21 if (!isset($display_messages_php))
e8e0acdf 22 include('../functions/display_messages.php');
c36ed9cf 23 if (!isset($imap_php))
e8e0acdf 24 include('../functions/imap.php');
c36ed9cf 25 if (!isset($array_php))
e8e0acdf 26 include('../functions/array.php');
c36ed9cf 27 if (!isset($i18n_php))
e8e0acdf 28 include('../functions/i18n.php');
d7d3c4d4 29 if (!isset($plugin_php))
e8e0acdf 30 include('../functins/plugin.php');
c36ed9cf 31
e8e0acdf 32 include('../src/load_prefs.php');
33 displayPageHeader($color, 'None');
34 $chosen_language = getPref($data_dir, $username, 'language');
c36ed9cf 35?>
e9f8ea4e 36 <br>
e8e0acdf 37 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0"><tr><td bgcolor="<?php echo $color[0] ?>">
38 <center><b><?php echo _("Options") . ' - ' . _("Display Preferences"); ?></b></center>
c36ed9cf 39 </td></tr></table>
40
e8e0acdf 41 <form name="f" action="options.php" method="post">
42 <table width="100%" cellpadding="0" cellspacing="2" border="0">
c36ed9cf 43 <tr>
e8e0acdf 44 <td align="right" nowrap><?php echo _("Theme"); ?>:
c36ed9cf 45 </td><td>
8442ac08 46<?php
e8e0acdf 47 echo ' <tt><select name="chosentheme">' . "\n";
c36ed9cf 48 for ($i = 0; $i < count($theme); $i++) {
e8e0acdf 49 if ($theme[$i]['PATH'] == $chosen_theme)
50 echo ' <option selected value="'.$theme[$i]['PATH'].'">'.$theme[$i]['NAME']."\n";
c36ed9cf 51 else
e8e0acdf 52 echo ' <option value="'.$theme[$i]['PATH'].'">'.$theme[$i]['NAME']."\n";
c36ed9cf 53 }
e8e0acdf 54 echo ' </select></tt>';
c36ed9cf 55?>
56 </td>
57 </tr>
58 <tr>
e8e0acdf 59 <td valign="top" align="right" nowrap><?php echo _("Language"); ?>:
c36ed9cf 60 </td><td>
8442ac08 61<?php
e8e0acdf 62 echo ' <tt><select name="language">' . "\n";
441f2d33 63 foreach ($languages as $code => $name) {
c36ed9cf 64 if ($code==$chosen_language)
e8e0acdf 65 echo ' <OPTION SELECTED VALUE="'.$code.'">'.$languages[$code]['NAME']."\n";
c36ed9cf 66 else
f3b4824b 67 echo ' <OPTION VALUE="'.$code.'">'.$languages[$code]['NAME']."\n";
441f2d33 68 }
e8e0acdf 69 echo ' </select></tt>';
441f2d33 70 if (! $use_gettext)
b61ed24d 71 echo '<br><small>This system doesn\'t support multiple languages</small>';
441f2d33 72
c36ed9cf 73?>
74 </td>
75 <tr>
76 <td align=right nowrap>&nbsp;
e8e0acdf 77 <?php echo _("Use Javascript or HTML addressbook?") . '</td><td>';
c36ed9cf 78 if ($use_javascript_addr_book == true) {
e8e0acdf 79 echo ' <input type="radio" name="javascript_abook" value="1" checked> ' . _("JavaScript") . '&nbsp;&nbsp;&nbsp;&nbsp;';
80 echo ' <input type="radio" name="javascript_abook" value="0"> ' . _("HTML");
c36ed9cf 81 } else {
e8e0acdf 82 echo ' <input type="radio" name="javascript_abook" value="1"> ' . _("JavaScript") . '&nbsp;&nbsp;&nbsp;&nbsp;';
83 echo ' <input type="radio" name="javascript_abook" value="0" checked> ' . _("HTML");
c36ed9cf 84 }
85 ?>
86 </td>
87 </tr>
88 <tr>
6170c5b6 89 <td align=right nowrap><?php echo _("Number of Messages to Index"); ?>:
c36ed9cf 90 </td><td>
8442ac08 91<?php
c36ed9cf 92 if (isset($show_num))
e8e0acdf 93 echo ' <tt><input type="text" size="5" name="shownum" value="'.$show_num.'"></tt><br>';
c36ed9cf 94 else
e8e0acdf 95 echo ' <tt><input type="text" size="5" name="shownum" value="25"></tt><br>';
c36ed9cf 96?>
97 </td>
98 </tr>
99 <tr>
e8e0acdf 100 <td align="right" nowrap><?php echo _("Wrap incoming text at"); ?>:
c36ed9cf 101 </td><td>
8442ac08 102<?php
c36ed9cf 103 if (isset($wrap_at))
e8e0acdf 104 echo ' <tt><input type="text" size="5" name="wrapat" value="'.$wrap_at.'"></tt><br>';
c36ed9cf 105 else
e8e0acdf 106 echo ' <tt><input type="tex" size="5" name="wrapat" value="86"></tt><br>';
c36ed9cf 107?>
108 </td>
109 </tr>
110 <tr>
e8e0acdf 111 <td align="right" nowrap><?php echo _("Size of editor window"); ?>:
c36ed9cf 112 </td><td>
8442ac08 113<?php
c36ed9cf 114 if ($editor_size >= 10 && $editor_size <= 255)
e8e0acdf 115 echo ' <tt><input type="text" size="5" name="editorsize" value="'.$editor_size.'"></tt><br>';
c36ed9cf 116 else
e8e0acdf 117 echo ' <tt><input type="text" size="5" name="editorsize" value="76"></tt><br>';
c36ed9cf 118?>
119 </td>
120 </tr>
121 <tr>
e8e0acdf 122 <td align="right" nowrap><?PHP echo _("Location of folder list") ?>:</td>
9a732bb6 123 <td><select name="folder_new_location">
124 <option value="left"<?PHP
125 if ($location_of_bar != 'right') echo ' SELECTED';
e190b5b0 126 ?>><?PHP echo _("Left"); ?></option>
9a732bb6 127 <option value="right"<?PHP
128 if ($location_of_bar == 'right') echo ' SELECTED';
e190b5b0 129 ?>><?PHP echo _("Right"); ?></option>
9a732bb6 130 </select>
131 </td>
132 </tr>
133 <tr>
e8e0acdf 134 <td align="right" nowrap><?PHP echo _("Location of buttons when composing") ?>:</td>
441f2d33 135 <td><select name="button_new_location">
136 <option value="top"<?PHP
137 if ($location_of_buttons == 'top') echo ' SELECTED';
e190b5b0 138 ?>><?PHP echo _("Before headers"); ?></option>
441f2d33 139 <option value="between"<?PHP
140 if ($location_of_buttons == 'between') echo ' SELECTED';
e190b5b0 141 ?>><?PHP echo _("Between headers and message body"); ?></option>
441f2d33 142 <option value="bottom"<?PHP
143 if ($location_of_buttons == 'bottom') echo ' SELECTED';
e190b5b0 144 ?>><?PHP echo _("After message body"); ?></option>
441f2d33 145 </select>
146 </td>
147 </tr>
148 <tr>
9a732bb6 149 <td align=right nowrap><?php echo _("Width of folder list"); ?>:
c36ed9cf 150 </td><td>
8442ac08 151<?php
e8e0acdf 152 echo ' <select name="leftsize">' . "\n";
c36ed9cf 153 if ($left_size == 100)
38bb54ba 154 echo '<option value="100" selected>100 pixels' . "\n";
c36ed9cf 155 else
38bb54ba 156 echo '<option value="100">100 pixels' . "\n";
c36ed9cf 157
158 if ($left_size == 125)
38bb54ba 159 echo '<option value="125" selected>125 pixels' . "\n";
c36ed9cf 160 else
38bb54ba 161 echo '<option value="125">125 pixels' . "\n";
c36ed9cf 162
163 if ($left_size == 150)
38bb54ba 164 echo '<option value="150" selected>150 pixels' . "\n";
c36ed9cf 165 else
38bb54ba 166 echo '<option value="150">150 pixels' . "\n";
c36ed9cf 167
168 if ($left_size == 175)
38bb54ba 169 echo '<option value="175" selected>175 pixels' . "\n";
c36ed9cf 170 else
38bb54ba 171 echo '<option value="175">175 pixels' . "\n";
c36ed9cf 172
173 if (($left_size == 200) || ($left_size == ""))
38bb54ba 174 echo '<option value="200" selected>200 pixels' . "\n";
c36ed9cf 175 else
38bb54ba 176 echo '<option value="200">200 pixels' . "\n";
c36ed9cf 177
178 if (($left_size == 225))
38bb54ba 179 echo '<option value="225" selected>225 pixels' . "\n";
c36ed9cf 180 else
38bb54ba 181 echo '<option value="225">225 pixels' . "\n";
c36ed9cf 182
183 if (($left_size == 250))
38bb54ba 184 echo '<option value="250" selected>250 pixels' . "\n";
c36ed9cf 185 else
38bb54ba 186 echo '<option value="250">250 pixels' . "\n";
c36ed9cf 187
188 if ($left_size == 275)
38bb54ba 189 echo '<option value="275" selected>275 pixels' . "\n";
c36ed9cf 190 else
38bb54ba 191 echo '<option value="275">275 pixels' . "\n";
c36ed9cf 192
193 if (($left_size == 300))
38bb54ba 194 echo '<option value="300" selected>300 pixels' . "\n";
c36ed9cf 195 else
38bb54ba 196 echo '<option value="300">300 pixels' . "\n";
c36ed9cf 197
38bb54ba 198 echo ' </select>';
c36ed9cf 199?>
200 </td>
201 </tr>
202 <tr>
38bb54ba 203 <td align="right" nowrap><?php echo _("Auto refresh folder list"); ?>:
c36ed9cf 204 </td><td>
8442ac08 205<?php
1de36f81 206 $seconds_str = _("Seconds");
207 $none_str = _("None");
208 $minute_str = _("Minute");
209 $minutes_str = _("Minutes");
210
38bb54ba 211 echo ' <SELECT name="leftrefresh">';
212 if (($left_refresh == 'None') || ($left_refresh == ''))
213 echo ' <OPTION VALUE="None" SELECTED>'.$none_str;
c36ed9cf 214 else
38bb54ba 215 echo ' <OPTION VALUE="None">'.$none_str;
c36ed9cf 216
38bb54ba 217 if (($left_refresh == 10))
218 echo ' <OPTION VALUE="10" SELECTED>10 '.$seconds_str;
c36ed9cf 219 else
38bb54ba 220 echo ' <OPTION VALUE="10">10 '.$seconds_str;
c36ed9cf 221
38bb54ba 222 if (($left_refresh == 20))
223 echo ' <OPTION VALUE="20" SELECTED>20 '.$seconds_str;
c36ed9cf 224 else
38bb54ba 225 echo ' <OPTION VALUE="20">20 '.$seconds_str;
c36ed9cf 226
38bb54ba 227 if (($left_refresh == 30))
228 echo ' <OPTION VALUE="30" SELECTED>30 '.$seconds_str;
c36ed9cf 229 else
38bb54ba 230 echo ' <OPTION VALUE="30">30 '.$seconds_str;
c36ed9cf 231
38bb54ba 232 if (($left_refresh == 60))
233 echo ' <OPTION VALUE="60" SELECTED>1 '.$minute_str;
c36ed9cf 234 else
38bb54ba 235 echo ' <OPTION VALUE="60">1 '.$minute_str;
c36ed9cf 236
38bb54ba 237 if (($left_refresh == 120))
238 echo ' <OPTION VALUE="120" SELECTED>2 '.$minutes_str;
c36ed9cf 239 else
38bb54ba 240 echo ' <OPTION VALUE="120">2 '.$minutes_str;
c36ed9cf 241
38bb54ba 242 if (($left_refresh == 180))
243 echo ' <OPTION VALUE="180" SELECTED>3 '.$minutes_str;
c36ed9cf 244 else
38bb54ba 245 echo ' <OPTION VALUE="180">3 '.$minutes_str;
c36ed9cf 246
38bb54ba 247 if (($left_refresh == 240))
248 echo ' <OPTION VALUE="240" SELECTED>4 '.$minutes_str;
c36ed9cf 249 else
38bb54ba 250 echo ' <OPTION VALUE="240">4 '.$minutes_str;
c36ed9cf 251
38bb54ba 252 if (($left_refresh == 300))
253 echo ' <OPTION VALUE="300" SELECTED>5 '.$minutes_str;
c36ed9cf 254 else
38bb54ba 255 echo ' <OPTION VALUE="300">5 '.$minutes_str;
c36ed9cf 256
38bb54ba 257 if (($left_refresh == 420))
258 echo ' <OPTION VALUE="420" SELECTED>7 '.$minutes_str;
c36ed9cf 259 else
38bb54ba 260 echo ' <OPTION VALUE="420">7 '.$minutes_str;
c36ed9cf 261
38bb54ba 262 if (($left_refresh == 600))
263 echo ' <OPTION VALUE="600" SELECTED>10 '.$minutes_str;
c36ed9cf 264 else
b61ed24d 265 echo ' <OPTION VALUE="600">10 '.$minutes_str;
c36ed9cf 266
38bb54ba 267 if (($left_refresh == 720))
268 echo ' <OPTION VALUE="720" SELECTED>12 '.$minutes_str;
c36ed9cf 269 else
38bb54ba 270 echo ' <OPTION VALUE="720">12 '.$minutes_str;
c36ed9cf 271
38bb54ba 272 if (($left_refresh == 900))
273 echo ' <OPTION VALUE="900" SELECTED>15 '.$minutes_str;
c36ed9cf 274 else
38bb54ba 275 echo ' <OPTION VALUE="900">15 '.$minutes_str;
c36ed9cf 276
38bb54ba 277 if (($left_refresh == 1200))
278 echo ' <OPTION VALUE="1200" SELECTED>20 '.$minutes_str;
c36ed9cf 279 else
38bb54ba 280 echo ' <OPTION VALUE="1200">20 '.$minutes_str;
c36ed9cf 281
38bb54ba 282 if (($left_refresh == 1500))
283 echo ' <OPTION VALUE="1500" SELECTED>25 '.$minutes_str;
c36ed9cf 284 else
38bb54ba 285 echo' <OPTION VALUE="1500">25 '.$minutes_str;
c36ed9cf 286
38bb54ba 287 if (($left_refresh == 1800))
288 echo ' <OPTION VALUE="1800" SELECTED>30 '.$minutes_str;
c36ed9cf 289 else
38bb54ba 290 echo ' <OPTION VALUE="1800">30 '.$minutes_str;
c36ed9cf 291
e8e0acdf 292 echo ' </SELECT>';
c36ed9cf 293?>
294 </td>
295 </tr>
e2ab93e5 296 <tr>
297 <td valign=top align=right>
298 <?php echo _("Show HTML version by default"); ?>:
299 </td>
300 <td>
301 <input type=checkbox name=showhtmldefault <?php
302 if (isset($show_html_default) && $show_html_default)
303 echo " checked"; ?>>
304 <?php
305echo _("Yes, show me the HTML version of a mail message, if it is available.");
306 ?>
307 </td>
308 </tr>
e8e0acdf 309 <?php do_hook('options_display_inside'); ?>
c36ed9cf 310 <tr>
311 <td>&nbsp;
312 </td><td>
32f4685b 313 <input type="submit" value="<?php echo _("Submit"); ?>"name="submit_display">
c36ed9cf 314 </td>
315 </tr>
316 </table>
317 </form>
e8e0acdf 318 <?php do_hook('options_display_bottom'); ?>
c36ed9cf 319</body></html>