Finished converting folder options page to new options stuff. Moved some options...
[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. */
37 $optvals = array();
a3ec3c91 38
ce393174 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
a3ec3c91 65 /* Set values for the "use javascript" option. */
66 $optvals[] = array(
67 'name' => 'javascript_setting',
ce393174 68 'caption' => _("Use Javascript"),
a3ec3c91 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(
a440e68f 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(
a3ec3c91 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
a3ec3c91 126 $optvals[] = array(
127 'name' => 'location_of_buttons',
ce393174 128 'caption' => _("Location of Buttons when Composing"),
a3ec3c91 129 'type' => SMOPT_TYPE_STRLIST,
130 'refresh' => SMOPT_REFRESH_NONE,
ce393174 131 'posvals' => array(SMPREF_LOC_TOP => _("Before headers"),
132 SMPREF_LOC_BETWEEN => _("Between headers and message body"),
133 SMPREF_LOC_BOTTOM => _("After message body"))
a3ec3c91 134 );
135
136 $optvals[] = array(
a440e68f 137 'name' => 'use_javascript_addr_book',
138 'caption' => _("Addressbook Display Format"),
ce393174 139 'type' => SMOPT_TYPE_STRLIST,
a440e68f 140 'refresh' => SMOPT_REFRESH_NONE,
141 'posvals' => array('1' => _("Javascript"),
142 '0' => _("HTML"))
fd87494d 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',
0e2feeb5 154 'caption' => _("Remove Me from CC when I Reply All"),
fd87494d 155 'type' => SMOPT_TYPE_BOOLEAN,
156 'refresh' => SMOPT_REFRESH_NONE
157 );
158
159 $optvals[] = array(
9ab0d96f 160 'name' => 'show_xmailer_default',
a440e68f 161 'caption' => _("Enable Mailer Display"),
9ab0d96f 162 'type' => SMOPT_TYPE_BOOLEAN,
163 'refresh' => SMOPT_REFRESH_NONE
164 );
165
ce393174 166 /* Build all these values into an array of SquirrelOptions objects. */
a3ec3c91 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";
b5efadfa 173 echo ' <TD ALIGN="RIGHT" VALIGN="MIDDLE" NOWRAP>'
174 . $option->caption . ":</TD>\n";
a3ec3c91 175 echo ' <TD>' . $option->createHTMLWidget() . "</TD>\n";
176 echo "</TR>\n";
177 } else {
178 echo $option->createHTMLWidget();
179 }
180 }
181
2016e645 182 echo '<tr><td colspan=2><hr noshade></td></tr>';
183 do_hook('options_display_inside');
84c18709 184 OptionSubmit( 'submit_display' );
2016e645 185?>
f1e6f580 186
e7db48af 187 </table>
c36ed9cf 188 </form>
e7db48af 189
e8e0acdf 190 <?php do_hook('options_display_bottom'); ?>
e7db48af 191
192 </td></tr>
193 </table>
194
23d6bd09 195<SCRIPT LANGUAGE="JavaScript"><!--
a3ec3c91 196 document.forms[0].new_js_autodetect_results.value = '<?php echo SMPREF_JS_ON; ?>';
23d6bd09 197// --></SCRIPT>
198
e7db48af 199</td></tr>
200</table>
23d6bd09 201</body></html>