Finished converting folder options page to new options stuff. Moved some options...
[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 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');
19
20 displayPageHeader($color, 'None');
21 $language = getPref($data_dir, $username, 'language');
22 ?>
23 <br>
24 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
25 <tr><td bgcolor="<?php echo $color[0] ?>" align="center">
26
27 <b><?php echo _("Options") . ' - ' . _("Display Preferences"); ?></b><br>
28
29 <table width="100%" border="0" cellpadding="1" cellspacing="1">
30 <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
31
32 <form name="f" action="options.php" method="post"><br>
33 <table width="100%" cellpadding="2" cellspacing="0" border="0">
34 <?php
35
36 /* Build a simple array into which we will build options. */
37 $optvals = array();
38
39 $theme_values = array();
40 foreach ($theme as $theme_key => $theme_attributes) {
41 $theme_values[$theme_attributes['PATH']] = $theme_attributes['NAME'];
42 }
43 $optvals[] = array(
44 'name' => 'chosen_theme',
45 'caption' => _("Theme"),
46 'type' => SMOPT_TYPE_STRLIST,
47 'refresh' => SMOPT_REFRESH_ALL,
48 'posvals' => $theme_values
49 );
50
51 $language_values = array();
52 foreach ($languages as $lang_key => $lang_attributes) {
53 if (isset($lang_attributes['NAME'])) {
54 $language_values[$lang_key] = $lang_attributes['NAME'];
55 }
56 }
57 $optvals[] = array(
58 'name' => 'language',
59 'caption' => _("Language"),
60 'type' => SMOPT_TYPE_STRLIST,
61 'refresh' => SMOPT_REFRESH_ALL,
62 'posvals' => $language_values
63 );
64
65 /* Set values for the "use javascript" option. */
66 $optvals[] = array(
67 'name' => 'javascript_setting',
68 'caption' => _("Use Javascript"),
69 'type' => SMOPT_TYPE_STRLIST,
70 'refresh' => SMOPT_REFRESH_ALL,
71 'posvals' => array(SMPREF_JS_AUTODETECT => _("Autodetect"),
72 SMPREF_JS_ON => _("Always"),
73 SMPREF_JS_OFF => _("Never"))
74 );
75
76 $js_autodetect_results = SMPREF_JS_OFF;
77 $optvals[] = array(
78 'name' => 'js_autodetect_results',
79 'caption' => '',
80 'type' => SMOPT_TYPE_HIDDEN,
81 'refresh' => SMOPT_REFRESH_NONE
82 );
83
84 $optvals[] = array(
85 'name' => 'show_num',
86 'caption' => _("Number of Messages to Index"),
87 'type' => SMOPT_TYPE_INTEGER,
88 'refresh' => SMOPT_REFRESH_NONE
89 );
90
91 $optvals[] = array(
92 'name' => 'alt_index_colors',
93 'caption' => _("Enable Alternating Row Colors"),
94 'type' => SMOPT_TYPE_BOOLEAN,
95 'refresh' => SMOPT_REFRESH_NONE
96 );
97
98 $optvals[] = array(
99 'name' => 'page_selector',
100 'caption' => _("Enable Page Selector"),
101 'type' => SMOPT_TYPE_BOOLEAN,
102 'refresh' => SMOPT_REFRESH_NONE
103 );
104
105 $optvals[] = array(
106 'name' => 'page_selector_max',
107 'caption' => _("Maximum Number of Pages to Show"),
108 'type' => SMOPT_TYPE_INTEGER,
109 'refresh' => SMOPT_REFRESH_NONE
110 );
111
112 $optvals[] = array(
113 'name' => 'wrap_at',
114 'caption' => _("Wrap Incoming Text At"),
115 'type' => SMOPT_TYPE_INTEGER,
116 'refresh' => SMOPT_REFRESH_NONE
117 );
118
119 $optvals[] = array(
120 'name' => 'editor_size',
121 'caption' => _("Size of Editor Window"),
122 'type' => SMOPT_TYPE_INTEGER,
123 'refresh' => SMOPT_REFRESH_NONE
124 );
125
126 $optvals[] = array(
127 'name' => 'location_of_buttons',
128 'caption' => _("Location of Buttons when Composing"),
129 'type' => SMOPT_TYPE_STRLIST,
130 'refresh' => SMOPT_REFRESH_NONE,
131 'posvals' => array(SMPREF_LOC_TOP => _("Before headers"),
132 SMPREF_LOC_BETWEEN => _("Between headers and message body"),
133 SMPREF_LOC_BOTTOM => _("After message body"))
134 );
135
136 $optvals[] = array(
137 'name' => 'use_javascript_addr_book',
138 'caption' => _("Addressbook Display Format"),
139 'type' => SMOPT_TYPE_STRLIST,
140 'refresh' => SMOPT_REFRESH_NONE,
141 'posvals' => array('1' => _("Javascript"),
142 '0' => _("HTML"))
143 );
144
145 $optvals[] = array(
146 'name' => 'show_html_default',
147 'caption' => _("Show HTML Version by Default"),
148 'type' => SMOPT_TYPE_BOOLEAN,
149 'refresh' => SMOPT_REFRESH_NONE
150 );
151
152 $optvals[] = array(
153 'name' => 'include_self_reply_all',
154 'caption' => _("Remove Me from CC when I Reply All"),
155 'type' => SMOPT_TYPE_BOOLEAN,
156 'refresh' => SMOPT_REFRESH_NONE
157 );
158
159 $optvals[] = array(
160 'name' => 'show_xmailer_default',
161 'caption' => _("Enable Mailer Display"),
162 'type' => SMOPT_TYPE_BOOLEAN,
163 'refresh' => SMOPT_REFRESH_NONE
164 );
165
166 /* Build all these values into an array of SquirrelOptions objects. */
167 $options = createOptionArray($optvals);
168
169 /* Print the row for each option. */
170 foreach ($options as $option) {
171 if ($option->type != SMOPT_TYPE_HIDDEN) {
172 echo "<TR>\n";
173 echo ' <TD ALIGN="RIGHT" VALIGN="MIDDLE" NOWRAP>'
174 . $option->caption . ":</TD>\n";
175 echo ' <TD>' . $option->createHTMLWidget() . "</TD>\n";
176 echo "</TR>\n";
177 } else {
178 echo $option->createHTMLWidget();
179 }
180 }
181
182 echo '<tr><td colspan=2><hr noshade></td></tr>';
183 do_hook('options_display_inside');
184 OptionSubmit( 'submit_display' );
185 ?>
186
187 </table>
188 </form>
189
190 <?php do_hook('options_display_bottom'); ?>
191
192 </td></tr>
193 </table>
194
195 <SCRIPT LANGUAGE="JavaScript"><!--
196 document.forms[0].new_js_autodetect_results.value = '<?php echo SMPREF_JS_ON; ?>';
197 // --></SCRIPT>
198
199 </td></tr>
200 </table>
201 </body></html>