22254bbf13d7f83dc8b8784161c65f4f1a015381
[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 $optgrps = array();
38 $optvals = array();
39
40 /******************************************************/
41 /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */
42 /******************************************************/
43 define('SMOPT_GRP_GENERAL', 0);
44 define('SMOPT_GRP_MAILBOX', 1);
45 define('SMOPT_GRP_MESSAGE', 2);
46
47 /*** Load the General Options into the array ***/
48 $optgrps[SMOPT_GRP_GENERAL] = _("General Display Options");
49 $optvals[SMOPT_GRP_GENERAL] = array();
50
51 /* Load the theme option. */
52 $theme_values = array();
53 foreach ($theme as $theme_key => $theme_attributes) {
54 $theme_values[$theme_attributes['PATH']] = $theme_attributes['NAME'];
55 }
56 $optvals[SMOPT_GRP_GENERAL][] = array(
57 'name' => 'chosen_theme',
58 'caption' => _("Theme"),
59 'type' => SMOPT_TYPE_STRLIST,
60 'refresh' => SMOPT_REFRESH_ALL,
61 'posvals' => $theme_values
62 );
63
64 $language_values = array();
65 foreach ($languages as $lang_key => $lang_attributes) {
66 if (isset($lang_attributes['NAME'])) {
67 $language_values[$lang_key] = $lang_attributes['NAME'];
68 }
69 }
70 $optvals[SMOPT_GRP_GENERAL][] = array(
71 'name' => 'language',
72 'caption' => _("Language"),
73 'type' => SMOPT_TYPE_STRLIST,
74 'refresh' => SMOPT_REFRESH_ALL,
75 'posvals' => $language_values
76 );
77
78 /* Set values for the "use javascript" option. */
79 $optvals[SMOPT_GRP_GENERAL][] = array(
80 'name' => 'javascript_setting',
81 'caption' => _("Use Javascript"),
82 'type' => SMOPT_TYPE_STRLIST,
83 'refresh' => SMOPT_REFRESH_ALL,
84 'posvals' => array(SMPREF_JS_AUTODETECT => _("Autodetect"),
85 SMPREF_JS_ON => _("Always"),
86 SMPREF_JS_OFF => _("Never"))
87 );
88
89 $js_autodetect_results = SMPREF_JS_OFF;
90 $optvals[SMOPT_GRP_GENERAL][] = array(
91 'name' => 'js_autodetect_results',
92 'caption' => '',
93 'type' => SMOPT_TYPE_HIDDEN,
94 'refresh' => SMOPT_REFRESH_NONE
95 );
96
97 /*** Load the General Options into the array ***/
98 $optgrps[SMOPT_GRP_MAILBOX] = _("Mailbox Display Options");
99 $optvals[SMOPT_GRP_MAILBOX] = array();
100
101 $optvals[SMOPT_GRP_MAILBOX][] = array(
102 'name' => 'show_num',
103 'caption' => _("Number of Messages to Index"),
104 'type' => SMOPT_TYPE_INTEGER,
105 'refresh' => SMOPT_REFRESH_NONE,
106 'size' => SMOPT_SIZE_TINY
107 );
108
109 $optvals[SMOPT_GRP_MAILBOX][] = array(
110 'name' => 'alt_index_colors',
111 'caption' => _("Enable Alternating Row Colors"),
112 'type' => SMOPT_TYPE_BOOLEAN,
113 'refresh' => SMOPT_REFRESH_NONE
114 );
115
116 $optvals[SMOPT_GRP_MAILBOX][] = array(
117 'name' => 'page_selector',
118 'caption' => _("Enable Page Selector"),
119 'type' => SMOPT_TYPE_BOOLEAN,
120 'refresh' => SMOPT_REFRESH_NONE
121 );
122
123 $optvals[SMOPT_GRP_MAILBOX][] = array(
124 'name' => 'page_selector_max',
125 'caption' => _("Maximum Number of Pages to Show"),
126 'type' => SMOPT_TYPE_INTEGER,
127 'refresh' => SMOPT_REFRESH_NONE,
128 'size' => SMOPT_SIZE_TINY
129 );
130
131 /*** Load the General Options into the array ***/
132 $optgrps[SMOPT_GRP_MESSAGE] = _("Message Display and Composition");
133 $optvals[SMOPT_GRP_MESSAGE] = array();
134
135 $optvals[SMOPT_GRP_MESSAGE][] = array(
136 'name' => 'wrap_at',
137 'caption' => _("Wrap Incoming Text At"),
138 'type' => SMOPT_TYPE_INTEGER,
139 'refresh' => SMOPT_REFRESH_NONE,
140 'size' => SMOPT_SIZE_TINY
141 );
142
143 $optvals[SMOPT_GRP_MESSAGE][] = array(
144 'name' => 'editor_size',
145 'caption' => _("Size of Editor Window"),
146 'type' => SMOPT_TYPE_INTEGER,
147 'refresh' => SMOPT_REFRESH_NONE,
148 'size' => SMOPT_SIZE_TINY
149 );
150
151 $optvals[SMOPT_GRP_MESSAGE][] = array(
152 'name' => 'location_of_buttons',
153 'caption' => _("Location of Buttons when Composing"),
154 'type' => SMOPT_TYPE_STRLIST,
155 'refresh' => SMOPT_REFRESH_NONE,
156 'posvals' => array(SMPREF_LOC_TOP => _("Before headers"),
157 SMPREF_LOC_BETWEEN => _("Between headers and message body"),
158 SMPREF_LOC_BOTTOM => _("After message body"))
159 );
160
161 $optvals[SMOPT_GRP_MESSAGE][] = array(
162 'name' => 'use_javascript_addr_book',
163 'caption' => _("Addressbook Display Format"),
164 'type' => SMOPT_TYPE_STRLIST,
165 'refresh' => SMOPT_REFRESH_NONE,
166 'posvals' => array('1' => _("Javascript"),
167 '0' => _("HTML"))
168 );
169
170 $optvals[SMOPT_GRP_MESSAGE][] = array(
171 'name' => 'show_html_default',
172 'caption' => _("Show HTML Version by Default"),
173 'type' => SMOPT_TYPE_BOOLEAN,
174 'refresh' => SMOPT_REFRESH_NONE
175 );
176
177 $optvals[SMOPT_GRP_MESSAGE][] = array(
178 'name' => 'include_self_reply_all',
179 'caption' => _("Include Me in CC when I Reply All"),
180 'type' => SMOPT_TYPE_BOOLEAN,
181 'refresh' => SMOPT_REFRESH_NONE
182 );
183
184 $optvals[SMOPT_GRP_MESSAGE][] = array(
185 'name' => 'show_xmailer_default',
186 'caption' => _("Enable Mailer Display"),
187 'type' => SMOPT_TYPE_BOOLEAN,
188 'refresh' => SMOPT_REFRESH_NONE
189 );
190
191 $optvals[SMOPT_GRP_MESSAGE][] = array(
192 'name' => 'attachment_common_show_images',
193 'caption' => _("Enable display of images with email, below attachment box"),
194 'type' => SMOPT_TYPE_BOOLEAN,
195 'refresh' => SMOPT_REFRESH_NONE
196 );
197
198 $optvals[SMOPT_GRP_MESSAGE][] = array(
199 'name' => 'pf_subtle_link',
200 'caption' => _("Printer Friendly: Subtle Link"),
201 'type' => SMOPT_TYPE_BOOLEAN,
202 'refresh' => SMOPT_REFRESH_NONE
203 );
204
205 $optvals[SMOPT_GRP_MESSAGE][] = array(
206 'name' => 'pf_cleandisplay',
207 'caption' => _("Printer Friendly: Clean Display"),
208 'type' => SMOPT_TYPE_BOOLEAN,
209 'refresh' => SMOPT_REFRESH_NONE
210 );
211
212 /* Build and output the option groups. */
213 $option_groups = createOptionGroups($optgrps, $optvals);
214 printOptionGroups($option_groups);
215
216 do_hook('options_display_inside');
217 echo "<TR><TD>&nbsp;</TD></TR>\n";
218
219 OptionSubmit( 'submit_display' );
220 ?>
221
222 </table>
223 </form>
224
225 <?php do_hook('options_display_bottom'); ?>
226
227 </td></tr>
228 </table>
229
230 <SCRIPT LANGUAGE="JavaScript"><!--
231 document.forms[0].new_js_autodetect_results.value = '<?php echo SMPREF_JS_ON; ?>';
232 // --></SCRIPT>
233
234 </td></tr>
235 </table>
236 </body></html>