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