Another big chunk of changes to options pages.
[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
ff8a98e7 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');
45cfc124 18 require_once('../functions/options.php');
19
e8e0acdf 20 displayPageHeader($color, 'None');
ce393174 21 $language = getPref($data_dir, $username, 'language');
c36ed9cf 22?>
e9f8ea4e 23 <br>
e7db48af 24<table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
25<tr><td bgcolor="<?php echo $color[0] ?>" align="center">
c36ed9cf 26
cd41fc8d 27 <b><?php echo _("Options") . ' - ' . _("Display Preferences"); ?></b><br>
e7db48af 28
cd41fc8d 29 <table width="100%" border="0" cellpadding="1" cellspacing="1">
30 <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
e7db48af 31
32 <form name="f" action="options.php" method="post"><br>
33 <table width="100%" cellpadding="2" cellspacing="0" border="0">
8442ac08 34<?php
a3ec3c91 35
ce393174 36 /* Build a simple array into which we will build options. */
bbcafebd 37 $optgrps = array();
38 $optvals = array();
a3ec3c91 39
bbcafebd 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. */
ce393174 52 $theme_values = array();
53 foreach ($theme as $theme_key => $theme_attributes) {
54 $theme_values[$theme_attributes['PATH']] = $theme_attributes['NAME'];
55 }
bbcafebd 56 $optvals[SMOPT_GRP_GENERAL][] = array(
ce393174 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 }
bbcafebd 70 $optvals[SMOPT_GRP_GENERAL][] = array(
ce393174 71 'name' => 'language',
72 'caption' => _("Language"),
73 'type' => SMOPT_TYPE_STRLIST,
74 'refresh' => SMOPT_REFRESH_ALL,
75 'posvals' => $language_values
76 );
77
a3ec3c91 78 /* Set values for the "use javascript" option. */
bbcafebd 79 $optvals[SMOPT_GRP_GENERAL][] = array(
a3ec3c91 80 'name' => 'javascript_setting',
ce393174 81 'caption' => _("Use Javascript"),
a3ec3c91 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;
bbcafebd 90 $optvals[SMOPT_GRP_GENERAL][] = array(
a3ec3c91 91 'name' => 'js_autodetect_results',
92 'caption' => '',
93 'type' => SMOPT_TYPE_HIDDEN,
94 'refresh' => SMOPT_REFRESH_NONE
95 );
96
bbcafebd 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(
a3ec3c91 102 'name' => 'show_num',
103 'caption' => _("Number of Messages to Index"),
104 'type' => SMOPT_TYPE_INTEGER,
bbcafebd 105 'refresh' => SMOPT_REFRESH_NONE,
106 'size' => SMOPT_SIZE_TINY
a3ec3c91 107 );
108
bbcafebd 109 $optvals[SMOPT_GRP_MAILBOX][] = array(
a440e68f 110 'name' => 'alt_index_colors',
111 'caption' => _("Enable Alternating Row Colors"),
112 'type' => SMOPT_TYPE_BOOLEAN,
113 'refresh' => SMOPT_REFRESH_NONE
114 );
115
bbcafebd 116 $optvals[SMOPT_GRP_MAILBOX][] = array(
a440e68f 117 'name' => 'page_selector',
118 'caption' => _("Enable Page Selector"),
119 'type' => SMOPT_TYPE_BOOLEAN,
120 'refresh' => SMOPT_REFRESH_NONE
121 );
122
bbcafebd 123 $optvals[SMOPT_GRP_MAILBOX][] = array(
a440e68f 124 'name' => 'page_selector_max',
125 'caption' => _("Maximum Number of Pages to Show"),
126 'type' => SMOPT_TYPE_INTEGER,
bbcafebd 127 'refresh' => SMOPT_REFRESH_NONE,
128 'size' => SMOPT_SIZE_TINY
a440e68f 129 );
130
bbcafebd 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(
a3ec3c91 136 'name' => 'wrap_at',
137 'caption' => _("Wrap Incoming Text At"),
138 'type' => SMOPT_TYPE_INTEGER,
bbcafebd 139 'refresh' => SMOPT_REFRESH_NONE,
140 'size' => SMOPT_SIZE_TINY
a3ec3c91 141 );
142
bbcafebd 143 $optvals[SMOPT_GRP_MESSAGE][] = array(
a3ec3c91 144 'name' => 'editor_size',
145 'caption' => _("Size of Editor Window"),
146 'type' => SMOPT_TYPE_INTEGER,
bbcafebd 147 'refresh' => SMOPT_REFRESH_NONE,
148 'size' => SMOPT_SIZE_TINY
a3ec3c91 149 );
150
bbcafebd 151 $optvals[SMOPT_GRP_MESSAGE][] = array(
a3ec3c91 152 'name' => 'location_of_buttons',
ce393174 153 'caption' => _("Location of Buttons when Composing"),
a3ec3c91 154 'type' => SMOPT_TYPE_STRLIST,
155 'refresh' => SMOPT_REFRESH_NONE,
ce393174 156 'posvals' => array(SMPREF_LOC_TOP => _("Before headers"),
157 SMPREF_LOC_BETWEEN => _("Between headers and message body"),
158 SMPREF_LOC_BOTTOM => _("After message body"))
a3ec3c91 159 );
160
bbcafebd 161 $optvals[SMOPT_GRP_MESSAGE][] = array(
a440e68f 162 'name' => 'use_javascript_addr_book',
163 'caption' => _("Addressbook Display Format"),
ce393174 164 'type' => SMOPT_TYPE_STRLIST,
a440e68f 165 'refresh' => SMOPT_REFRESH_NONE,
166 'posvals' => array('1' => _("Javascript"),
167 '0' => _("HTML"))
fd87494d 168 );
169
bbcafebd 170 $optvals[SMOPT_GRP_MESSAGE][] = array(
fd87494d 171 'name' => 'show_html_default',
172 'caption' => _("Show HTML Version by Default"),
173 'type' => SMOPT_TYPE_BOOLEAN,
174 'refresh' => SMOPT_REFRESH_NONE
175 );
176
bbcafebd 177 $optvals[SMOPT_GRP_MESSAGE][] = array(
fd87494d 178 'name' => 'include_self_reply_all',
bbcafebd 179 'caption' => _("Include Me in CC when I Reply All"),
fd87494d 180 'type' => SMOPT_TYPE_BOOLEAN,
181 'refresh' => SMOPT_REFRESH_NONE
182 );
183
bbcafebd 184 $optvals[SMOPT_GRP_MESSAGE][] = array(
9ab0d96f 185 'name' => 'show_xmailer_default',
a440e68f 186 'caption' => _("Enable Mailer Display"),
9ab0d96f 187 'type' => SMOPT_TYPE_BOOLEAN,
188 'refresh' => SMOPT_REFRESH_NONE
189 );
190
bbcafebd 191 /* Build and output the option groups. */
192 $option_groups = createOptionGroups($optgrps, $optvals);
193 printOptionGroups($option_groups);
194
195 do_hook('options_display_inside');
196 echo "<TR><TD>&nbsp;</TD></TR>\n";
a3ec3c91 197
bbcafebd 198 OptionSubmit( 'submit_display' );
2016e645 199?>
f1e6f580 200
e7db48af 201 </table>
c36ed9cf 202 </form>
e7db48af 203
e8e0acdf 204 <?php do_hook('options_display_bottom'); ?>
e7db48af 205
206 </td></tr>
207 </table>
208
23d6bd09 209<SCRIPT LANGUAGE="JavaScript"><!--
a3ec3c91 210 document.forms[0].new_js_autodetect_results.value = '<?php echo SMPREF_JS_ON; ?>';
23d6bd09 211// --></SCRIPT>
212
e7db48af 213</td></tr>
214</table>
23d6bd09 215</body></html>